Skip to content

Commit 9a40708

Browse files
authored
feat: implement an estimate gas method (#192)
* feat: implement an estimate gas method * fix: fix a response data * feat: change the data type to DeliverTx * chore: update proto message * feat: change simulate response data to proto response * chore: update generate proto scripts
1 parent c8b3f5b commit 9a40708

File tree

11 files changed

+724
-222
lines changed

11 files changed

+724
-222
lines changed

proto/tm2/abci.proto

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
syntax = "proto3";
2+
3+
import "google/protobuf/any.proto";
4+
5+
package tm2.abci;
6+
7+
message ResponseDeliverTx {
8+
ResponseBase response_base = 1 [json_name = "ResponseBase"];
9+
sint64 gas_wanted = 2 [json_name = "GasWanted"];
10+
sint64 gas_used = 3 [json_name = "GasUsed"];
11+
}
12+
13+
message ResponseBase {
14+
google.protobuf.Any error = 1 [json_name = "Error"];
15+
bytes data = 2 [json_name = "Data"];
16+
repeated google.protobuf.Any events = 3 [json_name = "Events"];
17+
string log = 4 [json_name = "Log"];
18+
string info = 5 [json_name = "Info"];
19+
}

scripts/generate.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ for x in ${FILES}; do
1212
--plugin="./node_modules/.bin/protoc-gen-ts_proto" \
1313
--ts_proto_out="${OUT_DIR}" \
1414
--proto_path="${PROTO_PATH}" \
15-
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=messages,useDate=false,snakeToCamel=false" \
15+
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=messages,useDate=false,snakeToCamel=true,emitDefaultValues=json-methods" \
1616
${x}
1717
done

src/proto/google/protobuf/any.ts

+56-57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)