difftreelog
Merge pull request #47 from usetech-llc/update_license
in: master
Update license information
25 files changed
LICENSEdiffbeforeafterboth--- a/LICENSE
+++ b/LICENSE
@@ -1,24 +1,15 @@
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
+USETECH PROFESSIONAL CONFIDENTIAL
+__________________
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+ [2019] - [2020] UseTech Professional LTD.
+ All Rights Reserved.
-For more information, please refer to <http://unlicense.org>
+NOTICE: All information contained herein is, and remains
+the property of UseTech Professional LTD. and its suppliers,
+if any. The intellectual and technical concepts contained
+herein are proprietary to UseTech Professional LTD.
+and its suppliers and may be covered by U.S. and Foreign Patents,
+patents in process, and are protected by trade secret or copyright law.
+Dissemination of this information or reproduction of this material
+is strictly forbidden unless prior written permission is obtained
+from UseTech Professional LTD..
node/build.rsdiffbeforeafterboth--- a/node/build.rs
+++ b/node/build.rs
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
fn main() {
node/src/chain_spec.rsdiffbeforeafterboth--- a/node/src/chain_spec.rs
+++ b/node/src/chain_spec.rs
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
// use nft_runtime::{
// AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,
// SystemConfig, WASM_BINARY,
node/src/main.rsdiffbeforeafterboth--- a/node/src/main.rs
+++ b/node/src/main.rs
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
//! Substrate Node Template CLI library.
#![warn(missing_docs)]
node/src/service.rsdiffbeforeafterboth--- a/node/src/service.rs
+++ b/node/src/service.rs
@@ -1,5 +1,10 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
use std::sync::Arc;
use std::time::Duration;
use sc_client_api::{ExecutorProvider, RemoteBackend};
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
#![recursion_limit = "1024"]
#![cfg_attr(not(feature = "std"), no_std)]
runtime/src/lib.rsdiffbeforeafterboth1//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.23#![cfg_attr(not(feature = "std"), no_std)]4// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.5#![recursion_limit = "256"]67// Make the WASM binary available.8#[cfg(feature = "std")]9include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));1011use pallet_contracts_rpc_runtime_api::ContractExecResult;12use pallet_grandpa::fg_primitives;13use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};14use sp_api::impl_runtime_apis;15use sp_consensus_aura::sr25519::AuthorityId as AuraId;16use sp_core::{ crypto::KeyTypeId, crypto::Public, OpaqueMetadata };17use sp_runtime::{18 create_runtime_str, generic, impl_opaque_keys,19 traits::{20 Convert, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount, 21 IdentityLookup, NumberFor, Saturating, Verify,22 },23 transaction_validity::{TransactionSource, TransactionValidity},24 ApplyExtrinsicResult, MultiSignature,25};26use sp_std::prelude::*;27#[cfg(feature = "std")]28use sp_version::NativeVersion;29use sp_version::RuntimeVersion;3031// A few exports that help ease life for downstream crates.32pub use pallet_balances::Call as BalancesCall;33pub use pallet_contracts::Schedule as ContractsSchedule;34pub use frame_support::{35 construct_runtime,36 dispatch::DispatchResult,37 parameter_types,38 traits::{39 Currency, ExistenceRequirement, Get, KeyOwnerProofSystem, OnUnbalanced, Randomness,40 WithdrawReason, LockIdentifier,41 },42 weights::{43 constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},44 DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,45 WeightToFeePolynomial,46 },47 StorageValue,48};49#[cfg(any(feature = "std", test))]50pub use sp_runtime::BuildStorage;51use sp_runtime:: { Perbill, Permill, Percent, ModuleId };52use frame_system::{self as system, EnsureRoot };53use sp_std::{marker::PhantomData};5455pub use pallet_timestamp::Call as TimestampCall;5657/// Struct that handles the conversion of Balance -> `u64`. This is used for58/// staking's election calculation.59pub struct CurrencyToVoteHandler;6061impl CurrencyToVoteHandler {62 fn factor() -> Balance {63 (Balances::total_issuance() / u64::max_value() as Balance).max(1)64 }65}6667impl Convert<Balance, u64> for CurrencyToVoteHandler {68 fn convert(x: Balance) -> u64 {69 (x / Self::factor()) as u6470 }71}7273impl Convert<u128, Balance> for CurrencyToVoteHandler {74 fn convert(x: u128) -> Balance {75 x * Self::factor()76 }77}7879/// Re-export a nft pallet80/// TODO: Check this re-export. Is this safe and good style?81extern crate pallet_nft;82pub use pallet_nft::*;8384/// An index to a block.85pub type BlockNumber = u32;8687/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.88pub type Signature = MultiSignature;8990/// Some way of identifying an account on the chain. We intentionally make it equivalent91/// to the public key of our transaction signing scheme.92pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;9394/// The type for looking up accounts. We don't expect more than 4 billion of them, but you95/// never know...96pub type AccountIndex = u32;9798/// Balance of an account.99pub type Balance = u128;100101/// Index of a transaction in the chain.102pub type Index = u32;103104/// A hash of some data used by the chain.105pub type Hash = sp_core::H256;106107/// Digest item type.108pub type DigestItem = generic::DigestItem<Hash>;109110mod nft_weights;111112/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know113/// the specifics of the runtime. They can then be made to be agnostic over specific formats114/// of data like extrinsics, allowing for them to continue syncing the network through upgrades115/// to even the core data structures.116pub mod opaque {117 use super::*;118119 pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;120121 /// Opaque block header type.122 pub type Header = generic::Header<BlockNumber, BlakeTwo256>;123 /// Opaque block type.124 pub type Block = generic::Block<Header, UncheckedExtrinsic>;125 /// Opaque block identifier type.126 pub type BlockId = generic::BlockId<Block>;127128 impl_opaque_keys! {129 pub struct SessionKeys {130 pub aura: Aura,131 pub grandpa: Grandpa,132 }133 }134}135136/// This runtime version.137pub const VERSION: RuntimeVersion = RuntimeVersion {138 spec_name: create_runtime_str!("nft"),139 impl_name: create_runtime_str!("nft"),140 authoring_version: 1,141 spec_version: 2,142 impl_version: 1,143 apis: RUNTIME_API_VERSIONS,144 transaction_version: 1,145};146147pub const MILLISECS_PER_BLOCK: u64 = 6000;148149pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;150151// These time units are defined in number of blocks.152pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);153pub const HOURS: BlockNumber = MINUTES * 60;154pub const DAYS: BlockNumber = HOURS * 24;155156/// The version information used to identify this runtime when compiled natively.157#[cfg(feature = "std")]158pub fn native_version() -> NativeVersion {159 NativeVersion {160 runtime_version: VERSION,161 can_author_with: Default::default(),162 }163}164165/// Provides a membership set with only the configured aura users166pub struct ValiudatorsOnly<Runtime: pallet_aura::Trait>(PhantomData<Runtime>);167impl frame_support::traits::Contains<AccountId> for ValiudatorsOnly<Runtime> {168 fn contains(t: &AccountId) -> bool {169 let arr: [u8; 32] = *t.as_ref();170 let raw_key: Vec<u8> = Vec::from(arr);171172 match pallet_aura::Module::<Runtime>::authorities().iter().find(|auth| auth.to_raw_vec() == raw_key) {173 Some(_) => true,174 None => false,175 } 176 }177 fn sorted_members() -> Vec<AccountId> {178 let mut members: Vec<AccountId> = Vec::new();179 for auth in pallet_aura::Module::<Runtime>::authorities() {180 let mut arr: [u8; 32] = Default::default(); 181 let bor_arr = auth.clone().to_raw_vec();182 let slice = bor_arr.as_slice();183 arr.copy_from_slice(slice);184 members.push(AccountId::from(arr));185 }186 members 187 }188 fn count() -> usize {189 pallet_aura::Module::<Runtime>::authorities().len()190 }191}192193impl frame_support::traits::ContainsLengthBound for ValiudatorsOnly<Runtime> {194 fn min_len() -> usize {195 1196 }197 fn max_len() -> usize {198 100199 }200}201202parameter_types! {203 pub const BlockHashCount: BlockNumber = 2400;204 /// We allow for 2 seconds of compute with a 6 second average block time.205 pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;206 pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);207 /// Assume 10% of weight for average on_initialize calls.208 pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()209 .saturating_sub(Perbill::from_percent(10)) * MaximumBlockWeight::get();210 pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;211 pub const Version: RuntimeVersion = VERSION;212}213214impl system::Trait for Runtime {215 /// The basic call filter to use in dispatchable.216 type BaseCallFilter = ();217 /// The identifier used to distinguish between accounts.218 type AccountId = AccountId;219 /// The aggregated dispatch type that is available for extrinsics.220 type Call = Call;221 /// The lookup mechanism to get account ID from whatever is passed in dispatchers.222 type Lookup = IdentityLookup<AccountId>;223 /// The index type for storing how many extrinsics an account has signed.224 type Index = Index;225 /// The index type for blocks.226 type BlockNumber = BlockNumber;227 /// The type for hashing blocks and tries.228 type Hash = Hash;229 /// The hashing algorithm used.230 type Hashing = BlakeTwo256;231 /// The header type.232 type Header = generic::Header<BlockNumber, BlakeTwo256>;233 /// The ubiquitous event type.234 type Event = Event;235 /// The ubiquitous origin type.236 type Origin = Origin;237 /// Maximum number of block number to block hash mappings to keep (oldest pruned first).238 type BlockHashCount = BlockHashCount;239 /// Maximum weight of each block.240 type MaximumBlockWeight = MaximumBlockWeight;241 /// The weight of database operations that the runtime can invoke.242 type DbWeight = RocksDbWeight;243 /// The weight of the overhead invoked on the block import process, independent of the244 /// extrinsics included in that block.245 type BlockExecutionWeight = BlockExecutionWeight;246 /// The base weight of any extrinsic processed by the runtime, independent of the247 /// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)248 type ExtrinsicBaseWeight = ExtrinsicBaseWeight;249 /// The maximum weight that a single extrinsic of `Normal` dispatch class can have,250 /// idependent of the logic of that extrinsics. (Roughly max block weight - average on251 /// initialize cost).252 type MaximumExtrinsicWeight = MaximumExtrinsicWeight;253 /// Maximum size of all encoded transactions (in bytes) that are allowed in one block.254 type MaximumBlockLength = MaximumBlockLength;255 /// Portion of the block weight that is available to all normal transactions.256 type AvailableBlockRatio = AvailableBlockRatio;257 /// Version of the runtime.258 type Version = Version;259 /// This type is being generated by `construct_runtime!`.260 type PalletInfo = PalletInfo;261 /// What to do if a new account is created.262 type OnNewAccount = ();263 /// What to do if an account is fully reaped from the system.264 type OnKilledAccount = ();265 /// The data to be stored in an account.266 type AccountData = pallet_balances::AccountData<Balance>;267 /// Weight information for the extrinsics of this pallet.268 type SystemWeightInfo = ();269}270271impl pallet_aura::Trait for Runtime {272 type AuthorityId = AuraId;273}274275impl pallet_grandpa::Trait for Runtime {276 type Event = Event;277 type Call = Call;278279 type KeyOwnerProofSystem = ();280281 type KeyOwnerProof =282 <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;283284 type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(285 KeyTypeId,286 GrandpaId,287 )>>::IdentificationTuple;288289 type HandleEquivocation = ();290291 type WeightInfo = ();292}293294parameter_types! {295 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;296}297298impl pallet_timestamp::Trait for Runtime {299 /// A timestamp: milliseconds since the unix epoch.300 type Moment = u64;301 type OnTimestampSet = Aura;302 type MinimumPeriod = MinimumPeriod;303 type WeightInfo = ();304}305306parameter_types! {307 // pub const ExistentialDeposit: u128 = 500;308 pub const ExistentialDeposit: u128 = 0;309 pub const MaxLocks: u32 = 50;310}311312impl pallet_balances::Trait for Runtime {313 type MaxLocks = MaxLocks;314 /// The type for recording an account's balance.315 type Balance = Balance;316 /// The ubiquitous event type.317 type Event = Event;318 type DustRemoval = Treasury;319 type ExistentialDeposit = ExistentialDeposit;320 type AccountStore = System;321 type WeightInfo = ();322}323324pub const MILLICENTS: Balance = 1_000_000_000;325pub const CENTS: Balance = 1_000 * MILLICENTS;326pub const DOLLARS: Balance = 100 * CENTS;327328parameter_types! {329 pub const TombstoneDeposit: Balance = 0;330 pub const RentByteFee: Balance = 4 * MILLICENTS;331 pub const RentDepositOffset: Balance = 1000 * MILLICENTS;332 pub const SurchargeReward: Balance = 150 * MILLICENTS;333}334335impl pallet_contracts::Trait for Runtime {336 type Time = Timestamp;337 type Randomness = RandomnessCollectiveFlip;338 type Currency = Balances;339 type Event = Event;340 type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer<Runtime>;341 type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter<Runtime>;342 type RentPayment = ();343 type SignedClaimHandicap = pallet_contracts::DefaultSignedClaimHandicap;344 type TombstoneDeposit = TombstoneDeposit;345 type StorageSizeOffset = pallet_contracts::DefaultStorageSizeOffset;346 type RentByteFee = RentByteFee;347 type RentDepositOffset = RentDepositOffset;348 type SurchargeReward = SurchargeReward;349 type MaxDepth = pallet_contracts::DefaultMaxDepth;350 type MaxValueSize = pallet_contracts::DefaultMaxValueSize;351 type WeightPrice = pallet_transaction_payment::Module<Self>;352}353354parameter_types! {355 pub const TransactionByteFee: Balance = 10 * MILLICENTS;356}357358impl pallet_transaction_payment::Trait for Runtime {359 type Currency = pallet_balances::Module<Runtime>;360 type OnTransactionPayment = Treasury;361 type TransactionByteFee = TransactionByteFee;362 type WeightToFee = IdentityFee<Balance>;363 type FeeMultiplierUpdate = ();364}365366parameter_types! {367 pub const ProposalBond: Permill = Permill::from_percent(5);368 pub const ProposalBondMinimum: Balance = 1 * DOLLARS;369 pub const SpendPeriod: BlockNumber = 5 * MINUTES;370 pub const Burn: Permill = Permill::from_percent(0);371 pub const TipCountdown: BlockNumber = 1 * DAYS;372 pub const TipFindersFee: Percent = Percent::from_percent(20);373 pub const TipReportDepositBase: Balance = 1 * DOLLARS;374 pub const DataDepositPerByte: Balance = 1 * CENTS;375 pub const BountyDepositBase: Balance = 1 * DOLLARS;376 pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;377 pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");378 pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;379 pub const MaximumReasonLength: u32 = 16384;380 pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);381 pub const BountyValueMinimum: Balance = 5 * DOLLARS;382}383384impl pallet_treasury::Trait for Runtime {385 type ModuleId = TreasuryModuleId;386 type Currency = Balances;387 type ApproveOrigin = EnsureRoot<AccountId>;388 type RejectOrigin = EnsureRoot<AccountId>;389 type Tippers = ValiudatorsOnly<Self>;390 type TipCountdown = TipCountdown;391 type TipFindersFee = TipFindersFee;392 type TipReportDepositBase = TipReportDepositBase;393 type DataDepositPerByte = DataDepositPerByte;394 type Event = Event;395 type OnSlash = ();396 type ProposalBond = ProposalBond;397 type ProposalBondMinimum = ProposalBondMinimum;398 type SpendPeriod = SpendPeriod;399 type Burn = Burn;400 type BountyDepositBase = BountyDepositBase;401 type BountyDepositPayoutDelay = BountyDepositPayoutDelay;402 type BountyUpdatePeriod = BountyUpdatePeriod;403 type BountyCuratorDeposit = BountyCuratorDeposit;404 type BountyValueMinimum = BountyValueMinimum;405 type MaximumReasonLength = MaximumReasonLength;406 type BurnDestination = ();407 type WeightInfo = ();408}409410impl pallet_sudo::Trait for Runtime {411 type Event = Event;412 type Call = Call;413}414415parameter_types! {416 pub const MinVestedTransfer: Balance = 100 * DOLLARS;417}418419impl pallet_vesting::Trait for Runtime {420 type Event = Event;421 type Currency = Balances;422 type BlockNumberToBalance = ConvertInto;423 type MinVestedTransfer = MinVestedTransfer;424 type WeightInfo = ();425}426427/// Used for the module nft in `./nft.rs`428impl pallet_nft::Trait for Runtime {429 type Event = Event;430 type WeightInfo = nft_weights::WeightInfo;431}432433construct_runtime!(434 pub enum Runtime where435 Block = Block,436 NodeBlock = opaque::Block,437 UncheckedExtrinsic = UncheckedExtrinsic438 {439 System: system::{Module, Call, Config, Storage, Event<T>},440 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},441 Contracts: pallet_contracts::{Module, Call, Config, Storage, Event<T>},442 Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},443 Aura: pallet_aura::{Module, Config<T>, Inherent},444 Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},445 Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},446 TransactionPayment: pallet_transaction_payment::{Module, Storage},447 Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},448 Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},449 Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},450 Vesting: pallet_vesting::{Module, Call, Config<T>, Storage, Event<T>},451 }452);453454/// The address format for describing accounts.455pub type Address = AccountId;456/// Block header type as expected by this runtime.457pub type Header = generic::Header<BlockNumber, BlakeTwo256>;458/// Block type as expected by this runtime.459pub type Block = generic::Block<Header, UncheckedExtrinsic>;460/// A Block signed with a Justification461pub type SignedBlock = generic::SignedBlock<Block>;462/// BlockId type as expected by this runtime.463pub type BlockId = generic::BlockId<Block>;464/// The SignedExtension to the basic transaction logic.465pub type SignedExtra = (466 system::CheckSpecVersion<Runtime>,467 system::CheckTxVersion<Runtime>,468 system::CheckGenesis<Runtime>,469 system::CheckEra<Runtime>,470 system::CheckNonce<Runtime>,471 system::CheckWeight<Runtime>,472 pallet_nft::ChargeTransactionPayment<Runtime>,473);474/// Unchecked extrinsic type as expected by this runtime.475pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;476/// Extrinsic type that has already been checked.477pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;478/// Executive: handles dispatch to the various modules.479pub type Executive =480 frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;481482impl_runtime_apis! {483484 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>485 for Runtime486 {487 fn call(488 origin: AccountId,489 dest: AccountId,490 value: Balance,491 gas_limit: u64,492 input_data: Vec<u8>,493 ) -> ContractExecResult {494 let (exec_result, gas_consumed) =495 Contracts::bare_call(origin, dest.into(), value, gas_limit, input_data);496 match exec_result {497 Ok(v) => ContractExecResult::Success {498 flags: v.flags.bits(),499 data: v.data,500 gas_consumed: gas_consumed,501 },502 Err(_) => ContractExecResult::Error,503 }504 }505506 fn get_storage(507 address: AccountId,508 key: [u8; 32],509 ) -> pallet_contracts_primitives::GetStorageResult {510 Contracts::get_storage(address, key)511 }512513 fn rent_projection(514 address: AccountId,515 ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {516 Contracts::rent_projection(address)517 }518 }519520 impl sp_api::Core<Block> for Runtime {521 fn version() -> RuntimeVersion {522 VERSION523 }524525 fn execute_block(block: Block) {526 Executive::execute_block(block)527 }528529 fn initialize_block(header: &<Block as BlockT>::Header) {530 Executive::initialize_block(header)531 }532 }533534 impl sp_api::Metadata<Block> for Runtime {535 fn metadata() -> OpaqueMetadata {536 Runtime::metadata().into()537 }538 }539540 impl sp_block_builder::BlockBuilder<Block> for Runtime {541 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {542 Executive::apply_extrinsic(extrinsic)543 }544545 fn finalize_block() -> <Block as BlockT>::Header {546 Executive::finalize_block()547 }548549 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {550 data.create_extrinsics()551 }552553 fn check_inherents(554 block: Block,555 data: sp_inherents::InherentData,556 ) -> sp_inherents::CheckInherentsResult {557 data.check_extrinsics(&block)558 }559560 fn random_seed() -> <Block as BlockT>::Hash {561 RandomnessCollectiveFlip::random_seed()562 }563 }564565 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {566 fn validate_transaction(567 source: TransactionSource,568 tx: <Block as BlockT>::Extrinsic,569 ) -> TransactionValidity {570 Executive::validate_transaction(source, tx)571 }572 }573574 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {575 fn offchain_worker(header: &<Block as BlockT>::Header) {576 Executive::offchain_worker(header)577 }578 }579580 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {581 fn slot_duration() -> u64 {582 Aura::slot_duration()583 }584585 fn authorities() -> Vec<AuraId> {586 Aura::authorities()587 }588 }589590 impl sp_session::SessionKeys<Block> for Runtime {591 fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {592 opaque::SessionKeys::generate(seed)593 }594595 fn decode_session_keys(596 encoded: Vec<u8>,597 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {598 opaque::SessionKeys::decode_into_raw_public_keys(&encoded)599 }600 }601602 impl fg_primitives::GrandpaApi<Block> for Runtime {603 fn grandpa_authorities() -> GrandpaAuthorityList {604 Grandpa::grandpa_authorities()605 }606607 fn submit_report_equivocation_unsigned_extrinsic(608 _equivocation_proof: fg_primitives::EquivocationProof<609 <Block as BlockT>::Hash,610 NumberFor<Block>,611 >,612 _key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,613 ) -> Option<()> {614 None615 }616617 fn generate_key_ownership_proof(618 _set_id: fg_primitives::SetId,619 _authority_id: GrandpaId,620 ) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {621 // NOTE: this is the only implementation possible since we've622 // defined our key owner proof type as a bottom type (i.e. a type623 // with no values).624 None625 }626 }627 628 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {629 fn account_nonce(account: AccountId) -> Index {630 System::account_nonce(account)631 }632 }633634 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {635 fn query_info(636 uxt: <Block as BlockT>::Extrinsic,637 len: u32,638 ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {639 TransactionPayment::query_info(uxt, len)640 }641 }642643 #[cfg(feature = "runtime-benchmarks")]644 impl frame_benchmarking::Benchmark<Block> for Runtime {645 fn dispatch_benchmark(646 config: frame_benchmarking::BenchmarkConfig647 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {648 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};649650 let whitelist: Vec<TrackedStorageKey> = vec![651 // Alice account652 hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),653 // // Total Issuance654 // hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),655 // // Execution Phase656 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),657 // // Event Count658 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),659 // // System Events660 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),661 ];662663 let mut batches = Vec::<BenchmarkBatch>::new();664 let params = (&config, &whitelist);665666 add_benchmark!(params, batches, pallet_nft, Nft);667668 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }669 Ok(batches)670 }671 }672}runtime/src/nft_weights.rsdiffbeforeafterboth--- a/runtime/src/nft_weights.rs
+++ b/runtime/src/nft_weights.rs
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
pub struct WeightInfo;
tests/src/accounts.tsdiffbeforeafterboth--- a/tests/src/accounts.ts
+++ b/tests/src/accounts.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
export const bobsPublicKey = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';
export const alicesPublicKey = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
export const ferdiesPublicKey = '5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL';
tests/src/blocks-production.test.tsdiffbeforeafterboth--- a/tests/src/blocks-production.test.ts
+++ b/tests/src/blocks-production.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import usingApi from "./substrate/substrate-api";
import promisifySubstrate from "./substrate/promisify-substrate";
import { expect } from "chai";
tests/src/config.tsdiffbeforeafterboth--- a/tests/src/config.ts
+++ b/tests/src/config.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import process from 'process';
const config = {
tests/src/connection.test.tsdiffbeforeafterboth--- a/tests/src/connection.test.ts
+++ b/tests/src/connection.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import usingApi from "./substrate/substrate-api";
import { WsProvider } from '@polkadot/api';
import * as chai from 'chai';
tests/src/contracts.test.tsdiffbeforeafterboth--- a/tests/src/contracts.test.ts
+++ b/tests/src/contracts.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { ApiPromise } from "@polkadot/api";
import { expect } from "chai";
import { default as usingApi, submitTransactionAsync } from "./substrate/substrate-api";
tests/src/createCollection.test.tsdiffbeforeafterboth--- a/tests/src/createCollection.test.ts
+++ b/tests/src/createCollection.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { default as usingApi } from "./substrate/substrate-api";
tests/src/createMultipleItems.test.tsdiffbeforeafterboth--- a/tests/src/createMultipleItems.test.ts
+++ b/tests/src/createMultipleItems.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { assert } from 'chai';
import { alicesPublicKey } from './accounts';
import privateKey from './substrate/privateKey';
tests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth--- a/tests/src/creditFeesToTreasury.test.ts
+++ b/tests/src/creditFeesToTreasury.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { default as usingApi, submitTransactionAsync } from "./substrate/substrate-api";
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { ApiPromise } from "@polkadot/api";
import { expect } from "chai";
import usingApi from "./substrate/substrate-api";
tests/src/substrate/get-balance.tsdiffbeforeafterboth--- a/tests/src/substrate/get-balance.ts
+++ b/tests/src/substrate/get-balance.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { ApiPromise } from "@polkadot/api";
import promisifySubstrate from "./promisify-substrate";
import {AccountInfo} from "@polkadot/types/interfaces/system";
tests/src/substrate/privateKey.tsdiffbeforeafterboth--- a/tests/src/substrate/privateKey.ts
+++ b/tests/src/substrate/privateKey.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { Keyring } from "@polkadot/api";
import { IKeyringPair } from "@polkadot/types/types";
tests/src/substrate/promisify-substrate.tsdiffbeforeafterboth--- a/tests/src/substrate/promisify-substrate.ts
+++ b/tests/src/substrate/promisify-substrate.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import ApiPromise from "@polkadot/api/promise/Api";
type PromiseType<T> = T extends PromiseLike<infer TInner> ? TInner : T;
tests/src/substrate/substrate-api.tsdiffbeforeafterboth--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { WsProvider, ApiPromise } from "@polkadot/api";
import type { AccountId, Address, ApplyExtrinsicResult, DispatchError, DispatchInfo, EventRecord, Extrinsic, ExtrinsicStatus, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces';
import { IKeyringPair } from "@polkadot/types/types";
tests/src/substrate/wait-new-blocks.tsdiffbeforeafterboth--- a/tests/src/substrate/wait-new-blocks.ts
+++ b/tests/src/substrate/wait-new-blocks.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { ApiPromise } from "@polkadot/api";
export default function waitNewBlocks(api: ApiPromise, blocksCount: number = 1): Promise<void> {
tests/src/transfer.test.tsdiffbeforeafterboth--- a/tests/src/transfer.test.ts
+++ b/tests/src/transfer.test.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import { expect, assert } from "chai";
import { default as usingApi, submitTransactionAsync } from "./substrate/substrate-api";
import { alicesPublicKey, bobsPublicKey, ferdiesPublicKey } from "./accounts";
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import type { AccountId, EventRecord } from '@polkadot/types/interfaces';
tests/src/util/util.tsdiffbeforeafterboth--- a/tests/src/util/util.ts
+++ b/tests/src/util/util.ts
@@ -1,3 +1,8 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
export function strToUTF16(str: string): any {
let buf: number[] = [];
for (let i=0, strLen=str.length; i < strLen; i++) {