git.delta.rocks / unique-network / refs/commits / 3c7e64b49433

difftreelog

fix PR

Trubnikov Sergey2023-05-18parent: #012bbc1.patch.diff
in: master

2 files changed

modifiedpallets/balances-adapter/src/lib.rsdiffbeforeafterboth
--- a/pallets/balances-adapter/src/lib.rs
+++ b/pallets/balances-adapter/src/lib.rs
@@ -53,14 +53,11 @@
 		traits::{Currency, ExistenceRequirement, Get},
 	};
 	use pallet_balances::WeightInfo;
-	use pallet_common::{
-		erc::CrossAccountId, Error as CommonError, Pallet as PalletCommon,
-		NATIVE_FUNGIBLE_COLLECTION_ID,
-	};
+	use pallet_common::{erc::CrossAccountId, Error as CommonError, Pallet as PalletCommon};
 	use pallet_structure::Pallet as PalletStructure;
 	use sp_core::U256;
 	use sp_runtime::DispatchError;
-	use up_data_structs::{budget::Budget, mapping::TokenAddressMapping, TokenId};
+	use up_data_structs::{budget::Budget, mapping::TokenAddressMapping};
 
 	#[pallet::config]
 	pub trait Config:
@@ -135,7 +132,7 @@
 			from: &T::CrossAccountId,
 			to: &T::CrossAccountId,
 			amount: u128,
-			nesting_budget: &dyn Budget,
+			_nesting_budget: &dyn Budget,
 		) -> DispatchResultWithPostInfo {
 			<PalletCommon<T>>::ensure_correct_receiver(to)?;
 
modifiedtests/src/eth/nativeRpc/estimateGas.test.tsdiffbeforeafterboth
before · tests/src/eth/nativeRpc/estimateGas.test.ts
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {expect, itEth, usingEthPlaygrounds} from '../util';18import {IKeyringPair} from '@polkadot/types/types';192021describe('Ethereum native RPC calls', () => {22  let donor: IKeyringPair;23  const NATIVE_TOKEN_ADDRESS = '0x17c4e6453cc49aaaaeaca894e6d9683e00000000';2425  before(async function() {26    await usingEthPlaygrounds(async (helper, privateKey) => {27      donor = await privateKey({url: import.meta.url});28    });29  });3031  itEth.only('estimate gas', async ({helper}) => {32    const BALANCE = 100n;33    const BALANCE_TO_TRANSFER = 90n;3435    const owner = await helper.eth.createAccountWithBalance(donor, BALANCE);36    const recepient = helper.eth.createAccount();3738    const web3 = helper.getWeb3();39    // data: transfer(recepient, 90);40    const data = web3.eth.abi.encodeFunctionCall({41      name: 'transfer',42      type: 'function',43      inputs: [{44        type: 'address',45        name: 'to',46      },{47        type: 'uint256',48        name: 'amount',49      }],50    }, [recepient, (BALANCE_TO_TRANSFER * (10n ** 18n)).toString()]);5152    const estimateGas = await web3.eth.estimateGas({53      to: NATIVE_TOKEN_ADDRESS,54      value: '0x0',55      data,56      from: owner,57      maxFeePerGas: '0x14c9338c61d',58    });5960    expect(estimateGas).to.be.greaterThan(40000).and.to.be.lessThan(60000);61  });62});