--- a/pallets/unique/src/mock.rs +++ b/pallets/unique/src/mock.rs @@ -193,6 +193,7 @@ } impl pallet_template::Config for Test { + type Event = (); type WeightInfo = (); } --- a/pallets/unique/src/tests.rs +++ b/pallets/unique/src/tests.rs @@ -2259,7 +2259,7 @@ new_test_ext().execute_with(|| { let origin1 = Origin::signed(1); - for i in 1..COLLECTION_NUMBER_LIMIT { + for i in 1..=COLLECTION_NUMBER_LIMIT { create_test_collection(&CollectionMode::NFT, CollectionId(i)); } --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -3,7 +3,7 @@ import {submitTransactionAsync} from '../substrate/substrate-api'; import {createEthAccountWithBalance, deployCollector, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers'; import {evmToAddress} from '@polkadot/util-crypto'; -import {getGenericResult} from '../util/helpers'; +import {getGenericResult, UNIQUE} from '../util/helpers'; import {getBalanceSingle, transferBalanceExpectSuccess} from '../substrate/get-balance'; describe('EVM payable contracts', () => { @@ -55,8 +55,8 @@ }); itWeb3('Balance can be retrieved from evm contract', async({api, web3}) => { - const FEE_BALANCE = 10n ** 18n; - const CONTRACT_BALANCE = 10n ** 14n; + const FEE_BALANCE = 1000n * UNIQUE; + const CONTRACT_BALANCE = 1n * UNIQUE; const deployer = await createEthAccountWithBalance(api, web3); const contract = await deployCollector(web3, deployer); --- a/tests/src/setConstOnChainSchema.test.ts +++ b/tests/src/setConstOnChainSchema.test.ts @@ -30,8 +30,7 @@ alice = keyring.addFromUri('//Alice'); bob = keyring.addFromUri('//Bob'); shema = '0x31'; - largeShema = new Array(4097).fill(0xff); - + largeShema = new Array(1024 * 1024 + 10).fill(0xff); }); }); describe('Integration Test ext. setConstOnChainSchema()', () => { @@ -88,7 +87,7 @@ }); }); - it('Set invalid data in schema (size too large:> 1024b)', async () => { + it('Set invalid data in schema (size too large:> 1MB)', async () => { await usingApi(async (api) => { const collectionId = await createCollectionExpectSuccess(); const setShema = api.tx.unique.setConstOnChainSchema(collectionId, largeShema); --- a/tests/src/setOffchainSchema.test.ts +++ b/tests/src/setOffchainSchema.test.ts @@ -84,8 +84,8 @@ await setOffchainSchemaExpectFailure(alice, destroyedCollectionId, DATA); }); - it('fails on too long data', async () => { - const tooLongData = new Array(4097).fill(0xff); + it.only('fails on too long data', async () => { + const tooLongData = new Array(8 * 1024 + 10).fill(0xff); await setOffchainSchemaExpectFailure(alice, validCollectionId, tooLongData); }); --- a/tests/src/setVariableOnChainSchema.test.ts +++ b/tests/src/setVariableOnChainSchema.test.ts @@ -30,7 +30,7 @@ alice = keyring.addFromUri('//Alice'); bob = keyring.addFromUri('//Bob'); schema = '0x31'; - largeSchema = new Array(4097).fill(0xff); + largeSchema = new Array(8 * 1024 + 10).fill(0xff); }); }); @@ -104,7 +104,7 @@ }); }); - it('Set invalid data in schema (size too large:> 1024b)', async () => { + it('Set invalid data in schema (size too large:> 8kB)', async () => { await usingApi(async (api) => { const collectionId = await createCollectionExpectSuccess(); const setSchema = api.tx.unique.setVariableOnChainSchema(collectionId, largeSchema);