difftreelog
tests: eth_getCode
in: master
5 files changed
tests/src/apiConsts.test.tsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617import {ApiPromise} from '@polkadot/api';17import {ApiPromise} from '@polkadot/api';18import {usingPlaygrounds, itSub, expect} from './util';18import {usingPlaygrounds, itSub, expect, COLLECTION_HELPER, CONTRACT_HELPER} from './util';1919202021const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n;21const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n;41 transfersEnabled: true,41 transfersEnabled: true,42};42};4344const EVM_COLLECTION_HELPERS_ADDRESS = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';45const HELPERS_CONTRACT_ADDRESS = '0x842899ECF380553E8a4de75bF534cdf6fBF64049';464347describe('integration test: API UNIQUE consts', () => {44describe('integration test: API UNIQUE consts', () => {48 let api: ApiPromise;45 let api: ApiPromise;106 });103 });107104108 itSub('HELPERS_CONTRACT_ADDRESS', () => {105 itSub('HELPERS_CONTRACT_ADDRESS', () => {109 expect(api.consts.evmContractHelpers.contractAddress.toString().toLowerCase()).to.be.equal(HELPERS_CONTRACT_ADDRESS.toLowerCase());106 expect(api.consts.evmContractHelpers.contractAddress.toString().toLowerCase()).to.be.equal(CONTRACT_HELPER.toLowerCase());110 });107 });111108112 itSub('EVM_COLLECTION_HELPERS_ADDRESS', () => {109 itSub('EVM_COLLECTION_HELPERS_ADDRESS', () => {113 expect(api.consts.common.contractAddress.toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS.toLowerCase());110 expect(api.consts.common.contractAddress.toString().toLowerCase()).to.be.equal(COLLECTION_HELPER.toLowerCase());114 });111 });115});112});116113tests/src/eth/collectionHelperAddress.test.tsdiffbeforeafterboth161617import {itEth, usingEthPlaygrounds, expect} from './util';17import {itEth, usingEthPlaygrounds, expect} from './util';18import {IKeyringPair} from '@polkadot/types/types';18import {IKeyringPair} from '@polkadot/types/types';19import {Pallets} from '../util';19import {COLLECTION_HELPER, Pallets} from '../util';2021const EVM_COLLECTION_HELPERS_ADDRESS = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';222023describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => {21describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => {24 let donor: IKeyringPair;22 let donor: IKeyringPair;36 const nftCollection = await helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);34 const nftCollection = await helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);373538 expect((await nftCollection.methods.collectionHelperAddress().call())36 expect((await nftCollection.methods.collectionHelperAddress().call())39 .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);37 .toString().toLowerCase()).to.be.equal(COLLECTION_HELPER);40 });38 });413942 itEth.ifWithPallets('RFT ', [Pallets.ReFungible], async ({helper}) => {40 itEth.ifWithPallets('RFT ', [Pallets.ReFungible], async ({helper}) => {464447 const rftCollection = await helper.ethNativeContract.collection(rftCollectionAddress, 'rft', owner);45 const rftCollection = await helper.ethNativeContract.collection(rftCollectionAddress, 'rft', owner);48 expect((await rftCollection.methods.collectionHelperAddress().call())46 expect((await rftCollection.methods.collectionHelperAddress().call())49 .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);47 .toString().toLowerCase()).to.be.equal(COLLECTION_HELPER);50 });48 });514952 itEth('FT', async ({helper}) => {50 itEth('FT', async ({helper}) => {56 const collection = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);54 const collection = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);575558 expect((await collection.methods.collectionHelperAddress().call())56 expect((await collection.methods.collectionHelperAddress().call())59 .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);57 .toString().toLowerCase()).to.be.equal(COLLECTION_HELPER);60 });58 });615962 itEth('[collectionHelpers] convert collectionId into address', async ({helper}) => {60 itEth('[collectionHelpers] convert collectionId into address', async ({helper}) => {tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth18import {IKeyringPair} from '@polkadot/types/types';18import {IKeyringPair} from '@polkadot/types/types';19import {expect, itEth, usingEthPlaygrounds} from './util';19import {expect, itEth, usingEthPlaygrounds} from './util';20import {CollectionLimitField} from './util/playgrounds/types';20import {CollectionLimitField} from './util/playgrounds/types';21import {COLLECTION_HELPER} from '../util';2122222323describe('Create NFT collection from EVM', () => {24describe('Create NFT collection from EVM', () => {424343 expect(events).to.be.deep.equal([44 expect(events).to.be.deep.equal([44 {45 {45 address: '0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F',46 address: COLLECTION_HELPER,46 event: 'CollectionCreated',47 event: 'CollectionCreated',47 args: {48 args: {48 owner: owner,49 owner: owner,tests/src/eth/getCode.test.tsdiffbeforeafterbothno changes
tests/src/util/index.tsdiffbeforeafterboth100export const LOCKING_PERIOD = 12n; // 12 blocks of relay100export const LOCKING_PERIOD = 12n; // 12 blocks of relay101export const UNLOCKING_PERIOD = 6n; // 6 blocks of parachain101export const UNLOCKING_PERIOD = 6n; // 6 blocks of parachain102102103// Native contracts104export const COLLECTION_HELPER = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';105export const CONTRACT_HELPER = '0x842899ECF380553E8a4de75bF534cdf6fBF64049';103106104export enum Pallets {107export enum Pallets {105 Inflation = 'inflation',108 Inflation = 'inflation',