forked from cerc-io/laconicd-deprecated
get account sequence in GetTransactionCount (#303)
* get account sequence if querying latest in GetTransactionCount * use ctx WithHeight in GetTransactionCount; remove nonce query from querier
This commit is contained in:
@@ -32,8 +32,6 @@ func NewQuerier(keeper Keeper) sdk.Querier {
|
||||
return queryStorage(ctx, path, keeper)
|
||||
case types.QueryCode:
|
||||
return queryCode(ctx, path, keeper)
|
||||
case types.QueryNonce:
|
||||
return queryNonce(ctx, path, keeper)
|
||||
case types.QueryHashToHeight:
|
||||
return queryHashToHeight(ctx, path, keeper)
|
||||
case types.QueryTransactionLogs:
|
||||
@@ -113,18 +111,6 @@ func queryCode(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) {
|
||||
return bz, nil
|
||||
}
|
||||
|
||||
func queryNonce(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) {
|
||||
addr := ethcmn.HexToAddress(path[1])
|
||||
nonce := keeper.GetNonce(ctx, addr)
|
||||
nRes := types.QueryResNonce{Nonce: nonce}
|
||||
bz, err := codec.MarshalJSONIndent(keeper.cdc, nRes)
|
||||
if err != nil {
|
||||
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
|
||||
}
|
||||
|
||||
return bz, nil
|
||||
}
|
||||
|
||||
func queryHashToHeight(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) {
|
||||
blockHash := ethcmn.FromHex(path[1])
|
||||
blockNumber, err := keeper.GetBlockHashMapping(ctx, blockHash)
|
||||
|
||||
@@ -24,7 +24,6 @@ func (suite *KeeperTestSuite) TestQuerier() {
|
||||
{"block number", []string{types.QueryBlockNumber, "0x0"}, func() {}, true},
|
||||
{"storage", []string{types.QueryStorage, "0x0", "0x0"}, func() {}, true},
|
||||
{"code", []string{types.QueryCode, "0x0"}, func() {}, true},
|
||||
{"nonce", []string{types.QueryNonce, "0x0"}, func() {}, true},
|
||||
// {"hash to height", []string{types.QueryHashToHeight, "0x0"}, func() {}, true},
|
||||
{"tx logs", []string{types.QueryTransactionLogs, "0x0"}, func() {}, true},
|
||||
// {"logs bloom", []string{types.QueryLogsBloom, "0x0"}, func() {}, true},
|
||||
|
||||
Reference in New Issue
Block a user