From 0321433d92ce95823cf4c56995a23fa65e5d3599 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 24 Oct 2022 21:43:48 +0000 Subject: [PATCH] feat: Add `collection_admins` method to eth collection. --- --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -75,15 +75,15 @@ await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.true; }); - - itEth.skip('Check adminlist', async ({helper}) => { + + itEth.skip('Check adminlist', async ({helper, privateKey}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - + const admin1 = helper.eth.createAccount(); - const [admin2] = await helper.arrange.createAccounts([10n], donor); + const admin2 = await privateKey('admin'); await collectionEvm.methods.addCollectionAdmin(admin1).send(); await collectionEvm.methods.addCollectionAdminSubstrate(admin2.addressRaw).send(); @@ -93,7 +93,7 @@ return helper.address.convertCrossAccountFromEthCrossAcoount(element); }); expect(adminListRpc).to.be.like(adminListEth); - }); + }); itEth('(!negative tests!) Add admin by ADMIN is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,37 @@ import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm, base58Encode, blake2AsU8a} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, IForeignAssetMetadata, TNetworks, MoonbeamAssetInfo, DemocracyStandardAccountVote, AcalaAssetMetadata, IEthCrossAccountId} from './types'; +import { + IApiListeners, + IBlock, + IEvent, + IChainProperties, + ICollectionCreationOptions, + ICollectionLimits, + ICollectionPermissions, + ICrossAccountId, + ICrossAccountIdLower, + ILogger, + INestingPermissions, + IProperty, + IStakingInfo, + ISchedulerOptions, + ISubstrateBalance, + IToken, + ITokenPropertyPermission, + ITransactionResult, + IUniqueHelperLog, + TApiAllowedListeners, + TEthereumAccount, + TSigner, + TSubstrateAccount, + IEthCrossAccountId, + TNetworks, + IForeignAssetMetadata, + AcalaAssetMetadata, + MoonbeamAssetInfo, + DemocracyStandardAccountVote, +} from './types'; import {hexToU8a} from '@polkadot/util/hex'; import {u8aConcat} from '@polkadot/util/u8a'; -- gitstuff