From 735c2a469e47bdbdc0c7fdffdb4897c59bc1bb22 Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Thu, 28 Jan 2021 09:56:03 +0000 Subject: [PATCH] Cleanup chain extension --- --- a/runtime/src/chain_extension.rs +++ b/runtime/src/chain_extension.rs @@ -34,25 +34,6 @@ /// The chain Extension of NFT pallet pub struct NFTExtension; -// pub trait ToAccount32 { -// fn to_account32(addr: ::AccountId); -// } - -// impl ToAccount32 for NFTExtension { -// fn to_account32(addr: ::AccountId) -// where -// ::AccountId: UncheckedFrom<::Hash> + AsRef<[u8]>, -// { -// let mut bytes: [u8; 32]; -// let addrVec: Vec = addr.encode(); -// for i in 0..32 { -// bytes[i] = addrVec[i]; -// } -// AccountId32::from(bytes) -// } - -// } - impl ChainExtension for NFTExtension { fn call(func_id: u32, env: Environment) -> Result where @@ -79,15 +60,11 @@ bytesRec[i] = addrVecRec[i]; } let recipient = AccountId32::from(bytesRec); - - match pallet_nft::Module::::transfer_internal(sender, recipient, input.collection_id, input.token_id, input.amount) { Ok(_) => Ok(RetVal::Converging(func_id)), DispatchError => Err(DispatchError::Other("Transfer error")) } - - }, _ => { panic!("Passed unknown func_id to test chain extension: {}", func_id); --- a/smart_contracs/transfer/Cargo.toml +++ b/smart_contracs/transfer/Cargo.toml @@ -5,11 +5,11 @@ edition = "2018" [dependencies] -ink_primitives = { git = "https://github.com/paritytech/ink", branch = "master", default-features = false } -ink_metadata = { git = "https://github.com/paritytech/ink", branch = "master", default-features = false, features = ["derive"], optional = true } -ink_env = { git = "https://github.com/paritytech/ink", branch = "master", default-features = false } -ink_storage = { git = "https://github.com/paritytech/ink", branch = "master", default-features = false } -ink_lang = { git = "https://github.com/paritytech/ink", branch = "master", default-features = false } +ink_primitives = { git = "https://github.com/usetech-llc/ink", branch = "unique", default-features = false } +ink_metadata = { git = "https://github.com/usetech-llc/ink", branch = "unique", default-features = false, features = ["derive"], optional = true } +ink_env = { git = "https://github.com/usetech-llc/ink", branch = "unique", default-features = false } +ink_storage = { git = "https://github.com/usetech-llc/ink", branch = "unique", default-features = false } +ink_lang = { git = "https://github.com/usetech-llc/ink", branch = "unique", default-features = false } scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive"] } scale-info = { version = "0.4.1", default-features = false, features = ["derive"], optional = true } -- gitstuff