From c43c309b3350768b97fab2de251db4feaf240e49 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 30 May 2023 07:59:31 +0000 Subject: [PATCH] test: remove explicitly set evm gasPrice --- --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -113,7 +113,6 @@ data: object, from: signer, gas: gas ?? this.helper.eth.DEFAULT_GAS, - gasPrice: await this.getGasPrice(), }); return await contract.deploy({data: object}).send({from: signer}); } @@ -122,25 +121,23 @@ class NativeContractGroup extends EthGroupBase { - async contractHelpers(caller: string): Promise { + contractHelpers(caller: string) { const web3 = this.helper.getWeb3(); return new web3.eth.Contract(contractHelpersAbi as any, this.helper.getApi().consts.evmContractHelpers.contractAddress.toString(), { from: caller, gas: this.helper.eth.DEFAULT_GAS, - gasPrice: await this.getGasPrice(), }); } - async collectionHelpers(caller: string) { + collectionHelpers(caller: string) { const web3 = this.helper.getWeb3(); return new web3.eth.Contract(collectionHelpersAbi as any, this.helper.getApi().consts.common.contractAddress.toString(), { from: caller, gas: this.helper.eth.DEFAULT_GAS, - gasPrice: await this.getGasPrice(), }); } - async collection(address: string, mode: TCollectionMode, caller?: string, mergeDeprecated = false) { + collection(address: string, mode: TCollectionMode, caller?: string, mergeDeprecated = false) { let abi; if (address === this.helper.ethAddress.fromCollectionId(0)) { abi = nativeFungibleAbi; @@ -162,7 +159,6 @@ const web3 = this.helper.getWeb3(); return new web3.eth.Contract(abi as any, address, { gas: this.helper.eth.DEFAULT_GAS, - gasPrice: await this.getGasPrice(), ...(caller ? {from: caller} : {}), }); } @@ -171,12 +167,11 @@ return this.collection(this.helper.ethAddress.fromCollectionId(collectionId), mode, caller, mergeDeprecated); } - async rftToken(address: string, caller?: string, mergeDeprecated = false) { + rftToken(address: string, caller?: string, mergeDeprecated = false) { const web3 = this.helper.getWeb3(); const abi = mergeDeprecated ? [...refungibleTokenAbi, ...refungibleTokenDeprecatedAbi] : refungibleTokenAbi; return new web3.eth.Contract(abi as any, address, { gas: this.helper.eth.DEFAULT_GAS, - gasPrice: await this.getGasPrice(), ...(caller ? {from: caller} : {}), }); } @@ -216,6 +211,7 @@ async sendEVM(signer: IKeyringPair, contractAddress: string, abi: string, value: string, gasLimit?: number) { if (!gasLimit) gasLimit = this.DEFAULT_GAS; const web3 = this.helper.getWeb3(); + // FIXME: can't send legacy transaction using tx.evm.call const gasPrice = await web3.eth.getGasPrice(); // TODO: check execution status await this.helper.executeExtrinsic( @@ -383,7 +379,7 @@ class EthAddressGroup extends EthGroupBase { extractCollectionId(address: string): number { if (!(address.length === 42 || address.length === 40)) throw new Error('address wrong format'); - return parseInt(address.substr(address.length - 8), 16); + return parseInt(address.slice(address.length - 8), 16); } fromCollectionId(collectionId: number): string { -- gitstuff