difftreelog
Update license information
in: master
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.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.tsdiffbeforeafterboth1import chai from 'chai';2import chaiAsPromised from 'chai-as-promised';3import type { AccountId, EventRecord } from '@polkadot/types/interfaces';4import { ApiPromise, Keyring } from "@polkadot/api";5import { default as usingApi, submitTransactionAsync } from "../substrate/substrate-api";6import privateKey from '../substrate/privateKey';7import { alicesPublicKey } from "../accounts";8import { strToUTF16, utf16ToStr, hexToStr } from '../util/util';9import { IKeyringPair } from "@polkadot/types/types";10import { BigNumber } from 'bignumber.js';1112chai.use(chaiAsPromised);13const expect = chai.expect;1415type GenericResult = {16 success: boolean,17};1819type CreateCollectionResult = {20 success: boolean,21 collectionId: number22};2324export function getGenericResult(events: EventRecord[]): GenericResult {25 let result: GenericResult = {26 success: false27 }28 events.forEach(({ phase, event: { data, method, section } }) => {29 // console.log(` ${phase}: ${section}.${method}:: ${data}`);30 if (method == 'ExtrinsicSuccess') {31 result.success = true;32 }33 });34 return result;35}3637function getCreateCollectionResult(events: EventRecord[]): CreateCollectionResult {38 let success = false;39 let collectionId: number = 0;40 events.forEach(({ phase, event: { data, method, section } }) => {41 // console.log(` ${phase}: ${section}.${method}:: ${data}`);42 if (method == 'ExtrinsicSuccess') {43 success = true;44 } else if ((section == 'nft') && (method == 'Created')) {45 collectionId = parseInt(data[0].toString());46 }47 });48 let result: CreateCollectionResult = {49 success,50 collectionId51 }52 return result;53}5455export async function createCollectionExpectSuccess(name: string, description: string, tokenPrefix: string, mode: string) {56 await usingApi(async (api) => {57 // Get number of collections before the transaction58 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());5960 // Run the CreateCollection transaction61 const alicePrivateKey = privateKey('//Alice');62 const tx = api.tx.nft.createCollection(strToUTF16(name), strToUTF16(description), strToUTF16(tokenPrefix), mode);63 const events = await submitTransactionAsync(alicePrivateKey, tx);64 const result = getCreateCollectionResult(events);6566 // Get number of collections after the transaction67 const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());6869 // Get the collection 70 const collection: any = (await api.query.nft.collection(result.collectionId)).toJSON();7172 // What to expect73 expect(result.success).to.be.true;74 expect(result.collectionId).to.be.equal(BcollectionCount);75 expect(collection).to.be.not.null;76 expect(BcollectionCount).to.be.equal(AcollectionCount+1, 'Error: NFT collection NOT created.');77 expect(collection.Owner).to.be.equal(alicesPublicKey);78 expect(utf16ToStr(collection.Name)).to.be.equal(name);79 expect(utf16ToStr(collection.Description)).to.be.equal(description);80 expect(hexToStr(collection.TokenPrefix)).to.be.equal(tokenPrefix);81 });82}83 84export async function createCollectionExpectFailure(name: string, description: string, tokenPrefix: string, mode: string) {85 await usingApi(async (api) => {86 // Get number of collections before the transaction87 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());8889 // Run the CreateCollection transaction90 const alicePrivateKey = privateKey('//Alice');91 const tx = api.tx.nft.createCollection(name, description, tokenPrefix, mode);92 const events = await submitTransactionAsync(alicePrivateKey, tx);93 const result = getCreateCollectionResult(events);9495 // Get number of collections after the transaction96 const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());9798 // What to expect99 expect(result.success).to.be.false;100 expect(BcollectionCount).to.be.equal(AcollectionCount, 'Error: Collection with incorrect data created.');101 });102}103 104export async function findUnusedAddress(api: ApiPromise): Promise<IKeyringPair> {105 let bal = new BigNumber(0);106 let unused;107 do {108 const randomSeed = 'seed' + Math.floor(Math.random() * Math.floor(10000));109 const keyring = new Keyring({ type: 'sr25519' });110 unused = keyring.addFromUri(`//${randomSeed}`);111 bal = new BigNumber((await api.query.system.account(unused.address)).data.free.toString());112 } while (bal.toFixed() != '0');113 return unused; 114}1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56import chai from 'chai';7import chaiAsPromised from 'chai-as-promised';8import type { AccountId, EventRecord } from '@polkadot/types/interfaces';9import { ApiPromise, Keyring } from "@polkadot/api";10import { default as usingApi, submitTransactionAsync } from "../substrate/substrate-api";11import privateKey from '../substrate/privateKey';12import { alicesPublicKey } from "../accounts";13import { strToUTF16, utf16ToStr, hexToStr } from '../util/util';14import { IKeyringPair } from "@polkadot/types/types";15import { BigNumber } from 'bignumber.js';1617chai.use(chaiAsPromised);18const expect = chai.expect;1920type GenericResult = {21 success: boolean,22};2324type CreateCollectionResult = {25 success: boolean,26 collectionId: number27};2829export function getGenericResult(events: EventRecord[]): GenericResult {30 let result: GenericResult = {31 success: false32 }33 events.forEach(({ phase, event: { data, method, section } }) => {34 // console.log(` ${phase}: ${section}.${method}:: ${data}`);35 if (method == 'ExtrinsicSuccess') {36 result.success = true;37 }38 });39 return result;40}4142function getCreateCollectionResult(events: EventRecord[]): CreateCollectionResult {43 let success = false;44 let collectionId: number = 0;45 events.forEach(({ phase, event: { data, method, section } }) => {46 // console.log(` ${phase}: ${section}.${method}:: ${data}`);47 if (method == 'ExtrinsicSuccess') {48 success = true;49 } else if ((section == 'nft') && (method == 'Created')) {50 collectionId = parseInt(data[0].toString());51 }52 });53 let result: CreateCollectionResult = {54 success,55 collectionId56 }57 return result;58}5960export async function createCollectionExpectSuccess(name: string, description: string, tokenPrefix: string, mode: string) {61 await usingApi(async (api) => {62 // Get number of collections before the transaction63 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());6465 // Run the CreateCollection transaction66 const alicePrivateKey = privateKey('//Alice');67 const tx = api.tx.nft.createCollection(strToUTF16(name), strToUTF16(description), strToUTF16(tokenPrefix), mode);68 const events = await submitTransactionAsync(alicePrivateKey, tx);69 const result = getCreateCollectionResult(events);7071 // Get number of collections after the transaction72 const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());7374 // Get the collection 75 const collection: any = (await api.query.nft.collection(result.collectionId)).toJSON();7677 // What to expect78 expect(result.success).to.be.true;79 expect(result.collectionId).to.be.equal(BcollectionCount);80 expect(collection).to.be.not.null;81 expect(BcollectionCount).to.be.equal(AcollectionCount+1, 'Error: NFT collection NOT created.');82 expect(collection.Owner).to.be.equal(alicesPublicKey);83 expect(utf16ToStr(collection.Name)).to.be.equal(name);84 expect(utf16ToStr(collection.Description)).to.be.equal(description);85 expect(hexToStr(collection.TokenPrefix)).to.be.equal(tokenPrefix);86 });87}88 89export async function createCollectionExpectFailure(name: string, description: string, tokenPrefix: string, mode: string) {90 await usingApi(async (api) => {91 // Get number of collections before the transaction92 const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());9394 // Run the CreateCollection transaction95 const alicePrivateKey = privateKey('//Alice');96 const tx = api.tx.nft.createCollection(name, description, tokenPrefix, mode);97 const events = await submitTransactionAsync(alicePrivateKey, tx);98 const result = getCreateCollectionResult(events);99100 // Get number of collections after the transaction101 const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());102103 // What to expect104 expect(result.success).to.be.false;105 expect(BcollectionCount).to.be.equal(AcollectionCount, 'Error: Collection with incorrect data created.');106 });107}108 109export async function findUnusedAddress(api: ApiPromise): Promise<IKeyringPair> {110 let bal = new BigNumber(0);111 let unused;112 do {113 const randomSeed = 'seed' + Math.floor(Math.random() * Math.floor(10000));114 const keyring = new Keyring({ type: 'sr25519' });115 unused = keyring.addFromUri(`//${randomSeed}`);116 bal = new BigNumber((await api.query.system.account(unused.address)).data.free.toString());117 } while (bal.toFixed() != '0');118 return unused; 119}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++) {