git.delta.rocks / unique-network / refs/commits / 60662ccc0c31

difftreelog

fix build

Trubnikov Sergey2023-04-21parent: #d3a59ed.patch.diff
in: master

4 files changed

modifiedpallets/balances-adapter/src/erc.rsdiffbeforeafterboth
--- a/pallets/balances-adapter/src/erc.rs
+++ b/pallets/balances-adapter/src/erc.rs
@@ -100,7 +100,7 @@
 			amount,
 			ExistenceRequirement::KeepAlive,
 		)
-		.map_err(dispatch_to_evm::<T>);
+		.map_err(dispatch_to_evm::<T>)?;
 		Ok(true)
 	}
 
@@ -117,7 +117,7 @@
 		let to = T::CrossAccountId::from_eth(to);
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
 
-		if (from != to) {
+		if from != to {
 			return Err("no permission".into());
 		}
 		// let budget = self
@@ -132,7 +132,7 @@
 			amount,
 			ExistenceRequirement::KeepAlive,
 		)
-		.map_err(dispatch_to_evm::<T>);
+		.map_err(dispatch_to_evm::<T>)?;
 		Ok(true)
 	}
 }
@@ -165,7 +165,7 @@
 			amount,
 			ExistenceRequirement::KeepAlive,
 		)
-		.map_err(dispatch_to_evm::<T>);
+		.map_err(dispatch_to_evm::<T>)?;
 		Ok(true)
 	}
 
@@ -182,7 +182,7 @@
 		let to = to.into_sub_cross_account::<T>()?;
 		let amount = amount.try_into().map_err(|_| "amount overflow")?;
 
-		if (from != to) {
+		if from != to {
 			return Err("no permission".into());
 		}
 
@@ -198,7 +198,7 @@
 			amount,
 			ExistenceRequirement::KeepAlive,
 		)
-		.map_err(dispatch_to_evm::<T>);
+		.map_err(dispatch_to_evm::<T>)?;
 		Ok(true)
 	}
 }
modifiedpallets/balances-adapter/src/lib.rsdiffbeforeafterboth
before · pallets/balances-adapter/src/lib.rs
1// #![doc = include_str!("../README.md")]2#![cfg_attr(not(feature = "std"), no_std)]3#![warn(missing_docs)]45pub use pallet::*;67pub mod erc;89#[frame_support::pallet]10pub mod pallet {11	use frame_support::traits::Get;12	use sp_core::U256;1314	#[pallet::config]15	pub trait Config: frame_system::Config + pallet_evm_coder_substrate::Config {16		type Currency: frame_support::traits::Currency<17			Self::AccountId,18			Balance = Self::CurrencyBalance,19		>;20		type CurrencyBalance: Into<U256> + TryFrom<U256>;2122		type Decimals: Get<u8>;23		type Name: Get<String>;24		type Symbol: Get<String>;25	}26	#[pallet::pallet]27	pub struct Pallet<T>(_);2829	#[pallet::call]30	impl<T: Config> Pallet<T> {}31}
after · pallets/balances-adapter/src/lib.rs
1// #![doc = include_str!("../README.md")]2#![cfg_attr(not(feature = "std"), no_std)]3#![warn(missing_docs)]45extern crate alloc;6pub use pallet::*;78pub mod erc;910#[frame_support::pallet]11pub mod pallet {12	use alloc::string::String;13	use frame_support::traits::Get;14	use sp_core::U256;1516	#[pallet::config]17	pub trait Config: frame_system::Config + pallet_evm_coder_substrate::Config {18		type Currency: frame_support::traits::Currency<19			Self::AccountId,20			Balance = Self::CurrencyBalance,21		>;22		type CurrencyBalance: Into<U256> + TryFrom<U256>;2324		type Decimals: Get<u8>;25		type Name: Get<String>;26		type Symbol: Get<String>;27	}28	#[pallet::pallet]29	pub struct Pallet<T>(_);3031	#[pallet::call]32	impl<T: Config> Pallet<T> {}33}
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -14,6 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
+use alloc::string::{String, ToString};
 use frame_support::parameter_types;
 use sp_runtime::traits::AccountIdConversion;
 use crate::{
modifiedtests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth
--- a/tests/src/eth/util/playgrounds/unique.dev.ts
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -22,6 +22,7 @@
 
 // Native contracts ABI
 import collectionHelpersAbi from '../../abi/collectionHelpers.json' assert {type: 'json'};
+import nativeFungibleAbi from '../../abi/nativeFungible.json' assert {type: 'json'};
 import fungibleAbi from '../../abi/fungible.json' assert {type: 'json'};
 import fungibleDeprecatedAbi from '../../abi/fungibleDeprecated.json' assert {type: 'json'};
 import nonFungibleAbi from '../../abi/nonFungible.json' assert {type: 'json'};