Skip to content

Commit

Permalink
Merge pull request #36 from moonstream-to/chain-id-int64
Browse files Browse the repository at this point in the history
Chain ID is int64
  • Loading branch information
kompotkot authored Jun 13, 2024
2 parents eed0b4a + 7bd1ab7 commit c3b3f6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit c3b3f6a

Please sign in to comment.