-
Notifications
You must be signed in to change notification settings - Fork 50
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
Changes from all commits
fe82537
23563e6
1cc833c
67e20a5
04d1a1d
99ed21a
8084c95
a3c3b04
aa18d81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,31 +53,67 @@ describe('ERC20 Contract ', () => { | |
|
||
it(`transfers ${transferValue} Units to another account`, () => { | ||
selectMessage('transfer', 3); | ||
cy.get('.form-field.to').find('.dropdown').click().find('.dropdown__option').eq(3).click(); | ||
cy.get('.form-field.value').find('input[type="number"]').eq(0).type(`${transferValue}`); | ||
cy.get('.form-field.to') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In all unit tests the main update was the way to select an address, before it was a dropdown to pick Alice/Bob, now we need to type the H160 address |
||
.find("input[type='text']") | ||
.clear() | ||
.type('0x60afa252b554aabc4b3253ca2be60dc1d536ec10') | ||
.should('have.value', '0x60afa252b554aabc4b3253ca2be60dc1d536ec10'); | ||
cy.get('.form-field.value').find('input[type="number"]').type(`${transferValue}`); | ||
assertCall(); | ||
selectMessage('balanceOf', 1); | ||
|
||
cy.get('.form-field.owner') | ||
.find("input[type='text']") | ||
.clear() | ||
.type('0x9621dde636de098b43efb0fa9b61facfe328f99d') | ||
.should('have.value', '0x9621dde636de098b43efb0fa9b61facfe328f99d'); | ||
assertReturnValue('balanceOf', `${initialSupply - transferValue}`); | ||
}); | ||
|
||
it(`successfully approves allowance`, () => { | ||
selectMessage('approve', 4); | ||
cy.get('.form-field.spender').find('.dropdown').click().find('.dropdown__option').eq(2).click(); | ||
cy.get('.form-field.spender') | ||
.find("input[type='text']") | ||
.clear() | ||
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01') | ||
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01'); | ||
cy.get('.form-field.value').find('input[type="number"]').type(`${allowance}`); | ||
assertCall(); | ||
selectMessage('allowance', 2); | ||
cy.get('.form-field.spender').find('.dropdown').click().find('.dropdown__option').eq(2).click(); | ||
cy.get('.form-field.owner') | ||
.find("input[type='text']") | ||
.clear() | ||
.type('0x9621dde636de098b43efb0fa9b61facfe328f99d') | ||
.should('have.value', '0x9621dde636de098b43efb0fa9b61facfe328f99d'); | ||
cy.get('.form-field.spender') | ||
.find("input[type='text']") | ||
.clear() | ||
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01') | ||
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01'); | ||
assertReturnValue('allowance', `${allowance}`); | ||
}); | ||
|
||
it(`transfers ${transferValue} on behalf of alice`, () => { | ||
cy.get('.form-field.caller').click().find('.dropdown__option').eq(2).click(); | ||
selectMessage('transferFrom', 5); | ||
cy.get('.form-field.to').find('.dropdown').click().find('.dropdown__option').eq(2).click(); | ||
cy.get('.form-field.from') | ||
.find("input[type='text']") | ||
.clear() | ||
.type('0x9621dde636de098b43efb0fa9b61facfe328f99d') | ||
.should('have.value', '0x9621dde636de098b43efb0fa9b61facfe328f99d'); | ||
cy.get('.form-field.to') | ||
.find("input[type='text']") | ||
.clear() | ||
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01') | ||
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01'); | ||
cy.get('.form-field.value').find('input[type="number"]').type(`${transferValue}`); | ||
assertCall(); | ||
selectMessage('balanceOf', 1); | ||
cy.get('.form-field.owner').find('.dropdown').click().find('.dropdown__option').eq(2).click(); | ||
cy.get('.form-field.owner') | ||
.find("input[type='text']") | ||
.clear() | ||
.type('0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01') | ||
.should('have.value', '0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01'); | ||
assertReturnValue('balanceOf', `${transferValue}`); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,14 @@ | |
import { beforeAllContracts, deploy } from '../support/util'; | ||
|
||
describe('Update contract metadata', () => { | ||
const messages1 = ['new', 'newDefault', 'failedNew', 'echoAuction', 'revertOrTrap', 'debugLog']; | ||
const messages1 = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated in the contract |
||
'new', | ||
'newDefault', | ||
'failedNew', | ||
'echoAuction', | ||
'revertOrTrap', | ||
'mutHelloWorld', | ||
]; | ||
const messages2 = ['new', 'newDefault', 'flip', 'get']; | ||
|
||
before(() => { | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
import { WsProvider, ApiPromise, Keyring } from '@polkadot/api'; | ||
|
||
const timeout = 25000; | ||
|
||
export function beforeAllContracts() { | ||
export async function beforeAllContracts() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to map the accounts Alice and Bob |
||
const wsProvider = new WsProvider('ws://127.0.0.1:9944'); | ||
const api = new ApiPromise({ provider: wsProvider }); | ||
api.on('connected', async () => { | ||
await api.isReady; | ||
|
||
const keyring = new Keyring({ type: 'sr25519' }); | ||
const alice = keyring.addFromUri('//Alice', { name: 'Alice' }); | ||
const bob = keyring.addFromUri('//Bob', { name: 'Bob' }); | ||
await api.tx.revive.mapAccount().signAndSend(alice); | ||
await api.tx.revive.mapAccount().signAndSend(bob); | ||
}); | ||
|
||
cy.visit(`/instantiate/?rpc=ws://127.0.0.1:9944`); | ||
cy.get('[data-cy="spinner"]').should('not.exist', { | ||
timeout, | ||
|
@@ -43,7 +57,7 @@ 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', 'revive:Instantiated') | ||
.and('contain', 'system:NewAccount') | ||
.and('contain', 'balances:Transfer') | ||
.and('contain', 'balances:Withdraw') | ||
|
@@ -57,7 +71,7 @@ export function assertCall() { | |
cy.get('[data-cy="transaction-complete"]', { timeout }) | ||
.should('exist') | ||
.and('contain', 'system:ExtrinsicSuccess') | ||
.and('contain', 'contracts:ContractEmitted'); | ||
.and('contain', 'revive:ContractEmitted'); | ||
cy.get('[data-cy="dismiss-notification"]').click(); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
// Copyright 2022-2024 use-ink/contracts-ui authors & contributors | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
module.exports = { | ||
__version: '13.13.3', | ||
'Storage Types Contract': { | ||
|
@@ -17,13 +14,13 @@ module.exports = { | |
1: "<code>{\n accountIdValue: '5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM',\n balanceValueMax: '340,282,366,920,938,463,463,374,607,431,768,211,455',\n balanceValueMin: '0',\n hashValue:\n '0x0000000000000000000000000000000000000000000000000000000000000000',\n }</code>", | ||
}, | ||
'DryRun getPrimitiveTypes': { | ||
1: "<code>{\n boolValue: true,\n enumWithoutValues: 'A',\n enumWithValues: {\n ThreeValues: [\n '1',\n '2',\n '3',\n ],\n },\n arrayValue: [\n '3',\n '2',\n '1',\n ],\n tupleValue: [\n '7',\n '8',\n ],\n }</code>", | ||
1: "<code>{\n boolValue: true,\n enumWithoutValues: 'A',\n enumWithValues: {\n ThreeValues: [\n '1',\n '2',\n '3',\n ],\n },\n arrayValue: [\n '3',\n '2',\n '1',\n ],\n tupleValue: [\n '7',\n '8',\n ],\n tupleTripletValue: [\n '-123',\n '0',\n '123',\n ],\n }</code>", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
'DryRun getOptionNone': { | ||
1: '<code>null</code>', | ||
}, | ||
'DryRun getResultError': { | ||
1: "<code>{\n ErrorWithMessage: 'This is the Error Message.',\n }</code>", | ||
1: '<code>EmptyError</code>', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
'DryRun getPanic': { | ||
1: '<code>ContractTrapped</code>', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI needs to run the ink-node for testing ink! v6 contracts