difftreelog
NFTPAR-94: SIT: Balances can be transferred using smart contract.
in: master
18 files changed
tests/ink-types-node-runtime/.gitignorediffbeforeafterbothno changes
tests/ink-types-node-runtime/Cargo.tomldiffbeforeafterbothno changes
tests/ink-types-node-runtime/LICENSEdiffbeforeafterbothno changes
tests/ink-types-node-runtime/README.mddiffbeforeafterbothno changes
tests/ink-types-node-runtime/examples/calls/.gitignorediffbeforeafterbothno changes
tests/ink-types-node-runtime/examples/calls/.ink/abi_gen/Cargo.tomldiffbeforeafterbothno changes
tests/ink-types-node-runtime/examples/calls/.ink/abi_gen/main.rsdiffbeforeafterbothno changes
tests/ink-types-node-runtime/examples/calls/Cargo.tomldiffbeforeafterbothno changes
tests/ink-types-node-runtime/examples/calls/lib.rsdiffbeforeafterbothno changes
tests/ink-types-node-runtime/src/calls.rsdiffbeforeafterbothno changes
tests/ink-types-node-runtime/src/lib.rsdiffbeforeafterbothno changes
tests/src/balance-transfer-contract/calls.wasmdiffbeforeafterbothbinary blob — no preview
tests/src/balance-transfer-contract/metadata.jsondiffbeforeafterbothno changes
tests/src/contracts.test.tsdiffbeforeafterbothno changes
tests/src/deploy-flipper.test.tsdiffbeforeafterbothno changes
tests/src/substrate/get-balance.tsdiffbeforeafterbothno changes
tests/src/substrate/privateKey.tsdiffbeforeafterboth1import { Keyring } from "@polkadot/api";1import { Keyring } from "@polkadot/api";2import { IKeyringPair } from "@polkadot/types/types";233export default function privateKey(account: string) {4export default function privateKey(account: string): IKeyringPair {4 const keyring = new Keyring({ type: 'sr25519' });5 const keyring = new Keyring({ type: 'sr25519' });5 6 6 return keyring.addFromUri(account);7 return keyring.addFromUri(account);tests/src/transfer.test.tsdiffbeforeafterboth1import createSubstrateApi from "./substrate/substrate-api";2import { Keyring, ApiPromise } from "@polkadot/api";3import {AccountInfo} from "@polkadot/types/interfaces/system";4import { expect } from "chai";1import { expect } from "chai";5import usingApi from "./substrate/substrate-api";2import usingApi from "./substrate/substrate-api";6import promisifySubstrate from "./substrate/promisify-substrate";3import promisifySubstrate from "./substrate/promisify-substrate";7import waitNewBlocks from "./substrate/wait-new-blocks";4import waitNewBlocks from "./substrate/wait-new-blocks";8import { alicesPublicKey, bobsPublicKey } from "./accounts";5import { alicesPublicKey, bobsPublicKey } from "./accounts";9import privateKey from "./substrate/privateKey";6import privateKey from "./substrate/privateKey";1011async function getBalance(api: ApiPromise, accounts: string[]): Promise<bigint[]> {7import getBalance from "./substrate/get-balance";12 const balance = promisifySubstrate(api, (accounts: string[]) => api.query.system.account.multi(accounts));13 const responce = await balance(accounts) as unknown as AccountInfo[];14 return responce.map(r => r.data.free.toBigInt().valueOf());15}16817describe('Transfer', () => {9describe('Transfer', () => {18 it('Balance transfers', async () => {10 it('Balance transfers', async () => {