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.rsdiffbeforeafterboth1//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.23use std::sync::Arc;4use std::time::Duration;5use sc_client_api::{ExecutorProvider, RemoteBackend};6use nft_runtime::{self, opaque::Block, RuntimeApi};7use sc_service::{error::Error as ServiceError, Configuration, TaskManager};8use sp_inherents::InherentDataProviders;9use sc_executor::native_executor_instance;10pub use sc_executor::NativeExecutor;11use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};12use sc_finality_grandpa::{FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState};1314// Our native executor instance.15native_executor_instance!(16 pub Executor,17 nft_runtime::api::dispatch,18 nft_runtime::native_version,19 frame_benchmarking::benchmarking::HostFunctions,20);2122type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;23type FullBackend = sc_service::TFullBackend<Block>;24type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;2526pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponents<27 FullClient, FullBackend, FullSelectChain,28 sp_consensus::DefaultImportQueue<Block, FullClient>,29 sc_transaction_pool::FullPool<Block, FullClient>,30 (31 sc_consensus_aura::AuraBlockImport<32 Block,33 FullClient,34 sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,35 AuraPair36 >,37 sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>38 )39>, ServiceError> {40 let inherent_data_providers = sp_inherents::InherentDataProviders::new();4142 let (client, backend, keystore, task_manager) =43 sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;44 let client = Arc::new(client);4546 let select_chain = sc_consensus::LongestChain::new(backend.clone());4748 let transaction_pool = sc_transaction_pool::BasicPool::new_full(49 config.transaction_pool.clone(),50 config.prometheus_registry(),51 task_manager.spawn_handle(),52 client.clone(),53 );5455 let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(56 client.clone(), &(client.clone() as Arc<_>), select_chain.clone(),57 )?;5859 let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(60 grandpa_block_import.clone(), client.clone(),61 );6263 let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(64 sc_consensus_aura::slot_duration(&*client)?,65 aura_block_import.clone(),66 Some(Box::new(grandpa_block_import.clone())),67 None,68 client.clone(),69 inherent_data_providers.clone(),70 &task_manager.spawn_handle(),71 config.prometheus_registry(),72 sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),73 )?;7475 Ok(sc_service::PartialComponents {76 client, backend, task_manager, import_queue, keystore, select_chain, transaction_pool,77 inherent_data_providers,78 other: (aura_block_import, grandpa_link),79 })80}8182/// Builds a new service for a full client.83pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {84 let sc_service::PartialComponents {85 client, backend, mut task_manager, import_queue, keystore, select_chain, transaction_pool,86 inherent_data_providers,87 other: (block_import, grandpa_link),88 } = new_partial(&config)?;8990 let finality_proof_provider =91 GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());9293 let (network, network_status_sinks, system_rpc_tx, network_starter) =94 sc_service::build_network(sc_service::BuildNetworkParams {95 config: &config,96 client: client.clone(),97 transaction_pool: transaction_pool.clone(),98 spawn_handle: task_manager.spawn_handle(),99 import_queue,100 on_demand: None,101 block_announce_validator_builder: None,102 finality_proof_request_builder: None,103 finality_proof_provider: Some(finality_proof_provider.clone()),104 })?;105106 if config.offchain_worker.enabled {107 sc_service::build_offchain_workers(108 &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(),109 );110 }111112 let role = config.role.clone();113 let force_authoring = config.force_authoring;114 let name = config.network.node_name.clone();115 let enable_grandpa = !config.disable_grandpa;116 let prometheus_registry = config.prometheus_registry().cloned();117 let telemetry_connection_sinks = sc_service::TelemetryConnectionSinks::default();118119 let rpc_extensions_builder = {120 let client = client.clone();121 let pool = transaction_pool.clone();122123 Box::new(move |deny_unsafe, _| {124 let deps = crate::rpc::FullDeps {125 client: client.clone(),126 pool: pool.clone(),127 deny_unsafe,128 };129130 crate::rpc::create_full(deps)131 })132 };133134 sc_service::spawn_tasks(sc_service::SpawnTasksParams {135 network: network.clone(),136 client: client.clone(),137 keystore: keystore.clone(),138 task_manager: &mut task_manager,139 transaction_pool: transaction_pool.clone(),140 telemetry_connection_sinks: telemetry_connection_sinks.clone(),141 rpc_extensions_builder: rpc_extensions_builder,142 on_demand: None,143 remote_blockchain: None,144 backend, network_status_sinks, system_rpc_tx, config,145 })?;146147 if role.is_authority() {148 let proposer = sc_basic_authorship::ProposerFactory::new(149 client.clone(),150 transaction_pool,151 prometheus_registry.as_ref(),152 );153154 let can_author_with =155 sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());156157 let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(158 sc_consensus_aura::slot_duration(&*client)?,159 client.clone(),160 select_chain,161 block_import,162 proposer,163 network.clone(),164 inherent_data_providers.clone(),165 force_authoring,166 keystore.clone(),167 can_author_with,168 )?;169170 // the AURA authoring task is considered essential, i.e. if it171 // fails we take down the service with it.172 task_manager.spawn_essential_handle().spawn_blocking("aura", aura);173 }174175 // if the node isn't actively participating in consensus then it doesn't176 // need a keystore, regardless of which protocol we use below.177 let keystore = if role.is_authority() {178 Some(keystore as sp_core::traits::BareCryptoStorePtr)179 } else {180 None181 };182183 let grandpa_config = sc_finality_grandpa::Config {184 // FIXME #1578 make this available through chainspec185 gossip_duration: Duration::from_millis(333),186 justification_period: 512,187 name: Some(name),188 observer_enabled: false,189 keystore,190 is_authority: role.is_network_authority(),191 };192193 if enable_grandpa {194 // start the full GRANDPA voter195 // NOTE: non-authorities could run the GRANDPA observer protocol, but at196 // this point the full voter should provide better guarantees of block197 // and vote data availability than the observer. The observer has not198 // been tested extensively yet and having most nodes in a network run it199 // could lead to finality stalls.200 let grandpa_config = sc_finality_grandpa::GrandpaParams {201 config: grandpa_config,202 link: grandpa_link,203 network,204 inherent_data_providers,205 telemetry_on_connect: Some(telemetry_connection_sinks.on_connect_stream()),206 voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),207 prometheus_registry,208 shared_voter_state: SharedVoterState::empty(),209 };210211 // the GRANDPA voter task is considered infallible, i.e.212 // if it fails we take down the service with it.213 task_manager.spawn_essential_handle().spawn_blocking(214 "grandpa-voter",215 sc_finality_grandpa::run_grandpa_voter(grandpa_config)?216 );217 } else {218 sc_finality_grandpa::setup_disabled_grandpa(219 client,220 &inherent_data_providers,221 network,222 )?;223 }224225 network_starter.start_network();226 Ok(task_manager)227}228229/// Builds a new service for a light client.230pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {231 let (client, backend, keystore, mut task_manager, on_demand) =232 sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;233234 let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light(235 config.transaction_pool.clone(),236 config.prometheus_registry(),237 task_manager.spawn_handle(),238 client.clone(),239 on_demand.clone(),240 ));241242 let grandpa_block_import = sc_finality_grandpa::light_block_import(243 client.clone(), backend.clone(), &(client.clone() as Arc<_>),244 Arc::new(on_demand.checker().clone()) as Arc<_>,245 )?;246 let finality_proof_import = grandpa_block_import.clone();247 let finality_proof_request_builder =248 finality_proof_import.create_finality_proof_request_builder();249250 let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(251 sc_consensus_aura::slot_duration(&*client)?,252 grandpa_block_import,253 None,254 Some(Box::new(finality_proof_import)),255 client.clone(),256 InherentDataProviders::new(),257 &task_manager.spawn_handle(),258 config.prometheus_registry(),259 sp_consensus::NeverCanAuthor,260 )?;261262 let finality_proof_provider =263 GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());264265 let (network, network_status_sinks, system_rpc_tx, network_starter) =266 sc_service::build_network(sc_service::BuildNetworkParams {267 config: &config,268 client: client.clone(),269 transaction_pool: transaction_pool.clone(),270 spawn_handle: task_manager.spawn_handle(),271 import_queue,272 on_demand: Some(on_demand.clone()),273 block_announce_validator_builder: None,274 finality_proof_request_builder: Some(finality_proof_request_builder),275 finality_proof_provider: Some(finality_proof_provider),276 })?;277278 if config.offchain_worker.enabled {279 sc_service::build_offchain_workers(280 &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(),281 );282 }283284 sc_service::spawn_tasks(sc_service::SpawnTasksParams {285 remote_blockchain: Some(backend.remote_blockchain()),286 transaction_pool,287 task_manager: &mut task_manager,288 on_demand: Some(on_demand),289 rpc_extensions_builder: Box::new(|_, _| ()),290 telemetry_connection_sinks: sc_service::TelemetryConnectionSinks::default(),291 config,292 client,293 keystore,294 backend,295 network,296 network_status_sinks,297 system_rpc_tx,298 })?;299300 network_starter.start_network();301302 Ok(task_manager)303}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.rsdiffbeforeafterboth--- a/runtime/src/lib.rs
+++ b/runtime/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.
+//
+
//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
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++) {