Skip to content

Commit e453685

Browse files
committed
use internal userop context to avoid confusion about initcode
1 parent c27925c commit e453685

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/helpers/erc4337.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ class ERC7702SmartAccount extends SmartAccount {
8989
class UserOperationWithContext extends UserOperation {
9090
constructor(params) {
9191
super(params);
92-
this.initCode = params.sender?.initCode;
93-
this.chainId = params.sender?.chainId;
92+
this._initCode = params.sender?.initCode;
93+
this._chainId = params.sender?.chainId;
9494
}
9595

9696
addInitCode() {
97-
if (!this.initCode) throw new Error('No init code available for the sender of this user operation');
98-
return Object.assign(this, parseInitCode(this.initCode));
97+
if (!this._initCode) throw new Error('No init code available for the sender of this user operation');
98+
return Object.assign(this, parseInitCode(this._initCode));
9999
}
100100

101101
hash() {
102-
return super.hash(entrypoint, this.chainId);
102+
return super.hash(entrypoint, this._chainId);
103103
}
104104
}
105105

0 commit comments

Comments
 (0)