Skip to content

Commit

Permalink
Showing 6 changed files with 12 additions and 11 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/interactions.ts → src/contract-interact.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import Arweave from 'arweave/node'
import { JWKInterface } from 'arweave/node/lib/wallet'
import { getContract } from './get-contract'
import { replayToState } from './replay-contract'
import { execute } from './execute'
import { getContract } from './contract-load'
import { replayToState } from './contract-replay'
import { execute } from './contract-step'

/**
* Writes an interaction on the blockchain.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/replay-contract.ts → src/contract-replay.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Arweave from 'arweave/node'
import Transaction from 'arweave/node/lib/transaction';
import { getContract } from './get-contract';
import { getContract } from './contract-load';
import { retryWithBackoff, batch, softFailWith } from 'promises-tho';
import { getTag, arrayToHex } from './utils';
import { execute } from './execute';
import { execute } from './contract-step';
import { TransactionStatusResponse } from 'arweave/node/transactions';

interface FullTxInfo {
5 changes: 3 additions & 2 deletions src/execute.ts → src/contract-step.ts
Original file line number Diff line number Diff line change
@@ -25,10 +25,11 @@ export async function execute(contractSrc: string, input: object, state: object,
try {
eval(contractSrc)
} catch (err) {
console.error(err);
console.error(err)
return false
}

// Return the modified state
return state
}
}

8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createContract, createContractFromTx } from "./create-contract";
import { getContract } from "./get-contract";
import { interactWrite, interactWriteDryRun } from "./interactions";
import { replayToState } from "./replay-contract";
import { createContract, createContractFromTx } from "./contract-create";
import { getContract } from "./contract-load";
import { interactWrite, interactWriteDryRun } from "./contract-interact";
import { replayToState } from "./contract-replay";

export {
createContract,

0 comments on commit 23acc7c

Please sign in to comment.