git.delta.rocks / unique-network / refs/commits / 7bc91723d7eb

difftreelog

fix integration tests

Igor Kozyrev2021-12-03parent: #055622b.patch.diff
in: master

4 files changed

modifiedtests/src/eth/payable.test.tsdiffbeforeafterboth
--- 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);
modifiedtests/src/setConstOnChainSchema.test.tsdiffbeforeafterboth
--- 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);
modifiedtests/src/setOffchainSchema.test.tsdiffbeforeafterboth
84 await setOffchainSchemaExpectFailure(alice, destroyedCollectionId, DATA);84 await setOffchainSchemaExpectFailure(alice, destroyedCollectionId, DATA);
85 });85 });
8686
87 it('fails on too long data', async () => {87 it.only('fails on too long data', async () => {
88 const tooLongData = new Array(4097).fill(0xff);88 const tooLongData = new Array(8 * 1024 + 10).fill(0xff);
8989
90 await setOffchainSchemaExpectFailure(alice, validCollectionId, tooLongData);90 await setOffchainSchemaExpectFailure(alice, validCollectionId, tooLongData);
91 });91 });
modifiedtests/src/setVariableOnChainSchema.test.tsdiffbeforeafterboth
--- 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);