Skip to content

chore: switch default from v5 to v6 #577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ runs:
- name: Download node artifact
uses: actions/download-artifact@v4
with:
name: substrate-contracts-node
name: ink-node
path: ./

- name: Start local node
shell: bash
run: |
tar -xvzf substrate-contracts-node-linux.tar.gz
cd substrate-contracts-node-linux/
chmod +x ./substrate-contracts-node
./substrate-contracts-node --dev &
tar -xvzf ink-node-linux.tar.gz
cd ink-node-linux/
chmod +x ./ink-node
./ink-node --dev &
6 changes: 3 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: |
curl -L "https://github.com/paritytech/substrate-contracts-node/releases/latest/download/substrate-contracts-node-linux.tar.gz" -O
curl -L "https://github.com/use-ink/ink-node/releases/latest/download/ink-node-linux.tar.gz" -O
ls -lash
- name: Save node artifact
uses: actions/upload-artifact@v4
with:
name: substrate-contracts-node
name: ink-node
if-no-files-found: error
path: substrate-contracts-node-linux.tar.gz
path: ink-node-linux.tar.gz

ui-chrome-tests:
timeout-minutes: 15
Expand Down
11 changes: 5 additions & 6 deletions cypress/e2e/contracts/mother.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ describe('Mother Contract ', () => {

it('displays `bids: Auction` input correctly ', () => {
cy.get('.form-field.bids').within(() => {
cy.contains('Vec<Vec<Option<(AccountId,u128)>>>').should('be.visible');
cy.contains('Vec<Option<(AccountId,u128)>>').should('be.visible');
cy.contains('Vec<Vec<Option<(H160,u128)>>>').should('be.visible');
cy.contains('Vec<Option<(H160,u128)>>').should('be.visible');
cy.get('.vector-field-1').should('have.lengthOf', 1);
cy.get('.vector-field-2')
.should('have.lengthOf', 1)
Expand All @@ -68,19 +68,18 @@ describe('Mother Contract ', () => {
cy.get('.vector-field-2').should('have.lengthOf', 3);
});
});
it('displays inputs for `Option<(AccountId,u128)` and sets values', () => {
it('displays inputs for `Option<(H160,u128)` and sets values', () => {
cy.get('.form-field.bids .vector-field-2')
.first()
.each($el => {
cy.wrap($el)
.scrollIntoView()
.within(() => {
cy.get('[data-cy="switch-button"]').click();
cy.contains('0: AccountId').should('be.visible');
cy.get('.dropdown').should('have.lengthOf', 1);
cy.contains('0: H160').should('be.visible');
cy.get("input[type='text']").eq(0).type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01');
cy.contains('1: u128').should('be.visible');
cy.get("input[type='number']").should('have.lengthOf', 1).type('99999');
selectAccount('bob', 2);
});
});
});
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/instantiateDryRun.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ describe('Instantiate dry run', () => {
cy.get('[data-cy="dry-run-result"]').within(() => {
cy.contains('ContractTrapped').should('be.visible');
cy.contains('Contract trapped during execution.').should('be.visible');
cy.contains(
"panicked at 'assertion failed: 0 < requirement && requirement <= owners && owners <= MAX_OWNERS",
).should('be.visible');
// TODO
// cy.contains(
// "panicked at 'assertion failed: 0 < requirement && requirement <= owners && owners <= MAX_OWNERS",
// ).should('be.visible');
});
});

Expand Down
9 changes: 8 additions & 1 deletion cypress/e2e/updateMetadata.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
import { beforeAllContracts, deploy } from '../support/util';

describe('Update contract metadata', () => {
const messages1 = ['new', 'newDefault', 'failedNew', 'echoAuction', 'revertOrTrap', 'debugLog'];
const messages1 = [
'new',
'newDefault',
'failedNew',
'echoAuction',
'revertOrTrap',
'mutHelloWorld',
];
const messages2 = ['new', 'newDefault', 'flip', 'get'];

before(() => {
Expand Down
1 change: 1 addition & 0 deletions cypress/fixtures/4.2.0/erc20.contract

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cypress/fixtures/4.2.0/flipper.contract

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cypress/fixtures/4.2.0/mother.contract

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cypress/fixtures/4.2.0/multisig.contract

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cypress/fixtures/4.2.0/storage_types.contract

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cypress/fixtures/erc20.contract

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cypress/fixtures/flipper.contract

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cypress/fixtures/mother.contract

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cypress/fixtures/multisig.contract

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cypress/fixtures/storage_types.contract

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion cypress/support/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function assertInstantiate() {
cy.get('[data-cy="submit-btn"]').click();
cy.get('[data-cy="transaction-complete"]', { timeout })
.should('exist')
.and('contain', 'contracts:Instantiated')
.and('contain', 'system:NewAccount')
.and('contain', 'balances:Transfer')
.and('contain', 'balances:Withdraw')
Expand Down
1 change: 1 addition & 0 deletions src/ui/components/form/findComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export function findComponent(
return AddressSelect;

case 'Balance':
case 'U256':
return InputBalance;

case 'Hash':
Expand Down
4 changes: 2 additions & 2 deletions src/ui/contexts/VersionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface VersionSupported {
const VersionContext = createContext<VersionSupported | undefined>(undefined);

export const VersionContextProvider = ({ children }: React.PropsWithChildren) => {
const [version, setVersion] = useLocalStorage<InkVersion>(LOCAL_STORAGE_KEY.VERSION, 'v5');
const [version, setVersion] = useLocalStorage<InkVersion>(LOCAL_STORAGE_KEY.VERSION, 'v6');

useEffect(() => setVersion(version), [version]);

Expand All @@ -33,4 +33,4 @@ export const useVersion = () => {
};

export const getVersion = () =>
(localStorage.getItem(LOCAL_STORAGE_KEY.VERSION) as InkVersion | null) || 'v5';
(localStorage.getItem(LOCAL_STORAGE_KEY.VERSION) as InkVersion | null) || 'v6';
8 changes: 4 additions & 4 deletions src/ui/layout/sidebar/VersionSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export function VersionSelect() {
const { version, setVersion } = useVersion();
const dropdownOptions = [
{
label: 'ink! v5 (default)',
value: 'v5',
label: 'ink! v6 (default)',
value: 'v6',
},
{
label: 'ink! v6',
value: 'v6',
label: 'ink! v5',
value: 'v5',
},
];
return (
Expand Down
Loading