git.delta.rocks / unique-network / refs/commits / 6521b4029dca

difftreelog

Check event tests fixed

str-mv2021-09-09parent: #fe592a5.patch.diff
in: master

5 files changed

modifiedtests/package.jsondiffbeforeafterboth
--- a/tests/package.json
+++ b/tests/package.json
@@ -28,6 +28,7 @@
     "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'",
     "loadTransfer": "ts-node src/transfer.nload.ts",
     "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",
+    "testEvent": "mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts",
     "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",
     "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",
     "testSetVariableMetaData": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetaData.test.ts",
modifiedtests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth
10import chaiAsPromised from 'chai-as-promised';10import chaiAsPromised from 'chai-as-promised';
11import privateKey from '../substrate/privateKey';11import privateKey from '../substrate/privateKey';
12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
13import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';13import { createCollectionExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';
1414
15chai.use(chaiAsPromised);15chai.use(chaiAsPromised);
16const expect = chai.expect;16const expect = chai.expect;
28 it('Check event from createItem(): ', async () => {28 it('Check event from createItem(): ', async () => {
29 await usingApi(async (api: ApiPromise) => {29 await usingApi(async (api: ApiPromise) => {
30 const collectionID = await createCollectionExpectSuccess();30 const collectionID = await createCollectionExpectSuccess();
31 const createItem = api.tx.nft.createItem(collectionID, Alice.address, 'NFT');31 const createItem = api.tx.nft.createItem(collectionID, normalizeAccountId(Alice.address), 'NFT');
32 const events = await submitTransactionAsync(Alice, createItem);32 const events = await submitTransactionAsync(Alice, createItem);
33 const msg = JSON.stringify(nftEventMessage(events));33 const msg = JSON.stringify(nftEventMessage(events));
34 expect(msg).to.be.contain(checkSection);34 expect(msg).to.be.contain(checkSection);
modifiedtests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/createMultipleItemsEvent.test.ts
+++ b/tests/src/check-event/createMultipleItemsEvent.test.ts
@@ -10,7 +10,7 @@
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
 import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';
+import { createCollectionExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
@@ -29,7 +29,7 @@
     await usingApi(async (api: ApiPromise) => {
       const collectionID = await createCollectionExpectSuccess();
       const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
-      const createMultipleItems = api.tx.nft.createMultipleItems(collectionID, Alice.address, args);
+      const createMultipleItems = api.tx.nft.createMultipleItems(collectionID, normalizeAccountId(Alice.address), args);
       const events = await submitTransactionAsync(Alice, createMultipleItems);
       const msg = JSON.stringify(nftEventMessage(events));
       expect(msg).to.be.contain(checkSection);
modifiedtests/src/check-event/transferEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/transferEvent.test.ts
+++ b/tests/src/check-event/transferEvent.test.ts
@@ -10,7 +10,7 @@
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
 import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';
+import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
@@ -31,7 +31,7 @@
     await usingApi(async (api: ApiPromise) => {
       const collectionID = await createCollectionExpectSuccess();
       const itemID = await createItemExpectSuccess(Alice, collectionID, 'NFT');
-      const transfer = api.tx.nft.transfer(Bob.address, collectionID, itemID, 1);
+      const transfer = api.tx.nft.transfer(normalizeAccountId(Bob.address), collectionID, itemID, 1);
       const events = await submitTransactionAsync(Alice, transfer);
       const msg = JSON.stringify(nftEventMessage(events));
       expect(msg).to.be.contain(checkSection);
modifiedtests/src/check-event/transferFromEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/transferFromEvent.test.ts
+++ b/tests/src/check-event/transferFromEvent.test.ts
@@ -10,7 +10,7 @@
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
 import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';
+import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
@@ -31,7 +31,7 @@
     await usingApi(async (api: ApiPromise) => {
       const collectionID = await createCollectionExpectSuccess();
       const itemID = await createItemExpectSuccess(Alice, collectionID, 'NFT');
-      const transferFrom = api.tx.nft.transferFrom(Alice.address, Bob.address, collectionID, itemID, 1);
+      const transferFrom = api.tx.nft.transferFrom(normalizeAccountId(Alice.address), normalizeAccountId(Bob.address), collectionID, itemID, 1);
       const events = await submitTransactionAsync(Alice, transferFrom);
       const msg = JSON.stringify(nftEventMessage(events));
       expect(msg).to.be.contain(checkSection);