From 7bd1ab71752739bd6af0329a5b10f78e179f6cef Mon Sep 17 00:00:00 2001 From: kompotkot Date: Thu, 13 Jun 2024 11:01:23 +0000 Subject: [PATCH] Chain ID is int64 --- server.go | 6 +++--- sign.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server.go b/server.go index c835b28..464f829 100644 --- a/server.go +++ b/server.go @@ -52,7 +52,7 @@ type SignersResponse struct { } type SignDropperRequest struct { - ChainId int `json:"chain_id"` + ChainId int64 `json:"chain_id"` Dropper string `json:"dropper"` TtlDays int `json:"ttl_days"` Sensible bool `json:"sensible"` @@ -63,7 +63,7 @@ type SignDropperRequest struct { } type SignDropperResponse struct { - ChainId int `json:"chain_id"` + ChainId int64 `json:"chain_id"` Dropper string `json:"dropper"` TtlDays int `json:"ttl_days"` Sensible bool `json:"sensible"` @@ -471,7 +471,7 @@ func (server *Server) signDropperRoute(w http.ResponseWriter, r *http.Request, s var callRequestSpecifications []CallRequestSpecification for i, message := range req.Requests { - messageHash, hashErr := DropperClaimMessageHash(int64(req.ChainId), req.Dropper, message.DropId, message.RequestID, message.Claimant, message.BlockDeadline, message.Amount) + messageHash, hashErr := DropperClaimMessageHash(req.ChainId, req.Dropper, message.DropId, message.RequestID, message.Claimant, message.BlockDeadline, message.Amount) if hashErr != nil { http.Error(w, "Unable to generate message hash", http.StatusInternalServerError) return diff --git a/sign.go b/sign.go index 29dc322..456f440 100644 --- a/sign.go +++ b/sign.go @@ -130,7 +130,7 @@ func DropperClaimMessageHash(chainId int64, dropperAddress string, dropId, reque Domain: apitypes.TypedDataDomain{ Name: "Moonstream Dropper", Version: "0.2.0", - ChainId: (*math.HexOrDecimal256)(big.NewInt(int64(chainId))), + ChainId: (*math.HexOrDecimal256)(big.NewInt(chainId)), VerifyingContract: dropperAddress, }, Message: apitypes.TypedDataMessage{