difftreelog
test fix integration
in: master
6 files changed
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth516 const owner = await helper.eth.createAccountWithBalance(donor);516 const owner = await helper.eth.createAccountWithBalance(donor);517 const sponsor = await helper.eth.createAccountWithBalance(donor);517 const sponsor = await helper.eth.createAccountWithBalance(donor);518 const user = await helper.eth.createAccountWithBalance(donor);518 const user = await helper.eth.createAccountWithBalance(donor);519 const helpers = await helper.ethNativeContract.contractHelpers(owner);519 const helpers = helper.ethNativeContract.contractHelpers(owner);520520521 const testContract = await deployTestContract(helper, owner);521 const testContract = await deployTestContract(helper, owner);522522531 await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send();531 await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send();532532533 const originalUserBalance = await helper.balance.getEthereum(user);533 const originalUserBalance = await helper.balance.getEthereum(user);534 await testContract.methods.test(100).send({from: user, gas: 2_000_000});534 await testContract.methods.test(100).send({from: user, gas: 2_000_000, maxFeePerGas: gasPrice.toString()});535 expect(await helper.balance.getEthereum(user)).to.be.equal(originalUserBalance);535 expect(await helper.balance.getEthereum(user)).to.be.equal(originalUserBalance);536536537 await testContract.methods.test(100).send({from: user, gas: 2_100_000});537 await testContract.methods.test(100).send({from: user, gas: 2_100_000, maxFeePerGas: gasPrice.toString()});538 expect(await helper.balance.getEthereum(user)).to.not.be.equal(originalUserBalance);538 expect(await helper.balance.getEthereum(user)).to.not.be.equal(originalUserBalance);539 });539 });540540tests/src/eth/ethFeesAreCorrect.test.tsdiffbeforeafterboth--- a/tests/src/eth/ethFeesAreCorrect.test.ts
+++ b/tests/src/eth/ethFeesAreCorrect.test.ts
@@ -41,10 +41,10 @@
const {tokenId: tokenB} = await collection.mintToken(minter, {Ethereum: aliceEth});
const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
- const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
const balanceBeforeWeb3Transfer = await helper.balance.getEthereum(owner);
- await contract.methods.transfer(receiver, tokenA).send({from: owner});
+ await contract.methods.transfer(receiver, tokenA).send({from: owner, maxFeePerGas: (await helper.eth.getGasPrice()).toString()});
const balanceAfterWeb3Transfer = await helper.balance.getEthereum(owner);
const web3Diff = balanceBeforeWeb3Transfer - balanceAfterWeb3Transfer;
tests/src/eth/reFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -674,7 +674,7 @@
requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
donor = await privateKey({url: import.meta.url});
- [alice] = await helper.arrange.createAccounts([20n], donor);
+ [alice] = await helper.arrange.createAccounts([1000n], donor);
});
});
@@ -699,7 +699,7 @@
},
);
- const contract = await helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller);
+ const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller);
const name = await contract.methods.name().call();
expect(name).to.equal('Leviathan');
});
tests/src/maintenance.seqtest.tsdiffbeforeafterboth--- a/tests/src/maintenance.seqtest.ts
+++ b/tests/src/maintenance.seqtest.ts
@@ -342,19 +342,19 @@
itSub('Does not allow preimage execution with non-root', async ({helper}) => {
await expect(helper.executeExtrinsic(bob, 'api.tx.maintenance.executePreimage', [
preimageHashes[0], {refTime: 10000000000, proofSize: 10000},
- ])).to.be.rejectedWith(/BadOrigin/);
+ ])).to.be.rejectedWith(/^Misc: BadOrigin$/);
});
itSub('Does not allow execution of non-existent preimages', async ({helper}) => {
await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.executePreimage', [
'0x1010101010101010101010101010101010101010101010101010101010101010', {refTime: 10000000000, proofSize: 10000},
- ])).to.be.rejectedWith(/Unavailable/);
+ ])).to.be.rejectedWith(/^Misc: Unavailable$/);
});
itSub('Does not allow preimage execution with less than minimum weights', async ({helper}) => {
await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.executePreimage', [
preimageHashes[0], {refTime: 1000, proofSize: 100},
- ])).to.be.rejectedWith(/Exhausted/);
+ ])).to.be.rejectedWith(/^Misc: Exhausted$/);
});
after(async function() {
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -24,6 +24,7 @@
'timestamp',
'transactionpayment',
'treasury',
+ 'statetriemigration',
'structure',
'system',
'vesting',
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -591,8 +591,11 @@
const errorMeta = dispatchError.registry.findMetaError(modErr);
moduleError = `${errorMeta.section}.${errorMeta.name}`;
+ } else if (dispatchError.isToken) {
+ moduleError = `Token: ${dispatchError.asToken}`;
} else {
- moduleError = dispatchError.toHuman();
+ // May be [object Object] in case of unhandled non-unit enum
+ moduleError = `Misc: ${dispatchError.toHuman()}`;
}
} else {
this.logger.log(result, this.logger.level.ERROR);
@@ -3480,6 +3483,8 @@
} else if (data.asErr.isToken) {
throw new Error(`Token: ${data.asErr.asToken}`);
}
+ // May be [object Object] in case of unhandled non-unit enum
+ throw new Error(`Misc: ${data.asErr.toHuman()}`);
}
return result;
}