fix: ETH caller is set incorrectly when in strict mode

This commit is contained in:
Asia
2023-09-25 15:05:58 +02:00
committed by just_ppe
parent b123ee04f3
commit 276b43d04b

View File

@@ -456,7 +456,10 @@ export class HandlerBasedContract<State> implements Contract<State> {
vrf: boolean vrf: boolean
) { ) {
const { arweave } = this.warp; const { arweave } = this.warp;
const caller = this._signature.type == 'arweave' ? await arweave.wallets.ownerToAddress(owner) : owner; const caller =
this._signature.type == 'arweave'
? await arweave.wallets.ownerToAddress(owner)
: await this._signature.getAddress();
const handlerResult = await this.callContract(input, 'write', caller, undefined, tags, transfer, strict, vrf); const handlerResult = await this.callContract(input, 'write', caller, undefined, tags, transfer, strict, vrf);
if (handlerResult.type !== 'ok') { if (handlerResult.type !== 'ok') {
throw Error('Cannot create interaction: ' + JSON.stringify(handlerResult.error || handlerResult.errorMessage)); throw Error('Cannot create interaction: ' + JSON.stringify(handlerResult.error || handlerResult.errorMessage));