@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "warp-contracts",
|
"name": "warp-contracts",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "An implementation of the SmartWeave smart contract protocol.",
|
"description": "An implementation of the SmartWeave smart contract protocol.",
|
||||||
"main": "./lib/cjs/index.js",
|
"main": "./lib/cjs/index.js",
|
||||||
"module": "./lib/esm/index.js",
|
"module": "./lib/esm/index.js",
|
||||||
|
|||||||
@@ -90,14 +90,8 @@ describe('Testing internal writes', () => {
|
|||||||
src: stakingContractSrc
|
src: stakingContractSrc
|
||||||
});
|
});
|
||||||
|
|
||||||
tokenContract = warp
|
tokenContract = warp.contract(tokenContractTxId).setEvaluationOptions({ internalWrites: true }).connect(wallet);
|
||||||
.contract(tokenContractTxId)
|
stakingContract = warp.contract(stakingContractTxId).setEvaluationOptions({ internalWrites: true }).connect(wallet);
|
||||||
.setEvaluationOptions({ internalWrites: true })
|
|
||||||
.connect(wallet);
|
|
||||||
stakingContract = warp
|
|
||||||
.contract(stakingContractTxId)
|
|
||||||
.setEvaluationOptions({ internalWrites: true })
|
|
||||||
.connect(wallet);
|
|
||||||
|
|
||||||
await mineBlock(arweave);
|
await mineBlock(arweave);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,11 +190,7 @@ export class WasmContractHandlerApi<State> implements HandlerApi<State> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { stateEvaluator } = executionContext.warp;
|
const { stateEvaluator } = executionContext.warp;
|
||||||
const childContract = executionContext.warp.contract(
|
const childContract = executionContext.warp.contract(contractTxId, executionContext.contract, interactionTx);
|
||||||
contractTxId,
|
|
||||||
executionContext.contract,
|
|
||||||
interactionTx
|
|
||||||
);
|
|
||||||
|
|
||||||
await stateEvaluator.onContractCall(interactionTx, executionContext, currentResult);
|
await stateEvaluator.onContractCall(interactionTx, executionContext, currentResult);
|
||||||
|
|
||||||
@@ -244,14 +240,10 @@ export class WasmContractHandlerApi<State> implements HandlerApi<State> {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
this.logger.debug('Cache result?:', !this.swGlobal._activeTx.dry);
|
this.logger.debug('Cache result?:', !this.swGlobal._activeTx.dry);
|
||||||
await executionContext.warp.stateEvaluator.onInternalWriteStateUpdate(
|
await executionContext.warp.stateEvaluator.onInternalWriteStateUpdate(this.swGlobal._activeTx, contractTxId, {
|
||||||
this.swGlobal._activeTx,
|
state: result.state as State,
|
||||||
contractTxId,
|
validity: {}
|
||||||
{
|
});
|
||||||
state: result.state as State,
|
|
||||||
validity: {}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user