difftreelog
Remove unneeded uses
in: master
2 files changed
client/rpc/src/lib.rsdiffbeforeafterboth--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -20,7 +20,7 @@
use jsonrpc_core::{Error as RpcError, ErrorCode, Result};
use jsonrpc_derive::rpc;
use up_data_structs::{
- RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property, PropertyKey,
+ RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property,
PropertyKeyPermission,
};
use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};
primitives/rpc/src/lib.rsdiffbeforeafterboth1// 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/>.1617#![cfg_attr(not(feature = "std"), no_std)]1819use up_data_structs::{20 CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property, PropertyKey,21 PropertyKeyPermission,22};23use sp_std::vec::Vec;24use codec::Decode;25use sp_runtime::DispatchError;2627type Result<T> = core::result::Result<T, DispatchError>;2829sp_api::decl_runtime_apis! {30 #[api_version(2)]31 pub trait UniqueApi<CrossAccountId, AccountId> where32 AccountId: Decode,33 CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,34 {35 #[changed_in(2)]36 fn token_owner(collection: CollectionId, token: TokenId) -> Result<CrossAccountId>;3738 fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>>;39 fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>>;40 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool>;4142 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;43 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;44 fn const_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;45 fn variable_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;4647 fn collection_properties(collection: CollectionId, properties: Vec<Vec<u8>>) -> Result<Vec<Property>>;4849 fn token_properties(50 collection: CollectionId,51 token_id: TokenId,52 properties: Vec<Vec<u8>>53 ) -> Result<Vec<Property>>;5455 fn property_permissions(56 collection: CollectionId,57 properties: Vec<Vec<u8>>58 ) -> Result<Vec<PropertyKeyPermission>>;5960 fn total_supply(collection: CollectionId) -> Result<u32>;61 fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32>;62 fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128>;63 fn allowance(64 collection: CollectionId,65 sender: CrossAccountId,66 spender: CrossAccountId,67 token: TokenId,68 ) -> Result<u128>;6970 fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>>;71 fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>>;72 fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool>;73 fn last_token_id(collection: CollectionId) -> Result<TokenId>;74 fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>>;75 fn collection_stats() -> Result<CollectionStats>;76 fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>>;77 fn effective_collection_limits(collection_id: CollectionId) -> Result<Option<CollectionLimits>>;78 }79}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/>.1617#![cfg_attr(not(feature = "std"), no_std)]1819use up_data_structs::{20 CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property,21 PropertyKeyPermission,22};23use sp_std::vec::Vec;24use codec::Decode;25use sp_runtime::DispatchError;2627type Result<T> = core::result::Result<T, DispatchError>;2829sp_api::decl_runtime_apis! {30 #[api_version(2)]31 pub trait UniqueApi<CrossAccountId, AccountId> where32 AccountId: Decode,33 CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,34 {35 #[changed_in(2)]36 fn token_owner(collection: CollectionId, token: TokenId) -> Result<CrossAccountId>;3738 fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>>;39 fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>>;40 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool>;4142 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;43 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;44 fn const_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;45 fn variable_metadata(collection: CollectionId, token: TokenId) -> Result<Vec<u8>>;4647 fn collection_properties(collection: CollectionId, properties: Vec<Vec<u8>>) -> Result<Vec<Property>>;4849 fn token_properties(50 collection: CollectionId,51 token_id: TokenId,52 properties: Vec<Vec<u8>>53 ) -> Result<Vec<Property>>;5455 fn property_permissions(56 collection: CollectionId,57 properties: Vec<Vec<u8>>58 ) -> Result<Vec<PropertyKeyPermission>>;5960 fn total_supply(collection: CollectionId) -> Result<u32>;61 fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32>;62 fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128>;63 fn allowance(64 collection: CollectionId,65 sender: CrossAccountId,66 spender: CrossAccountId,67 token: TokenId,68 ) -> Result<u128>;6970 fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>>;71 fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>>;72 fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool>;73 fn last_token_id(collection: CollectionId) -> Result<TokenId>;74 fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>>;75 fn collection_stats() -> Result<CollectionStats>;76 fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>>;77 fn effective_collection_limits(collection_id: CollectionId) -> Result<Option<CollectionLimits>>;78 }79}