feat(): fix ContractInteractionsLoader to ArweaveGatewayInteractionsL… (#65)

fix: ContractInteractionsLoader to ArweaveGatewayInteractionsLoader in tools
This commit is contained in:
Sandy
2021-12-23 22:29:48 +08:00
committed by GitHub
parent 7caa40ff0d
commit c43ded5d94
2 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
/* eslint-disable */
import {
ContractInteractionsLoader,
ArweaveGatewayInteractionsLoader, DefaultEvaluationOptions,
GQLEdgeInterface,
GQLResultInterface,
GQLTransactionsResultInterface,
@@ -83,9 +83,9 @@ async function main() {
LoggerFactory.use(new TsLogFactory());
LoggerFactory.INST.logLevel('info');
LoggerFactory.INST.logLevel('debug', 'ContractInteractionsLoader');
LoggerFactory.INST.logLevel('debug', 'ArweaveGatewayInteractionsLoader');
const transactionsLoader = new ContractInteractionsLoader(arweave);
const transactionsLoader = new ArweaveGatewayInteractionsLoader(arweave);
let totalInteractions = 0;
// loading
@@ -110,6 +110,7 @@ async function main() {
console.log(
`\n[${contractTxs.indexOf(contractTx) + 1} / ${contractTxs.length}] loading interactions of the ${contractTxId}`
);
const evaluationOptions =new DefaultEvaluationOptions();
const interactions = await transactionsLoader.load(contractTxId, 0, 779826, evaluationOptions);
console.log(`${contractTxId}: ${interactions.length}`);

View File

@@ -4,7 +4,7 @@ import { LoggerFactory } from '../src';
import { TsLogFactory } from '../src/logging/node/TsLogFactory';
import fs from 'fs';
import path from 'path';
import { ContractInteractionsLoader } from '../src/core/modules/impl/ContractInteractionsLoader';
import { ArweaveGatewayInteractionsLoader } from '../src/core/modules/impl/ArweaveGatewayInteractionsLoader';
import { DefaultEvaluationOptions } from '../src/core/modules/StateEvaluator';
import {GQLEdgeInterface, GQLTagInterface} from "smartweave/lib/interfaces/gqlResult";
@@ -21,7 +21,7 @@ async function main() {
logging: false // Enable network request logging
});
const transactionsLoader = new ContractInteractionsLoader(arweave);
const transactionsLoader = new ArweaveGatewayInteractionsLoader(arweave);
const result = await transactionsLoader.load(
'Ym2i1XWBAuabbw0qcmSSsmjGtBJbJlDLDxxf277XtK8',