fix: incorrect effective caller when in strict mode (#324)

This commit is contained in:
Asia
2023-01-16 13:25:03 +01:00
committed by GitHub
parent cfee1e136d
commit af46df0688
3 changed files with 8 additions and 3 deletions

View File

@@ -392,7 +392,12 @@ export class HandlerBasedContract<State> implements Contract<State> {
);
if (!this._evaluationOptions.internalWrites && strict) {
const handlerResult = await this.callContract(input, interactionTx.owner, undefined, tags, transfer, strict, vrf);
const { arweave } = this.warp;
const caller =
this.signature.type == 'arweave'
? await arweave.wallets.ownerToAddress(interactionTx.owner)
: interactionTx.owner;
const handlerResult = await this.callContract(input, caller, undefined, tags, transfer, strict, vrf);
if (handlerResult.type !== 'ok') {
throw Error(`Cannot create interaction: ${handlerResult.errorMessage}`);
}