-
Notifications
You must be signed in to change notification settings - Fork 160
Conversation
LGTM given the ToInt lint fix from the type change (can just remove the ToInt function) |
x/evm/querier.go
Outdated
} | ||
|
||
return res, nil | ||
} | ||
|
||
func queryBlockNumber(ctx sdk.Context, keeper Keeper) ([]byte, sdk.Error) { | ||
num := ctx.BlockHeight() | ||
bnRes := types.QueryResBlockNumber{Number: big.NewInt(num)} | ||
res, err := codec.MarshalJSONIndent(keeper.cdc, bnRes) | ||
hexBig := hexutil.Uint64(num) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpick but confusing name since it's a hexutil uint. Also, the type that is being received on the RPC api is just a uint64, reason for marshalling it as this type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see hexutil.Uint64
all the way through: https://github.com/ChainSafe/ethermint/blob/9812df303517a9324710585cbabbba196f066bd7/rpc/eth_api.go#L91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, my bad actually (was looking at old type I think), if you do another commit though to change hexBig to hexUint or something more accurate would be great, but fine with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small detail I just want to be sure about
This updates the return types for the eth_ API and simplifies the types used in queries.
hexutil
), as the API is very specific about formatting.