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.tsdiffbeforeafterboth1import { ApiPromise } from "@polkadot/api";2import { expect } from "chai";3import { default as usingApi, submitTransactionAsync } from "./substrate/substrate-api";4import fs from "fs";5import { Abi, BlueprintPromise, CodePromise } from "@polkadot/api-contract";6import { IKeyringPair } from "@polkadot/types/types";7import { Keyring } from "@polkadot/api";8import { ApiTypes, SubmittableExtrinsic } from "@polkadot/api/types";9import { BigNumber } from 'bignumber.js';10import { findUnusedAddress } from './util/helpers'1112const value = 0;13const gasLimit = 3000n * 1000000n;14const endowment = `1000000000000000`;1516function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise<BlueprintPromise> {17 return new Promise<BlueprintPromise>(async (resolve, reject) => {18 const unsub = await code19 .createBlueprint()20 .signAndSend(alice, (result) => {21 if (result.status.isInBlock || result.status.isFinalized) {22 // here we have an additional field in the result, containing the blueprint23 resolve(result.blueprint);24 unsub();25 }26 })27 });28}2930function deployContract(alice: IKeyringPair, blueprint: BlueprintPromise) : Promise<any> {31 return new Promise<any>(async (resolve, reject) => {32 const initValue = true;3334 const unsub = await blueprint.tx35 .new(endowment, gasLimit, initValue)36 .signAndSend(alice, (result) => {37 if (result.status.isInBlock || result.status.isFinalized) {38 unsub();39 resolve(result);40 }41 }); 42 });43}4445async function prepareDeployer(api: ApiPromise) {46 // Find unused address47 const deployer = await findUnusedAddress(api);4849 // Transfer balance to it50 const keyring = new Keyring({ type: 'sr25519' });51 const alice = keyring.addFromUri(`//Alice`);52 let amount = new BigNumber(endowment);53 amount = amount.plus(1e15);54 const tx = api.tx.balances.transfer(deployer.address, amount.toFixed());55 await submitTransactionAsync(alice, tx);5657 return deployer;58}5960describe('Contracts smoke test', () => {61 it(`Can deploy smart contract Flipper, instantiate it and call it's get and flip messages.`, async () => {62 await usingApi(async api => {63 const deployer = await prepareDeployer(api);64 65 const wasm = fs.readFileSync('./src/flipper/flipper.wasm');66 67 const metadata = JSON.parse(fs.readFileSync('./src/flipper/metadata.json').toString('utf-8'));68 const abi = new Abi(metadata);6970 const code = new CodePromise(api, abi, wasm);7172 const blueprint = await deployBlueprint(deployer, code);73 const contract = (await deployContract(deployer, blueprint))['contract'];7475 const getFlipValue = async () => {76 const result = await contract.query.get(deployer.address, value, gasLimit);7778 if(!result.result.isSuccess) {79 throw `Failed to get flipper value`;80 }81 return (result.result.asSuccess.data[0] == 0x00) ? false : true;82 }8384 const initialGetResponse = await getFlipValue();85 expect(initialGetResponse).to.be.true;8687 const flip = contract.exec('flip', value, gasLimit);88 await submitTransactionAsync(deployer, flip);8990 const afterFlipGetResponse = await getFlipValue();9192 expect(afterFlipGetResponse).to.be.false;93 });94 });9596 it.skip('Can transfer balance using smart contract.', async () => {97 await usingApi(async api => {98 // const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);99 // const wasm = fs.readFileSync('./src/balance-transfer-contract/calls.wasm');100 // const contract = compactAddLength(u8aToU8a(wasm));101102 // const metadata = JSON.parse(fs.readFileSync('./src/balance-transfer-contract/metadata.json').toString('utf-8'));103 // const abi = new Abi(api.registry as any, metadata);104105 // const alicesPrivateKey = privateKey('//Alice');106107 // const contractHash = await deployContract(api, contract, alicesPrivateKey);108109 // // const args = abi.constructors[0]();110 // const instanceAccountId = await instantiateContract(api, contractHash, /*args,*/ alicesPrivateKey);111 // const contractInstance = new ContractPromise(api, abi, instanceAccountId);112 // const bob = new GenericAccountId(api.registry, bobsPublicKey);113114 // const transfer = contractInstance.exec('balance_transfer', 0, 1000000000000n, [bob, new u128(api.registry, 1000000)]);115 // await submitTransactionAsync(alicesPrivateKey, transfer);116117 // const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);118119 // expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true;120 // expect(bobsBalanceAfter > bobsBalanceBefore).to.be.true;121 });122 })123});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 { ApiPromise } from "@polkadot/api";7import { expect } from "chai";8import { default as usingApi, submitTransactionAsync } from "./substrate/substrate-api";9import fs from "fs";10import { Abi, BlueprintPromise, CodePromise } from "@polkadot/api-contract";11import { IKeyringPair } from "@polkadot/types/types";12import { Keyring } from "@polkadot/api";13import { ApiTypes, SubmittableExtrinsic } from "@polkadot/api/types";14import { BigNumber } from 'bignumber.js';15import { findUnusedAddress } from './util/helpers'1617const value = 0;18const gasLimit = 3000n * 1000000n;19const endowment = `1000000000000000`;2021function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise<BlueprintPromise> {22 return new Promise<BlueprintPromise>(async (resolve, reject) => {23 const unsub = await code24 .createBlueprint()25 .signAndSend(alice, (result) => {26 if (result.status.isInBlock || result.status.isFinalized) {27 // here we have an additional field in the result, containing the blueprint28 resolve(result.blueprint);29 unsub();30 }31 })32 });33}3435function deployContract(alice: IKeyringPair, blueprint: BlueprintPromise) : Promise<any> {36 return new Promise<any>(async (resolve, reject) => {37 const initValue = true;3839 const unsub = await blueprint.tx40 .new(endowment, gasLimit, initValue)41 .signAndSend(alice, (result) => {42 if (result.status.isInBlock || result.status.isFinalized) {43 unsub();44 resolve(result);45 }46 }); 47 });48}4950async function prepareDeployer(api: ApiPromise) {51 // Find unused address52 const deployer = await findUnusedAddress(api);5354 // Transfer balance to it55 const keyring = new Keyring({ type: 'sr25519' });56 const alice = keyring.addFromUri(`//Alice`);57 let amount = new BigNumber(endowment);58 amount = amount.plus(1e15);59 const tx = api.tx.balances.transfer(deployer.address, amount.toFixed());60 await submitTransactionAsync(alice, tx);6162 return deployer;63}6465describe('Contracts smoke test', () => {66 it(`Can deploy smart contract Flipper, instantiate it and call it's get and flip messages.`, async () => {67 await usingApi(async api => {68 const deployer = await prepareDeployer(api);69 70 const wasm = fs.readFileSync('./src/flipper/flipper.wasm');71 72 const metadata = JSON.parse(fs.readFileSync('./src/flipper/metadata.json').toString('utf-8'));73 const abi = new Abi(metadata);7475 const code = new CodePromise(api, abi, wasm);7677 const blueprint = await deployBlueprint(deployer, code);78 const contract = (await deployContract(deployer, blueprint))['contract'];7980 const getFlipValue = async () => {81 const result = await contract.query.get(deployer.address, value, gasLimit);8283 if(!result.result.isSuccess) {84 throw `Failed to get flipper value`;85 }86 return (result.result.asSuccess.data[0] == 0x00) ? false : true;87 }8889 const initialGetResponse = await getFlipValue();90 expect(initialGetResponse).to.be.true;9192 const flip = contract.exec('flip', value, gasLimit);93 await submitTransactionAsync(deployer, flip);9495 const afterFlipGetResponse = await getFlipValue();9697 expect(afterFlipGetResponse).to.be.false;98 });99 });100101 it.skip('Can transfer balance using smart contract.', async () => {102 await usingApi(async api => {103 // const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);104 // const wasm = fs.readFileSync('./src/balance-transfer-contract/calls.wasm');105 // const contract = compactAddLength(u8aToU8a(wasm));106107 // const metadata = JSON.parse(fs.readFileSync('./src/balance-transfer-contract/metadata.json').toString('utf-8'));108 // const abi = new Abi(api.registry as any, metadata);109110 // const alicesPrivateKey = privateKey('//Alice');111112 // const contractHash = await deployContract(api, contract, alicesPrivateKey);113114 // // const args = abi.constructors[0]();115 // const instanceAccountId = await instantiateContract(api, contractHash, /*args,*/ alicesPrivateKey);116 // const contractInstance = new ContractPromise(api, abi, instanceAccountId);117 // const bob = new GenericAccountId(api.registry, bobsPublicKey);118119 // const transfer = contractInstance.exec('balance_transfer', 0, 1000000000000n, [bob, new u128(api.registry, 1000000)]);120 // await submitTransactionAsync(alicesPrivateKey, transfer);121122 // const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);123124 // expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true;125 // expect(bobsBalanceAfter > bobsBalanceBefore).to.be.true;126 });127 })128});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++) {