Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
change request variable name and type
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-nguy committed Jun 22, 2021
1 parent ed935b6 commit 1abe5bc
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 96 deletions.
6 changes: 3 additions & 3 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ QueryValidatorAccountRequest is the request type for the Query/ValidatorAccount

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `val_address` | [string](#string) | | val_address is the validator hex address to query the account for. |
| `cons_address` | [string](#string) | | val_address is the validator hex address to query the account for. |



Expand All @@ -730,7 +730,7 @@ QueryValidatorAccountResponse is the response type for the Query/ValidatorAccoun

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `account_address` | [string](#string) | | account_address is the cosmos address of the account. |
| `account_address` | [string](#string) | | account_address is the cosmos address of the account in bech32 format. |
| `sequence` | [uint64](#uint64) | | sequence is the account's sequence number. |
| `account_number` | [uint64](#uint64) | | account_number is the account number |

Expand All @@ -754,7 +754,7 @@ Query defines the gRPC querier service.
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Account` | [QueryAccountRequest](#ethermint.evm.v1alpha1.QueryAccountRequest) | [QueryAccountResponse](#ethermint.evm.v1alpha1.QueryAccountResponse) | Account queries an Ethereum account. | GET|/ethermint/evm/v1alpha1/account/{address}|
| `CosmosAccount` | [QueryCosmosAccountRequest](#ethermint.evm.v1alpha1.QueryCosmosAccountRequest) | [QueryCosmosAccountResponse](#ethermint.evm.v1alpha1.QueryCosmosAccountResponse) | Account queries an Ethereum account's Cosmos Address. | GET|/ethermint/evm/v1alpha1/cosmos_account/{address}|
| `ValidatorAccount` | [QueryValidatorAccountRequest](#ethermint.evm.v1alpha1.QueryValidatorAccountRequest) | [QueryValidatorAccountResponse](#ethermint.evm.v1alpha1.QueryValidatorAccountResponse) | Account queries an Validator Cosmos Address. | GET|/ethermint/evm/v1alpha1/validator_account/{val_address}|
| `ValidatorAccount` | [QueryValidatorAccountRequest](#ethermint.evm.v1alpha1.QueryValidatorAccountRequest) | [QueryValidatorAccountResponse](#ethermint.evm.v1alpha1.QueryValidatorAccountResponse) | Account queries an Validator Cosmos Address. | GET|/ethermint/evm/v1alpha1/validator_account/{cons_address}|
| `Balance` | [QueryBalanceRequest](#ethermint.evm.v1alpha1.QueryBalanceRequest) | [QueryBalanceResponse](#ethermint.evm.v1alpha1.QueryBalanceResponse) | Balance queries the balance of a the EVM denomination for a single EthAccount. | GET|/ethermint/evm/v1alpha1/balances/{address}|
| `Storage` | [QueryStorageRequest](#ethermint.evm.v1alpha1.QueryStorageRequest) | [QueryStorageResponse](#ethermint.evm.v1alpha1.QueryStorageResponse) | Storage queries the balance of all coins for a single account. | GET|/ethermint/evm/v1alpha1/storage/{address}/{key}|
| `Code` | [QueryCodeRequest](#ethermint.evm.v1alpha1.QueryCodeRequest) | [QueryCodeResponse](#ethermint.evm.v1alpha1.QueryCodeResponse) | Code queries the balance of all coins for a single account. | GET|/ethermint/evm/v1alpha1/codes/{address}|
Expand Down
2 changes: 1 addition & 1 deletion ethereum/rpc/eth_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (e *PublicEthAPI) Coinbase() (string, error) {
}

req := &evmtypes.QueryValidatorAccountRequest{
ValAddress: common.Bytes2Hex(status.ValidatorInfo.Address),
ConsAddress: sdk.ConsAddress(status.ValidatorInfo.Address).String(),
}

res, err := e.queryClient.ValidatorAccount(e.ctx, req)
Expand Down
6 changes: 3 additions & 3 deletions proto/ethermint/evm/v1alpha1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ service Query {

// Account queries an Validator Cosmos Address.
rpc ValidatorAccount(QueryValidatorAccountRequest) returns (QueryValidatorAccountResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/validator_account/{val_address}";
option (google.api.http).get = "/ethermint/evm/v1alpha1/validator_account/{cons_address}";
}

// Balance queries the balance of a the EVM denomination for a single
Expand Down Expand Up @@ -111,12 +111,12 @@ message QueryValidatorAccountRequest {
option (gogoproto.goproto_getters) = false;

// val_address is the validator hex address to query the account for.
string val_address = 1;
string cons_address = 1;
}

// QueryValidatorAccountResponse is the response type for the Query/ValidatorAccount RPC method.
message QueryValidatorAccountResponse {
// account_address is the cosmos address of the account.
// account_address is the cosmos address of the account in bech32 format.
string account_address = 1;
// sequence is the account's sequence number.
uint64 sequence = 2;
Expand Down
2 changes: 1 addition & 1 deletion x/evm/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (k Keeper) ValidatorAccount(c context.Context, req *types.QueryValidatorAcc
return nil, status.Error(codes.InvalidArgument, "empty request")
}

consAddr, err := sdk.ConsAddressFromHex(req.ValAddress)
consAddr, err := sdk.ConsAddressFromBech32(req.ConsAddress)
if err != nil {
return nil, status.Error(
codes.InvalidArgument, err.Error(),
Expand Down
Loading

0 comments on commit 1abe5bc

Please sign in to comment.