From 4fa2a1bb0fae5b943df62a5e3df27cce7ba2df11 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 27 Jul 2021 17:36:20 +0000 Subject: [PATCH] test: fix unit tests --- --- a/crates/evm-coder/tests/a.rs +++ b/crates/evm-coder/tests/a.rs @@ -7,14 +7,14 @@ #[solidity_interface(name = "OurInterface")] impl Impls { - fn fn_a(&self, input: uint256) -> Result { + fn fn_a(&self, _input: uint256) -> Result { todo!() } } #[solidity_interface(name = "OurInterface1")] impl Impls { - fn fn_b(&self, input: uint128) -> Result { + fn fn_b(&self, _input: uint128) -> Result { todo!() } } @@ -27,17 +27,17 @@ )] impl Impls { #[solidity(rename_selector = "fnK")] - fn fn_c(&self, input: uint32) -> Result { + fn fn_c(&self, _input: uint32) -> Result { todo!() } - fn fn_d(&self, value: uint32) -> Result { + fn fn_d(&self, _value: uint32) -> Result { todo!() } - fn caller_sensitive(&self, caller: caller) -> Result { + fn caller_sensitive(&self, _caller: caller) -> Result { todo!() } - fn payable(&mut self, value: value) -> Result { + fn payable(&mut self, _value: value) -> Result { todo!() } } @@ -65,25 +65,25 @@ fn decimals(&self) -> Result { todo!() } - fn balance_of(&self, owner: address) -> Result { + fn balance_of(&self, _owner: address) -> Result { todo!() } - fn transfer(&mut self, caller: caller, to: address, value: uint256) -> Result { + fn transfer(&mut self, _caller: caller, _to: address, _value: uint256) -> Result { todo!() } fn transfer_from( &mut self, - caller: caller, - from: address, - to: address, - value: uint256, + _caller: caller, + _from: address, + _to: address, + _value: uint256, ) -> Result { todo!() } - fn approve(&mut self, caller: caller, spender: address, value: uint256) -> Result { + fn approve(&mut self, _caller: caller, _spender: address, _value: uint256) -> Result { todo!() } - fn allowance(&self, owner: address, spender: address) -> Result { + fn allowance(&self, _owner: address, _spender: address) -> Result { todo!() } } --- a/pallets/evm-coder-substrate/src/lib.rs +++ b/pallets/evm-coder-substrate/src/lib.rs @@ -38,7 +38,7 @@ } #[pallet::config] - pub trait Config: frame_system::Config + pallet_evm::Config { + pub trait Config: frame_system::Config { type EthereumTransactionSender: pallet_ethereum::EthereumTransactionSender; } --- a/pallets/nft/src/mock.rs +++ b/pallets/nft/src/mock.rs @@ -6,7 +6,6 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, testing::Header, - Perbill, }; use pallet_transaction_payment::{CurrencyAdapter}; use frame_system as system; @@ -99,9 +98,6 @@ type WeightInfo = (); } -type Timestamp = pallet_timestamp::Pallet; -type Randomness = pallet_randomness_collective_flip::Pallet; - parameter_types! { pub const CollectionCreationPrice: u32 = 0; pub TreasuryAccountId: u64 = 1234; @@ -151,6 +147,10 @@ } } +impl pallet_evm_coder_substrate::Config for Test { + type EthereumTransactionSender = TestEtheremTransactionSender; +} + impl pallet_template::Config for Test { type Event = (); type WeightInfo = (); @@ -160,7 +160,6 @@ type EvmAddressMapping = TestEvmAddressMapping; type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping; type CrossAccountId = TestCrossAccountId; - type EthereumTransactionSender = TestEtheremTransactionSender; } // Build genesis storage according to the mock runtime. -- gitstuff