Skip to content

Commit 2d4340b

Browse files
authored
chore: switch default from v5 to v6 (#577)
1 parent f6ec0e2 commit 2d4340b

23 files changed

+119
-51
lines changed

.github/actions/prepare/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ runs:
66
- name: Download node artifact
77
uses: actions/download-artifact@v4
88
with:
9-
name: substrate-contracts-node
9+
name: ink-node
1010
path: ./
1111

1212
- name: Start local node
1313
shell: bash
1414
run: |
15-
tar -xvzf substrate-contracts-node-linux.tar.gz
16-
cd substrate-contracts-node-linux/
17-
chmod +x ./substrate-contracts-node
18-
./substrate-contracts-node --dev &
15+
tar -xvzf ink-node-linux.tar.gz
16+
cd ink-node-linux/
17+
chmod +x ./ink-node
18+
./ink-node --dev &

.github/workflows/e2e-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- run: |
14-
curl -L "https://github.com/paritytech/substrate-contracts-node/releases/latest/download/substrate-contracts-node-linux.tar.gz" -O
14+
curl -L "https://github.com/use-ink/ink-node/releases/latest/download/ink-node-linux.tar.gz" -O
1515
ls -lash
1616
- name: Save node artifact
1717
uses: actions/upload-artifact@v4
1818
with:
19-
name: substrate-contracts-node
19+
name: ink-node
2020
if-no-files-found: error
21-
path: substrate-contracts-node-linux.tar.gz
21+
path: ink-node-linux.tar.gz
2222

2323
ui-chrome-tests:
2424
timeout-minutes: 15

cypress/e2e/contracts/erc20.spec.ts

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,67 @@ describe('ERC20 Contract ', () => {
5353

5454
it(`transfers ${transferValue} Units to another account`, () => {
5555
selectMessage('transfer', 3);
56-
cy.get('.form-field.to').find('.dropdown').click().find('.dropdown__option').eq(3).click();
57-
cy.get('.form-field.value').find('input[type="number"]').eq(0).type(`${transferValue}`);
56+
cy.get('.form-field.to')
57+
.find("input[type='text']")
58+
.clear()
59+
.type('0x60afa252b554aabc4b3253ca2be60dc1d536ec10')
60+
.should('have.value', '0x60afa252b554aabc4b3253ca2be60dc1d536ec10');
61+
cy.get('.form-field.value').find('input[type="number"]').type(`${transferValue}`);
5862
assertCall();
5963
selectMessage('balanceOf', 1);
64+
65+
cy.get('.form-field.owner')
66+
.find("input[type='text']")
67+
.clear()
68+
.type('0x9621dde636de098b43efb0fa9b61facfe328f99d')
69+
.should('have.value', '0x9621dde636de098b43efb0fa9b61facfe328f99d');
6070
assertReturnValue('balanceOf', `${initialSupply - transferValue}`);
6171
});
6272

6373
it(`successfully approves allowance`, () => {
6474
selectMessage('approve', 4);
65-
cy.get('.form-field.spender').find('.dropdown').click().find('.dropdown__option').eq(2).click();
75+
cy.get('.form-field.spender')
76+
.find("input[type='text']")
77+
.clear()
78+
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01')
79+
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01');
6680
cy.get('.form-field.value').find('input[type="number"]').type(`${allowance}`);
6781
assertCall();
6882
selectMessage('allowance', 2);
69-
cy.get('.form-field.spender').find('.dropdown').click().find('.dropdown__option').eq(2).click();
83+
cy.get('.form-field.owner')
84+
.find("input[type='text']")
85+
.clear()
86+
.type('0x9621dde636de098b43efb0fa9b61facfe328f99d')
87+
.should('have.value', '0x9621dde636de098b43efb0fa9b61facfe328f99d');
88+
cy.get('.form-field.spender')
89+
.find("input[type='text']")
90+
.clear()
91+
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01')
92+
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01');
7093
assertReturnValue('allowance', `${allowance}`);
7194
});
7295

7396
it(`transfers ${transferValue} on behalf of alice`, () => {
7497
cy.get('.form-field.caller').click().find('.dropdown__option').eq(2).click();
7598
selectMessage('transferFrom', 5);
76-
cy.get('.form-field.to').find('.dropdown').click().find('.dropdown__option').eq(2).click();
99+
cy.get('.form-field.from')
100+
.find("input[type='text']")
101+
.clear()
102+
.type('0x9621dde636de098b43efb0fa9b61facfe328f99d')
103+
.should('have.value', '0x9621dde636de098b43efb0fa9b61facfe328f99d');
104+
cy.get('.form-field.to')
105+
.find("input[type='text']")
106+
.clear()
107+
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01')
108+
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01');
77109
cy.get('.form-field.value').find('input[type="number"]').type(`${transferValue}`);
78110
assertCall();
79111
selectMessage('balanceOf', 1);
80-
cy.get('.form-field.owner').find('.dropdown').click().find('.dropdown__option').eq(2).click();
112+
cy.get('.form-field.owner')
113+
.find("input[type='text']")
114+
.clear()
115+
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01')
116+
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01');
81117
assertReturnValue('balanceOf', `${transferValue}`);
82118
});
83119
});

cypress/e2e/contracts/mother.spec.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
assertMoveToStep3,
99
assertContractRedirect,
1010
assertInstantiate,
11-
selectAccount,
1211
} from '../../support/util';
1312

1413
describe('Mother Contract ', () => {
@@ -42,8 +41,8 @@ describe('Mother Contract ', () => {
4241

4342
it('displays `bids: Auction` input correctly ', () => {
4443
cy.get('.form-field.bids').within(() => {
45-
cy.contains('Vec<Vec<Option<(AccountId,u128)>>>').should('be.visible');
46-
cy.contains('Vec<Option<(AccountId,u128)>>').should('be.visible');
44+
cy.contains('Vec<Vec<Option<(H160,u128)>>>').should('be.visible');
45+
cy.contains('Vec<Option<(H160,u128)>>').should('be.visible');
4746
cy.get('.vector-field-1').should('have.lengthOf', 1);
4847
cy.get('.vector-field-2')
4948
.should('have.lengthOf', 1)
@@ -68,19 +67,21 @@ describe('Mother Contract ', () => {
6867
cy.get('.vector-field-2').should('have.lengthOf', 3);
6968
});
7069
});
71-
it('displays inputs for `Option<(AccountId,u128)` and sets values', () => {
70+
it('displays inputs for `Option<(H160,u128)` and sets values', () => {
7271
cy.get('.form-field.bids .vector-field-2')
7372
.first()
7473
.each($el => {
7574
cy.wrap($el)
7675
.scrollIntoView()
7776
.within(() => {
7877
cy.get('[data-cy="switch-button"]').click();
79-
cy.contains('0: AccountId').should('be.visible');
80-
cy.get('.dropdown').should('have.lengthOf', 1);
78+
cy.contains('0: H160').should('be.visible');
79+
cy.get("input[type='text']")
80+
.clear()
81+
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01')
82+
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01');
8183
cy.contains('1: u128').should('be.visible');
8284
cy.get("input[type='number']").should('have.lengthOf', 1).type('99999');
83-
selectAccount('bob', 2);
8485
});
8586
});
8687
});

cypress/e2e/contracts/storage_types.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Storage Types Contract', () => {
4646
'getOptionNone',
4747
'getResultOk',
4848
'getResultError',
49-
'getPanic',
49+
//'getPanic',
5050
].forEach((message, index) => {
5151
it(`DryRun ${message}`, () => {
5252
cy.get('.form-field.caller').click().find('.dropdown__option').eq(2).click();

cypress/e2e/instantiateDryRun.spec.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// SPDX-License-Identifier: GPL-3.0-only
33
import { beforeAllContracts, assertUpload, assertMoveToStep2 } from '../support/util';
44

5-
describe('Instantiate dry run', () => {
6-
before(() => {
7-
beforeAllContracts();
5+
describe('Instantiate dry run', async () => {
6+
before(async () => {
7+
await beforeAllContracts();
88
});
99

1010
it('multisig contract uploads', () => {
@@ -18,11 +18,15 @@ describe('Instantiate dry run', () => {
1818
it('displays dry run error and debug message', () => {
1919
// initial multisig dry run is expected to return an error because requirement input value = 0
2020
cy.get('[data-cy="dry-run-result"]').within(() => {
21-
cy.contains('ContractTrapped').should('be.visible');
22-
cy.contains('Contract trapped during execution.').should('be.visible');
23-
cy.contains(
24-
"panicked at 'assertion failed: 0 < requirement && requirement <= owners && owners <= MAX_OWNERS",
25-
).should('be.visible');
21+
cy.contains('Contract reverted! The instantiation will not be successful.').should(
22+
'be.visible',
23+
);
24+
// TODO: Not appearing in v6 for a contract built in debug mode.
25+
//cy.contains('ContractTrapped').should('be.visible');
26+
//cy.contains('Contract trapped during execution.').should('be.visible');
27+
// cy.contains(
28+
// "panicked at 'assertion failed: 0 < requirement && requirement <= owners && owners <= MAX_OWNERS",
29+
// ).should('be.visible');
2630
});
2731
});
2832

cypress/e2e/updateMetadata.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
import { beforeAllContracts, deploy } from '../support/util';
55

66
describe('Update contract metadata', () => {
7-
const messages1 = ['new', 'newDefault', 'failedNew', 'echoAuction', 'revertOrTrap', 'debugLog'];
7+
const messages1 = [
8+
'new',
9+
'newDefault',
10+
'failedNew',
11+
'echoAuction',
12+
'revertOrTrap',
13+
'mutHelloWorld',
14+
];
815
const messages2 = ['new', 'newDefault', 'flip', 'get'];
916

1017
before(() => {

cypress/fixtures/4.2.0/erc20.contract

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

cypress/fixtures/4.2.0/flipper.contract

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

cypress/fixtures/4.2.0/mother.contract

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)