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.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.tsdiffbeforeafterboth1import chai from 'chai';2import chaiAsPromised from 'chai-as-promised';3import { default as usingApi, submitTransactionAsync } from "./substrate/substrate-api";4import { alicesPublicKey, bobsPublicKey } from "./accounts";5import privateKey from "./substrate/privateKey";6import { BigNumber } from 'bignumber.js';7import { createCollectionExpectSuccess, getGenericResult } from './util/helpers';89chai.use(chaiAsPromised);10const expect = chai.expect;1112const Treasury = "5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z";13const saneMinimumFee = 0.0001;14const saneMaximumFee = 0.01;1516describe('integration test: Fees must be credited to Treasury:', () => {17 it('Total issuance does not change', async () => {18 await usingApi(async (api) => {19 const totalBefore = new BigNumber((await api.query.balances.totalIssuance()).toString());2021 const alicePrivateKey = privateKey('//Alice');22 const amount = new BigNumber(1);23 const transfer = api.tx.balances.transfer(bobsPublicKey, amount.toFixed());2425 const result = getGenericResult(await submitTransactionAsync(alicePrivateKey, transfer));2627 const totalAfter = new BigNumber((await api.query.balances.totalIssuance()).toString());2829 expect(result.success).to.be.true;30 expect(totalAfter.toFixed()).to.be.equal(totalBefore.toFixed());31 });32 });3334 it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {35 await usingApi(async (api) => {36 const alicePrivateKey = privateKey('//Alice');37 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());38 const aliceBalanceBefore = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());3940 const amount = new BigNumber(1);41 const transfer = api.tx.balances.transfer(bobsPublicKey, amount.toFixed());42 const result = getGenericResult(await submitTransactionAsync(alicePrivateKey, transfer));4344 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());45 const aliceBalanceAfter = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());46 const fee = aliceBalanceBefore.minus(aliceBalanceAfter).minus(amount);47 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);4849 expect(result.success).to.be.true;50 expect(treasuryIncrease.toFixed()).to.be.equal(fee.toFixed());51 });52 });5354 it('Treasury balance increased by failed tx fee', async () => {55 await usingApi(async (api) => {56 const bobPrivateKey = privateKey('//Bob');57 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());58 const bobBalanceBefore = new BigNumber((await api.query.system.account(bobsPublicKey)).data.free.toString());5960 const badTx = api.tx.balances.setBalance(alicesPublicKey, 0, 0);61 const result = getGenericResult(await submitTransactionAsync(bobPrivateKey, badTx));6263 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());64 const bobBalanceAfter = new BigNumber((await api.query.system.account(bobsPublicKey)).data.free.toString());65 const fee = bobBalanceBefore.minus(bobBalanceAfter);66 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);6768 expect(result.success).to.be.false;69 expect(treasuryIncrease.toFixed()).to.be.equal(fee.toFixed());70 });71 });7273 it('NFT Transactions also send fees to Treasury', async () => {74 await usingApi(async (api) => {75 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());76 const aliceBalanceBefore = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());7778 await createCollectionExpectSuccess('A', 'B', 'C', 'NFT');7980 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());81 const aliceBalanceAfter = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());82 const fee = aliceBalanceBefore.minus(aliceBalanceAfter);83 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);8485 expect(treasuryIncrease.toFixed()).to.be.equal(fee.toFixed());86 });87 });8889 it('Fees are sane', async () => {90 await usingApi(async (api) => {91 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());92 const aliceBalanceBefore = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());9394 await createCollectionExpectSuccess('A', 'B', 'C', 'NFT');9596 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());97 const aliceBalanceAfter = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());98 const fee = aliceBalanceBefore.minus(aliceBalanceAfter);99 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);100101 expect(fee.dividedBy(1e15).toNumber()).to.be.lessThan(0.01);102 expect(fee.dividedBy(1e15).toNumber()).to.be.greaterThan(0.0001);103 });104 });105106});1071//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 { default as usingApi, submitTransactionAsync } from "./substrate/substrate-api";9import { alicesPublicKey, bobsPublicKey } from "./accounts";10import privateKey from "./substrate/privateKey";11import { BigNumber } from 'bignumber.js';12import { createCollectionExpectSuccess, getGenericResult } from './util/helpers';1314chai.use(chaiAsPromised);15const expect = chai.expect;1617const Treasury = "5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z";18const saneMinimumFee = 0.0001;19const saneMaximumFee = 0.01;2021describe('integration test: Fees must be credited to Treasury:', () => {22 it('Total issuance does not change', async () => {23 await usingApi(async (api) => {24 const totalBefore = new BigNumber((await api.query.balances.totalIssuance()).toString());2526 const alicePrivateKey = privateKey('//Alice');27 const amount = new BigNumber(1);28 const transfer = api.tx.balances.transfer(bobsPublicKey, amount.toFixed());2930 const result = getGenericResult(await submitTransactionAsync(alicePrivateKey, transfer));3132 const totalAfter = new BigNumber((await api.query.balances.totalIssuance()).toString());3334 expect(result.success).to.be.true;35 expect(totalAfter.toFixed()).to.be.equal(totalBefore.toFixed());36 });37 });3839 it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {40 await usingApi(async (api) => {41 const alicePrivateKey = privateKey('//Alice');42 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());43 const aliceBalanceBefore = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());4445 const amount = new BigNumber(1);46 const transfer = api.tx.balances.transfer(bobsPublicKey, amount.toFixed());47 const result = getGenericResult(await submitTransactionAsync(alicePrivateKey, transfer));4849 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());50 const aliceBalanceAfter = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());51 const fee = aliceBalanceBefore.minus(aliceBalanceAfter).minus(amount);52 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);5354 expect(result.success).to.be.true;55 expect(treasuryIncrease.toFixed()).to.be.equal(fee.toFixed());56 });57 });5859 it('Treasury balance increased by failed tx fee', async () => {60 await usingApi(async (api) => {61 const bobPrivateKey = privateKey('//Bob');62 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());63 const bobBalanceBefore = new BigNumber((await api.query.system.account(bobsPublicKey)).data.free.toString());6465 const badTx = api.tx.balances.setBalance(alicesPublicKey, 0, 0);66 const result = getGenericResult(await submitTransactionAsync(bobPrivateKey, badTx));6768 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());69 const bobBalanceAfter = new BigNumber((await api.query.system.account(bobsPublicKey)).data.free.toString());70 const fee = bobBalanceBefore.minus(bobBalanceAfter);71 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);7273 expect(result.success).to.be.false;74 expect(treasuryIncrease.toFixed()).to.be.equal(fee.toFixed());75 });76 });7778 it('NFT Transactions also send fees to Treasury', async () => {79 await usingApi(async (api) => {80 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());81 const aliceBalanceBefore = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());8283 await createCollectionExpectSuccess('A', 'B', 'C', 'NFT');8485 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());86 const aliceBalanceAfter = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());87 const fee = aliceBalanceBefore.minus(aliceBalanceAfter);88 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);8990 expect(treasuryIncrease.toFixed()).to.be.equal(fee.toFixed());91 });92 });9394 it('Fees are sane', async () => {95 await usingApi(async (api) => {96 const treasuryBalanceBefore = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());97 const aliceBalanceBefore = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());9899 await createCollectionExpectSuccess('A', 'B', 'C', 'NFT');100101 const treasuryBalanceAfter = new BigNumber((await api.query.system.account(Treasury)).data.free.toString());102 const aliceBalanceAfter = new BigNumber((await api.query.system.account(alicesPublicKey)).data.free.toString());103 const fee = aliceBalanceBefore.minus(aliceBalanceAfter);104 const treasuryIncrease = treasuryBalanceAfter.minus(treasuryBalanceBefore);105106 expect(fee.dividedBy(1e15).toNumber()).to.be.lessThan(0.01);107 expect(fee.dividedBy(1e15).toNumber()).to.be.greaterThan(0.0001);108 });109 });110111});112tests/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++) {