feat: wasm contracts intergration

This commit is contained in:
ppedziwiatr
2022-02-19 00:28:21 +01:00
committed by Piotr Pędziwiatr
parent 47fb5b1c59
commit 4e38dec7f9
13 changed files with 414 additions and 48 deletions

View File

@@ -28,6 +28,8 @@ import { GQLNodeInterface, GQLTagInterface } from './gqlResult';
*
*/
export class SmartWeaveGlobal {
gasUsed: number;
gasLimit: number;
transaction: Transaction;
block: Block;
arweave: Pick<Arweave, 'ar' | 'wallets' | 'utils' | 'crypto'>;
@@ -46,7 +48,9 @@ export class SmartWeaveGlobal {
_activeTx?: GQLNodeInterface;
constructor(arweave: Arweave, contract: { id: string; owner: string }) {
constructor(arweave: Arweave, contract: { id: string; owner: string }, gasLimit = Number.MAX_SAFE_INTEGER) {
this.gasUsed = 0;
this.gasLimit = gasLimit;
this.unsafeClient = arweave;
this.arweave = {
ar: arweave.ar,