difftreelog
tests(dev-mode): all fixed up
in: master
4 files changed
node/cli/src/chain_spec.rsdiffbeforeafterboth--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -212,6 +212,16 @@
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
+ get_account_id_from_seed::<sr25519::Public>("Charlie"),
+ get_account_id_from_seed::<sr25519::Public>("Dave"),
+ get_account_id_from_seed::<sr25519::Public>("Eve"),
+ get_account_id_from_seed::<sr25519::Public>("Ferdie"),
+ get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
1000
)
tests/src/eth/base.test.tsdiffbeforeafterboth--- a/tests/src/eth/base.test.ts
+++ b/tests/src/eth/base.test.ts
@@ -34,7 +34,8 @@
const userB = createEthAccount(web3);
const cost = await recordEthFee(api, userA, () => web3.eth.sendTransaction({from: userA, to: userB, value: '1000000', ...GAS_ARGS}));
- expect(cost - await ethBalanceViaSub(api, userB) < BigInt(0.2 * Number(UNIQUE))).to.be.true;
+ const balanceB = await ethBalanceViaSub(api, userB);
+ expect(cost - balanceB < BigInt(0.2 * Number(UNIQUE))).to.be.true;
});
itWeb3('NFT transfer is close to 0.15 UNQ', async ({web3, api}) => {
tests/src/eth/util/helpers.tsdiffbeforeafterboth--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -29,6 +29,7 @@
import privateKey from '../../substrate/privateKey';
import contractHelpersAbi from './contractHelpersAbi.json';
import getBalance from '../../substrate/get-balance';
+import waitNewBlocks from '../../substrate/wait-new-blocks';
export const GAS_ARGS = {gas: 2500000};
@@ -287,6 +288,8 @@
await call();
+ // In dev mode, the transaction might not finish processing in time
+ await waitNewBlocks(api, 1);
const after = await ethBalanceViaSub(api, user);
// Can't use .to.be.less, because chai doesn't supports bigint
tests/src/util/helpers.tsdiffbeforeafterboth344 // Run the CreateCollection transaction344 // Run the CreateCollection transaction345 const alicePrivateKey = privateKey('//Alice');345 const alicePrivateKey = privateKey('//Alice');346 const tx = api.tx.unique.createCollectionEx({name: strToUTF16(name), description: strToUTF16(description), tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any});346 const tx = api.tx.unique.createCollectionEx({name: strToUTF16(name), description: strToUTF16(description), tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any});347 const events = await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;347 await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;348 const result = getCreateCollectionResult(events);349348350 // Get number of collections after the transaction349 // Get number of collections after the transaction351 const collectionCountAfter = await getCreatedCollectionCount(api);350 const collectionCountAfter = await getCreatedCollectionCount(api);352351353 // What to expect352 // What to expect354 // tslint:disable-next-line:no-unused-expression355 expect(result.success).to.be.false;356 expect(collectionCountAfter).to.be.equal(collectionCountBefore, 'Error: Collection with incorrect data created.');353 expect(collectionCountAfter).to.be.equal(collectionCountBefore, 'Error: Collection with incorrect data created.');357 });354 });358}355}