git.delta.rocks / unique-network / refs/commits / 1570fa83190e

difftreelog

feat Add `collection_admins` method to eth collection.

Trubnikov Sergey2022-09-16parent: #147da77.patch.diff
in: master

2 files changed

modifiedtests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth
64 expect(adminList).to.be.like([{Substrate: newAdmin.address}]);64 expect(adminList).to.be.like([{Substrate: newAdmin.address}]);
65 });65 });
6666
67 // itEth('Check adminlist', async ({helper, privateKey}) => {67 itEth('Check adminlist', async ({helper, privateKey}) => {
68 // const owner = await helper.eth.createAccountWithBalance(donor);68 const owner = await helper.eth.createAccountWithBalance(donor);
69 69
70 // const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');70 const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C');
71 // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);71 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
7272
73 // const admin1 = helper.eth.createAccount();73 const admin1 = helper.eth.createAccount();
74 // const admin2 = await privateKey('admin');74 const admin2 = privateKey('admin');
75 // await collectionEvm.methods.addCollectionAdmin(admin1).send();75 await collectionEvm.methods.addCollectionAdmin(admin1).send();
76 // await collectionEvm.methods.addCollectionAdminCross(helper.ethCrossAccount.fromKeyringPair(admin2)).send();76 await collectionEvm.methods.addCollectionAdminSubstrate(admin2.addressRaw).send();
7777
78 // const adminListRpc = await helper.collection.getAdmins(collectionId);78 const adminListRpc = await helper.collection.getAdmins(collectionId);
79 // let adminListEth = await collectionEvm.methods.collectionAdmins().call();79 let adminListEth = await collectionEvm.methods.collectionAdmins().call();
80 // adminListEth = adminListEth.map((element: IEthCrossAccountId) => {80 adminListEth = adminListEth.map((element: IEthCrossAccountId) => {
81 // return helper.address.convertCrossAccountFromEthCrossAcoount(element);81 return helper.address.convertCrossAccountFromEthCrossAcoount(element);
82 // });82 });
83 // expect(adminListRpc).to.be.like(adminListEth);83 expect(adminListRpc).to.be.like(adminListEth);
84 // });84 });
8585
86 itEth('Verify owner or admin', async ({helper}) => {86 itEth('Verify owner or admin', async ({helper}) => {
87 const owner = await helper.eth.createAccountWithBalance(donor);87 const owner = await helper.eth.createAccountWithBalance(donor);
modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -40,6 +40,7 @@
   AcalaAssetMetadata,
   MoonbeamAssetInfo,
   DemocracyStandardAccountVote,
+  IEthCrossAccountId,
 } from './types';
 import {RuntimeDispatchInfo} from '@polkadot/types/interfaces';