Skip to content

Commit 7b8cbbd

Browse files
committed
feat: Set chain-id in Intent
1 parent dd6994f commit 7b8cbbd

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

pkg/modules/solution/solveintents.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ func (ei *IntentsHandler) bufferIntentOps(entrypoint common.Address, chainID *bi
6565
}
6666
for idx, op := range userOpBatch {
6767
if op.HasIntent() {
68+
intent, err := op.GetIntent()
69+
if err != nil {
70+
// invalid Intent: drop the UserOperation from the batch
71+
continue
72+
}
73+
74+
intent.ChainID = chainID
75+
76+
marshalledIntent, err := json.Marshal(intent)
77+
if err != nil {
78+
// corrupted intent: drop the UserOperation from the batch
79+
continue
80+
}
81+
op.SetIntent(string(marshalledIntent))
82+
6883
hashID := op.GetUserOpHash(entrypoint, chainID).String()
6984

7085
// Don't mutate the original op

0 commit comments

Comments
 (0)