Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Integrate gas with weight #72

Merged
merged 3 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import BN from "bn.js";

export const WSURL = "ws://127.0.0.1:9944";
export const DOT: BN = new BN("1000000000000000");
export const CREATION_FEE: BN = DOT.muln(200);
export const GAS_REQUIRED = 5000000;
export const CREATION_FEE: BN = DOT.muln(2000);
export const GAS_REQUIRED = 5000000000;
export const ALICE = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
export const BOB = "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty";
export const CHARLIE = "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y";
5 changes: 2 additions & 3 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ export async function sendAndReturnFinalized(signer: KeyringPair, tx: any) {
export async function putCode(
api: ApiPromise,
signer: KeyringPair,
fileName: string,
gasRequired: number = GAS_REQUIRED
fileName: string
): Promise<Hash> {
const wasmCode = fs
.readFileSync(path.join(__dirname, fileName))
.toString("hex");
const tx = api.tx.contracts.putCode(gasRequired, `0x${wasmCode}`);
const tx = api.tx.contracts.putCode(`0x${wasmCode}`);
const result: any = await sendAndReturnFinalized(signer, tx);
const record = result.findRecord("contracts", "CodeStored");

Expand Down
Loading