Skip to content

Commit

Permalink
changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
aanand1 committed Sep 5, 2024
1 parent 33acf9a commit 85e0cd9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions types/user_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,14 @@ type UserOperationPartialRaw struct {
From common.Address `json:"from,omitempty"`
}

func NewUserOperationPartialRaw(chainId *big.Int, userOpHash common.Hash, userOp *UserOperation, hints []common.Address) *UserOperationPartialRaw {
func NewUserOperationPartialRaw(chainId uint64, userOp *UserOperation, hints []common.Address) (*UserOperationPartialRaw, error) {
userOpHash, err := userOp.Hash(utils.FlagTrustedOpHash(userOp.CallConfig), chainId)
if err != nil {
return nil, err
}

userOpPartial := &UserOperationPartialRaw{
ChainId: (*hexutil.Big)(chainId),
ChainId: (*hexutil.Big)(big.NewInt(int64(chainId))),
UserOpHash: userOpHash,
To: userOp.To,
Gas: (*hexutil.Big)(userOp.Gas),
Expand All @@ -286,7 +291,7 @@ func NewUserOperationPartialRaw(chainId *big.Int, userOpHash common.Hash, userOp
userOpPartial.Value = (*hexutil.Big)(userOp.Value)
}

return userOpPartial
return userOpPartial, nil
}

type UserOperationWithHintsRaw struct {
Expand Down

0 comments on commit 85e0cd9

Please sign in to comment.