git.delta.rocks / unique-network / refs/commits / fbce7452571f

difftreelog

Merge branch 'master' of github.com:usetech-llc/nft_parachain

Greg Zaitsev2020-07-21parents: #9b5aeb7 #21c779f.patch.diff
in: master

17 files changed

addedsmart_contract/ink-types-node-runtime/.gitignorediffbeforeafterboth

no changes

deletedsmart_contract/ink-types-node-runtime/Cargo.lockdiffbeforeafterboth

no changes

modifiedsmart_contract/ink-types-node-runtime/Cargo.tomldiffbeforeafterboth
1818
19[dependencies]19[dependencies]
20ink_core = { version = "2", git = "https://github.com/usetech-llc/ink", tag = "latest-v2", package = "ink_core", default-features = false }20ink_core = { version = "2", git = "https://github.com/usetech-llc/ink", tag = "latest-v2", package = "ink_core", default-features = false }
21ink_prelude = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_prelude", default-features = false }21ink_prelude = { version = "2", git = "https://github.com/usetech-llc/ink", tag = "latest-v2", package = "ink_prelude", default-features = false }
22frame-system = { git = "https://github.com/usetech-llc/substrate/", branch = "nft_rc3", package = "frame-system", default-features = false }22frame-system = { git = "https://github.com/usetech-llc/substrate/", branch = "nft_rc3", package = "frame-system", default-features = false }
23pallet-indices = { git = "https://github.com/usetech-llc/substrate/", branch = "nft_rc3", package = "pallet-indices", default-features = false }23pallet-indices = { git = "https://github.com/usetech-llc/substrate/", branch = "nft_rc3", package = "pallet-indices", default-features = false }
24sp-core = { git = "https://github.com/usetech-llc/substrate/", branch = "nft_rc3", package = "sp-core", default-features = false }24sp-core = { git = "https://github.com/usetech-llc/substrate/", branch = "nft_rc3", package = "sp-core", default-features = false }
addedsmart_contract/ink-types-node-runtime/calls/.gitignorediffbeforeafterboth

no changes

addedsmart_contract/ink-types-node-runtime/calls/.ink/abi_gen/Cargo.tomldiffbeforeafterboth

no changes

addedsmart_contract/ink-types-node-runtime/calls/.ink/abi_gen/main.rsdiffbeforeafterboth

no changes

addedsmart_contract/ink-types-node-runtime/calls/Cargo.tomldiffbeforeafterboth

no changes

addedsmart_contract/ink-types-node-runtime/calls/lib.rsdiffbeforeafterboth

no changes

deletedsmart_contract/ink-types-node-runtime/examples/calls/.ink/abi_gen/Cargo.tomldiffbeforeafterboth

no changes

deletedsmart_contract/ink-types-node-runtime/examples/calls/.ink/abi_gen/main.rsdiffbeforeafterboth

no changes

deletedsmart_contract/ink-types-node-runtime/examples/calls/Cargo.lockdiffbeforeafterboth

no changes

deletedsmart_contract/ink-types-node-runtime/examples/calls/Cargo.tomldiffbeforeafterboth

no changes

deletedsmart_contract/ink-types-node-runtime/examples/calls/lib.rsdiffbeforeafterboth

no changes

modifiedsmart_contract/ink-types-node-runtime/src/calls.rsdiffbeforeafterboth
1// // Copyright 2019 Parity Technologies (UK) Ltd.1use crate::{AccountId, NodeRuntimeTypes};
2// // This file is part of ink!.
3// //
4// // ink! is free software: you can redistribute it and/or modify
5// // it under the terms of the GNU General Public License as published by
6// // the Free Software Foundation, either version 3 of the License, or
7// // (at your option) any later version.
8// //
9// // ink! is distributed in the hope that it will be useful,
10// // but WITHOUT ANY WARRANTY; without even the implied warranty of
11// // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// // GNU General Public License for more details.
13// //
14// // You should have received a copy of the GNU General Public License
15// // along with ink!. If not, see <http://www.gnu.org/licenses/>.
16
17// use ink_core::env::EnvTypes;
18// use scale::{Codec, Decode, Encode};
19// use sp_runtime::traits::Member;
20// use crate::{AccountId, Balance, NodeRuntimeTypes};
21
22// /// Default runtime Call type, a subset of the runtime Call module variants
23// ///
24// /// The codec indices of the modules *MUST* match those in the concrete runtime.
25// #[derive(Encode, Decode)]
26// #[cfg_attr(feature = "std", derive(Clone, PartialEq, Eq))]
27// pub enum Call {
28// #[codec(index = "5")]
29// Balances(Balances<NodeRuntimeTypes>),
30// }
31
32// impl From<Balances<NodeRuntimeTypes>> for Call {
33// fn from(balances_call: Balances<NodeRuntimeTypes>) -> Call {
34// Call::Balances(balances_call)
35// }
36// }
37// /// Generic Balance Call, could be used with other runtimes
38// #[derive(Encode, Decode, Clone, PartialEq, Eq)]
39// pub enum Balances<T>
40// where
41// T: EnvTypes,
42// T::AccountId: Member + Codec,
43// {
44// #[allow(non_camel_case_types)]
45// transfer(T::AccountId, #[codec(compact)] T::Balance),
46// }
47
48// /// Construct a `Balances::transfer` call
49// pub fn transfer_balance(account: AccountId, balance: Balance) -> Call {
50// Balances::<NodeRuntimeTypes>::transfer(account.into(), balance).into()
51// }
52
53
54
55
56
57
58
59// Copyright 2019 Parity Technologies (UK) Ltd.
60// This file is part of ink!.
61//
62// ink! is free software: you can redistribute it and/or modify
63// it under the terms of the GNU General Public License as published by
64// the Free Software Foundation, either version 3 of the License, or
65// (at your option) any later version.
66//
67// ink! is distributed in the hope that it will be useful,
68// but WITHOUT ANY WARRANTY; without even the implied warranty of
69// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
70// GNU General Public License for more details.
71//
72// You should have received a copy of the GNU General Public License
73// along with ink!. If not, see <http://www.gnu.org/licenses/>.
74
75use ink_core::env::EnvTypes;2use ink_core::env::EnvTypes;
3use ink_prelude::vec::Vec;
76use scale::{Codec, Decode, Encode};4use scale::{Codec, Decode, Encode};
77use sp_runtime::traits::Member;5use sp_runtime::traits::Member;
78use ink_prelude::vec::Vec;6
79use crate::{AccountId, Balance, NodeRuntimeTypes};
80
81
82/// Default runtime Call type, a subset of the runtime Call module variants
83///
84/// The codec indices of the modules *MUST* match those in the concrete runtime.
85#[derive(Encode, Decode)]7#[derive(Encode, Decode)]
86#[cfg_attr(feature = "std", derive(Clone, PartialEq, Eq))]8#[cfg_attr(feature = "std", derive(Clone, PartialEq, Eq))]
87pub enum Call {9pub enum Call {
155 Nft::<NodeRuntimeTypes>::nft_approve(approved.into(), collection_id, item_id).into()85 Nft::<NodeRuntimeTypes>::nft_approve(approved.into(), collection_id, item_id).into()
156}86}
157
158//GetApproved
15987
160pub fn transfer_from(collection_id: u64, item_id: u64, new_owner: AccountId) -> Call {88pub fn transfer_from(collection_id: u64, item_id: u64, new_owner: AccountId) -> Call {
161 Nft::<NodeRuntimeTypes>::nft_transfer_from(collection_id, item_id, new_owner.into()).into()89 Nft::<NodeRuntimeTypes>::nft_transfer_from(collection_id, item_id, new_owner.into()).into()
169 Nft::<NodeRuntimeTypes>::burn_item(collection_id, item_id).into()97 Nft::<NodeRuntimeTypes>::burn_item(collection_id, item_id).into()
170}98}
17199
172//GetOwner
173//BalanceOf
modifiedsmart_contract/ink-types-node-runtime/src/lib.rsdiffbeforeafterboth
1// Copyright 2018-2019 Parity Technologies (UK) Ltd.
2// This file is part of ink!.
3//
4// ink! is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// ink! is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with ink!. If not, see <http://www.gnu.org/licenses/>.
16
17//! Definitions for environment types for contracts targeted at a
18//! substrate chain with the default `node-runtime` configuration.
19
20#![cfg_attr(not(feature = "std"), no_std)]1#![cfg_attr(not(feature = "std"), no_std)]
212
24use scale::{Decode, Encode};5use scale::{Decode, Encode};
25use sp_core::crypto::AccountId32;6use sp_core::crypto::AccountId32;
26#[cfg(feature = "ink-generate-abi")]7#[cfg(feature = "ink-generate-abi")]
27use type_metadata::{HasTypeId, HasTypeDef, Metadata, MetaType, TypeId, TypeDef, TypeIdArray};8use type_metadata::{HasTypeDef, HasTypeId, MetaType, Metadata, TypeDef, TypeId, TypeIdArray};
289
29pub mod calls;10pub mod calls;
3011
43 }23 }
44}24}
25
26impl From<[u8; 32]> for AccountId {
27 fn from(account: [u8; 32]) -> Self {
28 AccountId(AccountId32::from(account))
29 }
30}
4531
46#[cfg(feature = "ink-generate-abi")]32#[cfg(feature = "ink-generate-abi")]
47impl HasTypeId for AccountId {33impl HasTypeId for AccountId {
deletedsmart_contract/ink-types-node-runtime/src/nft.rsdiffbeforeafterboth

no changes

deletedsmart_contract/nft/Cargo.lockdiffbeforeafterboth

no changes