additions

This commit is contained in:
Federico Kunze
2021-04-18 17:54:18 +02:00
parent 5a3d514ba0
commit 614e62fb7e
138 changed files with 11348 additions and 2906 deletions
+76
View File
@@ -171,3 +171,79 @@ message Log {
// through a filter query.
bool removed = 9;
}
// TxReceipt defines the receipt type stored in KV for each EVM transaction.
message TxReceipt {
option (gogoproto.goproto_getters) = false;
bytes hash = 1;
bytes from = 2;
TxData data = 3;
TxResult result = 4;
uint64 index = 5;
uint64 blockHeight = 6;
bytes blockHash = 7;
}
// TxResult stores results of Tx execution.
message TxResult {
option (gogoproto.goproto_getters) = false;
// contract_address contains the ethereum address of the created contract (if
// any). If the state transition is an evm.Call, the contract address will be
// empty.
string contract_address = 1
[ (gogoproto.moretags) = "yaml:\"contract_address\"" ];
// bloom represents the bloom filter bytes
bytes bloom = 2;
// tx_logs contains the transaction hash and the proto-compatible ethereum
// logs.
TransactionLogs tx_logs = 3 [
(gogoproto.moretags) = "yaml:\"tx_logs\"",
(gogoproto.nullable) = false
];
// ret defines the bytes from the execution.
bytes ret = 4;
// reverted flag is set to true when the call has been reverted
bool reverted = 5;
// gas_used notes the amount of gas consumed while execution
uint64 gas_used = 6;
}
// TxData implements the Ethereum transaction data structure. It is used
// solely as intended in Ethereum abiding by the protocol.
message TxData {
option (gogoproto.goproto_getters) = false;
// nonce corresponds to the account nonce (transaction sequence).
uint64 nonce = 1 [(gogoproto.customname) = "AccountNonce"];
// price defines the unsigned integer value of the gas price in bytes.
bytes price = 2 [
(gogoproto.jsontag) = "gasPrice"
];
// gas defines the gas limit defined for the transaction.
uint64 gas = 3 [(gogoproto.customname) = "GasLimit"];
bytes to = 4 [
(gogoproto.customname) = "Recipient"
];
// value defines the unsigned integer value of the transaction amount.
bytes value = 5 [
(gogoproto.customname) = "Amount"
];
// input defines the data payload bytes of the transaction.
bytes input = 6 [(gogoproto.customname) = "Payload"];
// v defines the signature value
bytes v = 7;
// r defines the signature value
bytes r = 8;
// s define the signature value
bytes s = 9;
// hash defines the tx data hash, which is only used when marshaling to JSON.
string hash = 10 [ (gogoproto.moretags) = "rlp:\"-\"" ];
}
message BytesList {
option (gogoproto.goproto_getters) = false;
repeated bytes bytes = 1;
}
+1 -1
View File
@@ -37,4 +37,4 @@ message GenesisAccount {
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "Storage"
];
}
}
+103 -1
View File
@@ -14,6 +14,11 @@ service Query {
option (google.api.http).get = "/ethermint/evm/v1alpha1/account/{address}";
}
// Account queries an Ethereum account's Cosmos Address.
rpc CosmosAccount(QueryCosmosAccountRequest) returns (QueryCosmosAccountResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/cosmos_account/{address}";
}
// Balance queries the balance of a the EVM denomination for a single
// EthAccount.
rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {
@@ -36,6 +41,21 @@ service Query {
option (google.api.http).get = "/ethermint/evm/v1alpha1/tx_logs/{hash}";
}
// TxReceipt queries a receipt by a transaction hash.
rpc TxReceipt(QueryTxReceiptRequest) returns (QueryTxReceiptResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/tx_receipt/{hash}";
}
// TxReceiptsByBlockHeight queries tx receipts by a block height.
rpc TxReceiptsByBlockHeight(QueryTxReceiptsByBlockHeightRequest) returns (QueryTxReceiptsByBlockHeightResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/tx_receipts_block/{height}";
}
// TxReceiptsByBlockHash queries tx receipts by a block hash.
rpc TxReceiptsByBlockHash(QueryTxReceiptsByBlockHashRequest) returns (QueryTxReceiptsByBlockHashResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/tx_receipts_block_hash/{hash}";
}
// BlockLogs queries all the ethereum logs for a given block hash.
rpc BlockLogs(QueryBlockLogsRequest) returns (QueryBlockLogsResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/block_logs/{hash}";
@@ -50,6 +70,11 @@ service Query {
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/params";
}
// StaticCall queries the static call value of x/evm module.
rpc StaticCall(QueryStaticCallRequest) returns (QueryStaticCallResponse) {
option (google.api.http).get = "/ethermint/evm/v1alpha1/static_call";
}
}
// QueryAccountRequest is the request type for the Query/Account RPC method.
@@ -71,6 +96,25 @@ message QueryAccountResponse {
uint64 nonce = 3;
}
// QueryCosmosAccountRequest is the request type for the Query/CosmosAccount RPC method.
message QueryCosmosAccountRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the ethereum hex address to query the account for.
string address = 1;
}
// QueryCosmosAccountResponse is the response type for the Query/CosmosAccount RPC method.
message QueryCosmosAccountResponse {
// cosmos_address is the cosmos address of the account.
string cosmos_address = 1;
// sequence is the account's sequence number.
uint64 sequence = 2;
// account_number is the account numbert
uint64 account_number = 3;
}
// QueryBalanceRequest is the request type for the Query/Balance RPC method.
message QueryBalanceRequest {
option (gogoproto.equal) = false;
@@ -136,6 +180,51 @@ message QueryTxLogsResponse {
repeated Log logs = 1;
}
// QueryTxReceiptRequest is the request type for the Query/TxReceipt RPC method.
message QueryTxReceiptRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// hash is the ethereum transaction hex hash to query the receipt for.
string hash = 1;
}
// QueryTxReceiptResponse is the response type for the Query/TxReceipt RPC method.
message QueryTxReceiptResponse {
// receipt represents the ethereum receipt for the given transaction.
TxReceipt receipt = 1;
}
// QueryTxReceiptsByBlockHeightRequest is the request type for the Query/TxReceiptsByBlockHeight RPC method.
message QueryTxReceiptsByBlockHeightRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// height is the block height to query tx receipts for
int64 height = 1;
}
// QueryTxReceiptsByBlockHeightResponse is the response type for the Query/TxReceiptsByBlockHeight RPC method.
message QueryTxReceiptsByBlockHeightResponse {
// tx receipts list for the block
repeated TxReceipt receipts = 1;
}
// QueryTxReceiptsByBlockHashRequest is the request type for the Query/TxReceiptsByBlockHash RPC method.
message QueryTxReceiptsByBlockHashRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// hash is the ethereum transaction hex hash to query the receipt for.
string hash = 1;
}
// QueryTxReceiptsByBlockHashResponse is the response type for the Query/TxReceiptsByBlockHash RPC method.
message QueryTxReceiptsByBlockHashResponse {
// tx receipts list for the block
repeated TxReceipt receipts = 1;
}
// QueryBlockLogsRequest is the request type for the Query/BlockLogs RPC method.
message QueryBlockLogsRequest {
option (gogoproto.equal) = false;
@@ -153,7 +242,7 @@ message QueryBlockLogsResponse {
// QueryBlockBloomRequest is the request type for the Query/BlockBloom RPC
// method.
message QueryBlockBloomRequest {}
message QueryBlockBloomRequest { int64 height = 1; }
// QueryBlockBloomResponse is the response type for the Query/BlockBloom RPC
// method.
@@ -170,3 +259,16 @@ message QueryParamsResponse {
// params define the evm module parameters.
Params params = 1 [ (gogoproto.nullable) = false ];
}
// QueryStaticCallRequest defines static call request
message QueryStaticCallRequest {
// address is the ethereum contract hex address to for static call.
string address = 1;
// static call input generated from abi
bytes input = 2;
}
// // QueryStaticCallRequest defines static call response
message QueryStaticCallResponse {
bytes data = 1;
}
+14 -50
View File
@@ -22,14 +22,22 @@ message MsgEthereumTx {
SigCache from = 3 [ (gogoproto.jsontag) = "-" ];
}
message ExtensionOptionsEthereumTx {
option (gogoproto.goproto_getters) = false;
}
message ExtensionOptionsWeb3Tx {
option (gogoproto.goproto_getters) = false;
}
// MsgEthereumTxResponse defines the Msg/EthereumTx response type.
message MsgEthereumTxResponse {
message MsgEthereumTxResponse {
option (gogoproto.goproto_getters) = false;
// contract_address contains the ethereum address of the created contract (if
// any). If the state transition is an evm.Call, the contract address will be
// empty.
string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\""];
string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\"" ];
// bloom represents the bloom filter bytes
bytes bloom = 2;
// tx_logs contains the transaction hash and the proto-compatible ethereum
@@ -40,52 +48,8 @@ message MsgEthereumTxResponse {
];
// ret defines the bytes from the execution.
bytes ret = 4;
}
// TxData implements the Ethereum transaction data structure. It is used
// solely as intended in Ethereum abiding by the protocol.
message TxData {
option (gogoproto.goproto_getters) = false;
// nonce corresponds to the account nonce (transaction sequence).
uint64 nonce = 1 [(gogoproto.customname) = "AccountNonce"];
// price defines the unsigned integer value of the gas price in bytes.
string price = 2 [
(gogoproto.jsontag) = "gasPrice",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// gas defines the gas limit defined for the transaction.
uint64 gas = 3 [(gogoproto.customname) = "GasLimit"];
Recipient to = 4 [
(gogoproto.customname) = "Recipient",
(gogoproto.moretags) = "rlp:\"nil\""
];
// value defines the unsigned integer value of the transaction amount.
string value = 5 [
(gogoproto.customname) = "Amount",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// input defines the data payload bytes of the transaction.
bytes input = 6 [(gogoproto.customname) = "Payload"];
// v defines the signature value
bytes v = 7;
// r defines the signature value
bytes r = 8;
// s define the signature value
bytes s = 9;
// hash defines the tx data hash, which is only used when marshaling to JSON.
string hash = 10 [ (gogoproto.moretags) = "rlp:\"-\"" ];
}
// Recipient defines a protobuf-compatible wrapper for an Ethereum address
// pointer. It is required for RLP encoding.
message Recipient {
option (gogoproto.goproto_getters) = false;
// address defines the hex-formated ethereum address of the recipient
string address = 1;
// reverted flag is set to true when the call has been reverted
bool reverted = 5;
}
// SigCache is used to cache the derived sender and contains the signer used
@@ -94,7 +58,7 @@ message SigCache {
option (gogoproto.goproto_getters) = false;
EIP155Signer signer = 1;
string address = 2;
bytes address = 2;
}
// EIP155Transaction implements Signer using the EIP155 rules.
@@ -103,4 +67,4 @@ message EIP155Signer {
bytes chain_id = 1 [(gogoproto.customname) = "chainId"];
bytes chain_id_mul = 2 [(gogoproto.customname) = "chainIdMul"];
}
}