From 45bef51d216dc829b5a42d066ff9db636727faa6 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 6 Jan 2023 21:30:20 +0900 Subject: [PATCH 01/25] chore: remove otracon/libs/bits --- Makefile | 5 +- go.mod | 7 +- go.sum | 465 +++++++++++++++++- libs/bits/bit_array.go | 3 +- proto/ostracon/consensus/types.pb.go | 111 ++--- proto/ostracon/consensus/types.proto | 8 +- proto/ostracon/libs/bits/types.pb.go | 408 --------------- proto/ostracon/libs/bits/types.proto | 9 - .../proto/tendermint/libs/bits/types.proto | 9 + 9 files changed, 535 insertions(+), 490 deletions(-) delete mode 100644 proto/ostracon/libs/bits/types.pb.go delete mode 100644 proto/ostracon/libs/bits/types.proto create mode 100644 third_party/proto/tendermint/libs/bits/types.proto diff --git a/Makefile b/Makefile index d8ab48f8d..f1986b9a7 100644 --- a/Makefile +++ b/Makefile @@ -93,6 +93,9 @@ mock-gen: ### Protobuf ### ############################################################################### +containerProtoVer=v0.2 +containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer) + ### # https://github.com/protocolbuffers/protobuf # https://developers.google.com/protocol-buffers/docs/gotutorial @@ -108,7 +111,7 @@ proto-all: proto-gen proto-lint proto-check-breaking proto-gen: @docker pull -q tendermintdev/docker-build-proto @echo "Generating Protobuf files" - @docker run --rm -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto sh ./scripts/protocgen.sh + @docker run --rm -v $(shell pwd):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen.sh .PHONY: proto-gen proto-lint: diff --git a/go.mod b/go.mod index 859585701..0b3a395c3 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/BurntSushi/toml v1.2.1 github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d - github.com/Workiva/go-datastructures v1.0.52 + github.com/Workiva/go-datastructures v1.0.53 github.com/adlio/schema v1.3.3 github.com/btcsuite/btcd v0.22.1 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce @@ -19,7 +19,6 @@ require ( github.com/golang/protobuf v1.5.2 github.com/google/orderedcode v0.0.1 github.com/gorilla/websocket v1.5.0 - github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect github.com/gtank/merlin v0.1.1 github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a github.com/lib/pq v1.10.7 @@ -38,6 +37,7 @@ require ( github.com/spf13/viper v1.14.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/go-amino v0.16.0 + github.com/tendermint/tendermint v0.34.19 github.com/tendermint/tm-db v0.6.7 github.com/yahoo/coname v0.0.0-20170609175141-84592ddf8673 // indirect golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e @@ -45,7 +45,6 @@ require ( gonum.org/v1/gonum v0.12.0 google.golang.org/grpc v1.52.0 gopkg.in/yaml.v3 v3.0.1 - gotest.tools v2.2.0+incompatible // indirect ) require ( @@ -72,7 +71,7 @@ require ( github.com/docker/go-units v0.4.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/golang/snappy v0.0.1 // indirect + github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect diff --git a/go.sum b/go.sum index 3e85e6bdf..863a26d2e 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -17,6 +18,17 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -25,6 +37,7 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -36,40 +49,71 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= -github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= +github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= +github.com/adlio/schema v1.3.0/go.mod h1:51QzxkpeFs6lRY11kPye26IaFPOV+HqEj01t5aXXKfs= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= @@ -79,56 +123,88 @@ github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pY github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coniks-sys/coniks-go v0.0.0-20180722014011-11acf4819b71 h1:MFLTqgfJclmtaQ1SRUrWwmDX/1UBok3XWUethkJ2swQ= github.com/coniks-sys/coniks-go v0.0.0-20180722014011-11acf4819b71/go.mod h1:TrHYHH4Wze7v7Hkwu1MH1W+mCPQKM+gs+PicdEV14o8= +github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= +github.com/containerd/continuity v0.2.1/go.mod h1:wCYX+dRqZdImhGucXOqTQn05AhX6EUDaGEMUzTFFpLg= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= +github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= github.com/docker/docker v20.10.17+incompatible h1:JYCuMrWaVNophQTOrMMoSwudOVEfcegoZZrleKc1xwE= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -137,23 +213,44 @@ github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= +github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -171,18 +268,28 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -190,6 +297,8 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -206,10 +315,13 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -221,8 +333,10 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= @@ -230,6 +344,7 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -242,84 +357,169 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a h1:H7I/CTwAupJEX4g8AesPYRKQY0wbGZxQBlg842dGK3k= github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a/go.mod h1:V0zo781scjlo5OzNQb2GI8wMt6CD4vs7y1beXtxZEhM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= +github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -327,47 +527,80 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= +github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= +github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= +github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= +github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.2 h1:HFB2fbVIlhIfCfOW81bZFbiC/RvnpXSdhbF2/DJr134= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= @@ -379,25 +612,36 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb h1:3kW8n+FfBaUoqlHxCa6e90PXWpGCWWkdyTZ6F7c9m2I= github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb/go.mod h1:2NzHJUkr/ERaPNQ2IUuNbB2jMTWYp2DxhcraWbzZj00= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= @@ -406,8 +650,12 @@ github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6us github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -416,18 +664,27 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa h1:YJfZp12Z3AFhSBeXOlv4BO55RMwPn2NoQeDsrdWnBtY= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -437,8 +694,13 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -448,20 +710,32 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tendermint/tendermint v0.34.19 h1:y0P1qI5wSa9IRuhKnTDA6IUcOrLi1hXJuALR+R7HFEk= +github.com/tendermint/tendermint v0.34.19/go.mod h1:R5+wgIwSxMdKQcmOaeudL0Cjkr3HDkhpcdum6VeU3R4= +github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= +github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= @@ -469,6 +743,7 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17 github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yahoo/coname v0.0.0-20170609175141-84592ddf8673 h1:PSg2cEFd+9Ae/r5x5iO8cJ3VmTbZNQp6X8tHDmVJAbA= github.com/yahoo/coname v0.0.0-20170609175141-84592ddf8673/go.mod h1:Wq2sZrP++Us4tAw1h58MHS8BGIpC4NmKHfvw2QWBe9U= @@ -477,29 +752,62 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -510,6 +818,7 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -523,6 +832,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -534,23 +844,29 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -569,12 +885,23 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= @@ -588,7 +915,14 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -602,13 +936,17 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -620,16 +958,22 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -646,26 +990,46 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -679,6 +1043,7 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= @@ -686,12 +1051,18 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -699,6 +1070,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -728,13 +1100,20 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -742,9 +1121,12 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -764,6 +1146,19 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -795,6 +1190,7 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -807,11 +1203,39 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -823,11 +1247,25 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -846,24 +1284,33 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= @@ -876,5 +1323,7 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/libs/bits/bit_array.go b/libs/bits/bit_array.go index 548c98dcf..98e54eed9 100644 --- a/libs/bits/bit_array.go +++ b/libs/bits/bit_array.go @@ -7,9 +7,10 @@ import ( "strings" "sync" + tmprotobits "github.com/tendermint/tendermint/proto/tendermint/libs/bits" + tmmath "github.com/line/ostracon/libs/math" tmrand "github.com/line/ostracon/libs/rand" - tmprotobits "github.com/line/ostracon/proto/ostracon/libs/bits" ) // BitArray is a thread-safe implementation of a bit array. diff --git a/proto/ostracon/consensus/types.pb.go b/proto/ostracon/consensus/types.pb.go index e00a272e2..7da044756 100644 --- a/proto/ostracon/consensus/types.pb.go +++ b/proto/ostracon/consensus/types.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - bits "github.com/line/ostracon/proto/ostracon/libs/bits" types "github.com/line/ostracon/proto/ostracon/types" + bits "github.com/tendermint/tendermint/proto/tendermint/libs/bits" io "io" math "math" math_bits "math/bits" @@ -801,60 +801,61 @@ func init() { func init() { proto.RegisterFile("ostracon/consensus/types.proto", fileDescriptor_0ef76b376cac7abc) } var fileDescriptor_0ef76b376cac7abc = []byte{ - // 848 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0xb6, 0x59, 0x67, 0x93, 0x3c, 0x27, 0xbb, 0x30, 0xda, 0x82, 0x95, 0xd2, 0x6c, 0xf0, 0x29, - 0x42, 0xc8, 0xa1, 0xe9, 0x81, 0x0a, 0x09, 0x24, 0xdc, 0x16, 0xb9, 0x6a, 0xb7, 0x8d, 0x9c, 0x6a, - 0x0f, 0x5c, 0x2c, 0x27, 0x1e, 0x25, 0x03, 0x8e, 0xc7, 0xf2, 0x4c, 0xb2, 0xec, 0x8d, 0x9f, 0xc0, - 0x99, 0xdf, 0x01, 0xff,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, 0x5d, 0xed, 0xcd, - 0x55, 0x57, 0xfb, 0xfd, 0xaa, 0xab, 0x7d, 0x77, 0x7f, 0x46, 0xf8, 0x7c, 0x39, 0x71, 0xa6, 0x74, - 0x31, 0x88, 0x49, 0x82, 0x07, 0xc5, 0x87, 0x40, 0xfe, 0xfd, 0xb0, 0xfb, 0xf5, 0x31, 0x39, 0x94, - 0x91, 0x07, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x61, 0x4b, 0xdf, 0x94, 0x9a, 0x08, 0x00, 0x00, + // 858 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcd, 0x92, 0xdb, 0x44, + 0x10, 0x96, 0x58, 0x79, 0xed, 0x6d, 0xed, 0x0f, 0x4c, 0x6d, 0x40, 0xe5, 0x10, 0xad, 0xd1, 0xc9, + 0x45, 0x51, 0x32, 0x71, 0x0e, 0x50, 0x39, 0x40, 0xa1, 0x04, 0x50, 0x2a, 0xd9, 0xc4, 0x25, 0xa7, + 0xf6, 0xc0, 0x45, 0x25, 0x5b, 0x53, 0xf6, 0x80, 0xa4, 0x51, 0x69, 0xc6, 0x5e, 0xf6, 0xc6, 0x23, + 0xf0, 0x00, 0x3c, 0x06, 0xbc, 0x43, 0x8e, 0x39, 0x72, 0x4a, 0x51, 0x5e, 0xee, 0x1c, 0x78, 0x01, + 0x6a, 0x46, 0x63, 0x59, 0x5e, 0xdb, 0xc0, 0x1e, 0x38, 0x70, 0x93, 0xdc, 0xdd, 0xdf, 0xf4, 0x7c, + 0xdd, 0xdf, 0x67, 0x81, 0x4d, 0x19, 0x2f, 0xa2, 0x31, 0xcd, 0x7a, 0x63, 0x9a, 0x31, 0x9c, 0xb1, + 0x19, 0xeb, 0xf1, 0xab, 0x1c, 0x33, 0x37, 0x2f, 0x28, 0xa7, 0x08, 0x2d, 0xe3, 0x6e, 0x15, 0x6f, + 0x9f, 0x4e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 0xb7, 0xe2, 0xbf, 0x64, 0x6b, 0x10, 0x15, + 0x7c, 0x88, 0xb9, 0x2f, 0x93, 0x3c, 0xe3, 0xd5, 0x9b, 0x33, 0x2d, 0x40, 0x12, 0x61, 0x2d, 0x82, + 0x3e, 0x07, 0x73, 0x85, 0xcb, 0xe4, 0x7d, 0xcd, 0xbe, 0xed, 0xae, 0xe6, 0xe0, 0x8a, 0x39, 0xb8, + 0x62, 0x0e, 0xae, 0x47, 0xf8, 0x17, 0x45, 0x11, 0x5d, 0x05, 0x50, 0x01, 0x31, 0x74, 0x17, 0x0e, + 0x08, 0x53, 0x14, 0xc8, 0xcb, 0xb7, 0x82, 0x16, 0x61, 0xe5, 0xd5, 0x9d, 0xaf, 0xa0, 0x35, 0x28, + 0x68, 0x4e, 0x59, 0x94, 0xa0, 0x87, 0xd0, 0xca, 0xd5, 0xb3, 0xbc, 0xb1, 0xd9, 0xb7, 0x36, 0x9a, + 0x56, 0x71, 0xd5, 0x6f, 0x95, 0xef, 0xfc, 0xa4, 0x83, 0xb9, 0x0c, 0x0e, 0x5e, 0x3c, 0xdb, 0xc9, + 0xdd, 0x47, 0x80, 0x96, 0x35, 0x61, 0x4e, 0x93, 0xb0, 0x4e, 0xe4, 0xdb, 0xcb, 0xc8, 0x80, 0x26, + 0x72, 0x26, 0xe8, 0x6b, 0x38, 0xac, 0x67, 0x2b, 0x2a, 0xff, 0xe1, 0xf2, 0xaa, 0x37, 0xb3, 0x86, + 0xe6, 0x10, 0x38, 0xf0, 0x96, 0x8c, 0xdc, 0x72, 0xae, 0x2e, 0x18, 0x82, 0x79, 0x75, 0xf6, 0xe9, + 0xb6, 0x31, 0xaa, 0x13, 0x65, 0x9e, 0xf3, 0x31, 0x18, 0x17, 0x94, 0x63, 0xd4, 0x05, 0x63, 0x4e, + 0x39, 0x56, 0x4c, 0x6e, 0xd4, 0x89, 0x9c, 0x40, 0x66, 0x38, 0x3f, 0xe8, 0xd0, 0xf4, 0x23, 0x26, + 0xab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, 0x6f, 0x08, 0xbe, 0xe4, 0xf8, 0xec, 0xef, 0xea, + 0x07, 0x2f, 0x9e, 0xf9, 0xeb, 0x6a, 0x47, 0x9f, 0x01, 0xac, 0x2c, 0x53, 0xb1, 0x7c, 0x6f, 0x1b, + 0x46, 0xe5, 0x09, 0xbe, 0x16, 0x1c, 0x54, 0x96, 0x29, 0x24, 0x2f, 0xa5, 0xbb, 0x7f, 0xd3, 0x04, + 0x57, 0x95, 0x62, 0xeb, 0x7c, 0xad, 0x14, 0x30, 0xfa, 0x14, 0x5a, 0xd3, 0x88, 0x85, 0xb2, 0xa6, + 0x29, 0x6b, 0xee, 0x6e, 0xab, 0x51, 0x1a, 0xf7, 0xb5, 0xa0, 0x39, 0x55, 0x72, 0xf7, 0xe1, 0x58, + 0x54, 0xc9, 0xbf, 0x8b, 0x54, 0x08, 0xcf, 0x6a, 0xed, 0x1e, 0x61, 0x5d, 0xa0, 0x62, 0x84, 0xf3, + 0xba, 0x60, 0xbf, 0x84, 0xa3, 0x0a, 0x49, 0xec, 0x8f, 0x75, 0xb0, 0x9b, 0xba, 0x9a, 0x64, 0x04, + 0x75, 0xf3, 0xd5, 0xab, 0xd7, 0x80, 0x3d, 0x36, 0x4b, 0xbd, 0xa7, 0xaf, 0x16, 0xb6, 0xfe, 0x7a, + 0x61, 0xeb, 0xbf, 0x2d, 0x6c, 0xfd, 0xc7, 0x6b, 0x5b, 0x7b, 0x7d, 0x6d, 0x6b, 0xbf, 0x5e, 0xdb, + 0xda, 0x37, 0xf7, 0x27, 0x84, 0x4f, 0x67, 0x23, 0x77, 0x4c, 0xd3, 0x5e, 0x42, 0x32, 0xdc, 0xab, + 0x3e, 0x16, 0xca, 0xef, 0x88, 0xcd, 0xaf, 0x90, 0xd1, 0xbe, 0x8c, 0x3c, 0xf8, 0x2b, 0x00, 0x00, + 0xff, 0xff, 0x72, 0x53, 0xad, 0xb2, 0xa2, 0x08, 0x00, 0x00, } func (m *NewRoundStep) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/consensus/types.proto b/proto/ostracon/consensus/types.proto index 7ab3814a1..c4a0c846f 100644 --- a/proto/ostracon/consensus/types.proto +++ b/proto/ostracon/consensus/types.proto @@ -5,7 +5,7 @@ option go_package = "github.com/line/ostracon/proto/ostracon/consensus"; import "gogoproto/gogo.proto"; import "ostracon/types/types.proto"; -import "ostracon/libs/bits/types.proto"; +import "tendermint/libs/bits/types.proto"; // NewRoundStep is sent for every step taken in the ConsensusState. // For every height/round/step transition @@ -24,7 +24,7 @@ message NewValidBlock { int64 height = 1; int32 round = 2; ostracon.types.PartSetHeader block_part_set_header = 3 [(gogoproto.nullable) = false]; - ostracon.libs.bits.BitArray block_parts = 4; + tendermint.libs.bits.BitArray block_parts = 4; bool is_commit = 5; } @@ -37,7 +37,7 @@ message Proposal { message ProposalPOL { int64 height = 1; int32 proposal_pol_round = 2; - ostracon.libs.bits.BitArray proposal_pol = 3 [(gogoproto.nullable) = false]; + tendermint.libs.bits.BitArray proposal_pol = 3 [(gogoproto.nullable) = false]; } // BlockPart is sent when gossipping a piece of the proposed block. @@ -74,7 +74,7 @@ message VoteSetBits { int32 round = 2; ostracon.types.SignedMsgType type = 3; ostracon.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - ostracon.libs.bits.BitArray votes = 5 [(gogoproto.nullable) = false]; + tendermint.libs.bits.BitArray votes = 5 [(gogoproto.nullable) = false]; } message Message { diff --git a/proto/ostracon/libs/bits/types.pb.go b/proto/ostracon/libs/bits/types.pb.go deleted file mode 100644 index c54a1de6a..000000000 --- a/proto/ostracon/libs/bits/types.pb.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/libs/bits/types.proto - -package bits - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type BitArray struct { - Bits int64 `protobuf:"varint,1,opt,name=bits,proto3" json:"bits,omitempty"` - Elems []uint64 `protobuf:"varint,2,rep,packed,name=elems,proto3" json:"elems,omitempty"` -} - -func (m *BitArray) Reset() { *m = BitArray{} } -func (m *BitArray) String() string { return proto.CompactTextString(m) } -func (*BitArray) ProtoMessage() {} -func (*BitArray) Descriptor() ([]byte, []int) { - return fileDescriptor_cbd48d316ef10ed8, []int{0} -} -func (m *BitArray) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BitArray.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BitArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_BitArray.Merge(m, src) -} -func (m *BitArray) XXX_Size() int { - return m.Size() -} -func (m *BitArray) XXX_DiscardUnknown() { - xxx_messageInfo_BitArray.DiscardUnknown(m) -} - -var xxx_messageInfo_BitArray proto.InternalMessageInfo - -func (m *BitArray) GetBits() int64 { - if m != nil { - return m.Bits - } - return 0 -} - -func (m *BitArray) GetElems() []uint64 { - if m != nil { - return m.Elems - } - return nil -} - -func init() { - proto.RegisterType((*BitArray)(nil), "ostracon.libs.bits.BitArray") -} - -func init() { proto.RegisterFile("ostracon/libs/bits/types.proto", fileDescriptor_cbd48d316ef10ed8) } - -var fileDescriptor_cbd48d316ef10ed8 = []byte{ - // 168 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0x2f, 0x2e, 0x29, - 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0xcf, 0xc9, 0x4c, 0x2a, 0xd6, 0x4f, 0xca, 0x2c, 0x29, 0xd6, 0x2f, - 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xc9, 0xeb, 0x81, - 0xe4, 0xf5, 0x40, 0xf2, 0x4a, 0x26, 0x5c, 0x1c, 0x4e, 0x99, 0x25, 0x8e, 0x45, 0x45, 0x89, 0x95, - 0x42, 0x42, 0x5c, 0x2c, 0x20, 0x31, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x30, 0x5b, 0x48, - 0x84, 0x8b, 0x35, 0x35, 0x27, 0x35, 0xb7, 0x58, 0x82, 0x49, 0x81, 0x59, 0x83, 0x25, 0x08, 0xc2, - 0x71, 0xf2, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, - 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xc3, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0x9c, 0xcc, 0xbc, 0x54, 0x7d, 0xb8, 0x9b, - 0xc0, 0x6e, 0xd0, 0xc7, 0x74, 0x62, 0x12, 0x1b, 0x58, 0xc6, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0x73, 0x45, 0xe0, 0x5d, 0xbf, 0x00, 0x00, 0x00, -} - -func (m *BitArray) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BitArray) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BitArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Elems) > 0 { - dAtA2 := make([]byte, len(m.Elems)*10) - var j1 int - for _, num := range m.Elems { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintTypes(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x12 - } - if m.Bits != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Bits)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BitArray) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Bits != 0 { - n += 1 + sovTypes(uint64(m.Bits)) - } - if len(m.Elems) > 0 { - l = 0 - for _, e := range m.Elems { - l += sovTypes(uint64(e)) - } - n += 1 + sovTypes(uint64(l)) + l - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BitArray) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BitArray: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BitArray: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Bits", wireType) - } - m.Bits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Bits |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Elems = append(m.Elems, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Elems) == 0 { - m.Elems = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Elems = append(m.Elems, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Elems", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/libs/bits/types.proto b/proto/ostracon/libs/bits/types.proto deleted file mode 100644 index bead2db26..000000000 --- a/proto/ostracon/libs/bits/types.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package ostracon.libs.bits; - -option go_package = "github.com/line/ostracon/proto/ostracon/libs/bits"; - -message BitArray { - int64 bits = 1; - repeated uint64 elems = 2; -} diff --git a/third_party/proto/tendermint/libs/bits/types.proto b/third_party/proto/tendermint/libs/bits/types.proto new file mode 100644 index 000000000..3111d113a --- /dev/null +++ b/third_party/proto/tendermint/libs/bits/types.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package tendermint.libs.bits; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits"; + +message BitArray { + int64 bits = 1; + repeated uint64 elems = 2; +} From 413b59ea6680ae3e3d18bbfdd1a41a02da5fa32f Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 6 Jan 2023 21:58:58 +0900 Subject: [PATCH 02/25] feat: clean up `proto/ostracon/p2p/` directory protos --- p2p/conn/connection.go | 5 +- p2p/conn/connection_test.go | 3 +- p2p/conn/evil_secret_connection_test.go | 4 +- p2p/conn/secret_connection.go | 6 +- p2p/netaddress.go | 2 +- p2p/node_info.go | 3 +- p2p/pex/pex_reactor.go | 3 +- p2p/pex/pex_reactor_test.go | 3 +- p2p/transport.go | 3 +- p2p/transport_test.go | 3 +- proto/ostracon/p2p/conn.pb.go | 929 +---------- proto/ostracon/p2p/conn.proto | 28 +- proto/ostracon/p2p/pex.pb.go | 769 --------- proto/ostracon/p2p/types.pb.go | 1399 ----------------- test/fuzz/p2p/pex/init-corpus/main.go | 3 +- .../proto/tendermint}/p2p/pex.proto | 6 +- .../proto/tendermint}/p2p/types.proto | 4 +- 17 files changed, 60 insertions(+), 3113 deletions(-) delete mode 100644 proto/ostracon/p2p/pex.pb.go delete mode 100644 proto/ostracon/p2p/types.pb.go rename {proto/ostracon => third_party/proto/tendermint}/p2p/pex.proto (65%) rename {proto/ostracon => third_party/proto/tendermint}/p2p/types.proto (90%) diff --git a/p2p/conn/connection.go b/p2p/conn/connection.go index 0ddbb9c80..2fcaad8b3 100644 --- a/p2p/conn/connection.go +++ b/p2p/conn/connection.go @@ -14,6 +14,8 @@ import ( "github.com/gogo/protobuf/proto" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + flow "github.com/line/ostracon/libs/flowrate" "github.com/line/ostracon/libs/log" tmmath "github.com/line/ostracon/libs/math" @@ -21,7 +23,6 @@ import ( "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/libs/timer" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" ) const ( @@ -888,7 +889,7 @@ func (ch *Channel) updateStats() { //---------------------------------------- // Packet -// mustWrapPacket takes a packet kind (oneof) and wraps it in a tmp2p.Packet message. +// mustWrapPacket takes a packet kind (oneof) and wraps it in a ocp2p.Packet message. func mustWrapPacket(pb proto.Message) *tmp2p.Packet { var msg tmp2p.Packet diff --git a/p2p/conn/connection_test.go b/p2p/conn/connection_test.go index e85d0c5ec..78dad8903 100644 --- a/p2p/conn/connection_test.go +++ b/p2p/conn/connection_test.go @@ -11,9 +11,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/protoio" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" "github.com/line/ostracon/proto/ostracon/types" ) diff --git a/p2p/conn/evil_secret_connection_test.go b/p2p/conn/evil_secret_connection_test.go index 8ef3d4aad..a20339e64 100644 --- a/p2p/conn/evil_secret_connection_test.go +++ b/p2p/conn/evil_secret_connection_test.go @@ -15,7 +15,7 @@ import ( "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/libs/protoio" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" + ocp2p "github.com/line/ostracon/proto/ostracon/p2p" ) type buffer struct { @@ -117,7 +117,7 @@ func (c *evilConn) Read(data []byte) (n int, err error) { if err != nil { panic(err) } - bz, err := protoio.MarshalDelimited(&tmp2p.AuthSigMessage{PubKey: pkpb, Sig: signature}) + bz, err := protoio.MarshalDelimited(&ocp2p.AuthSigMessage{PubKey: pkpb, Sig: signature}) if err != nil { panic(err) } diff --git a/p2p/conn/secret_connection.go b/p2p/conn/secret_connection.go index ff0698f6b..4f849dcf0 100644 --- a/p2p/conn/secret_connection.go +++ b/p2p/conn/secret_connection.go @@ -27,7 +27,7 @@ import ( "github.com/line/ostracon/libs/async" "github.com/line/ostracon/libs/protoio" tmsync "github.com/line/ostracon/libs/sync" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" + ocp2p "github.com/line/ostracon/proto/ostracon/p2p" ) // 4 + 1024 == 1028 total frame size @@ -406,14 +406,14 @@ func shareAuthSignature(sc io.ReadWriter, pubKey crypto.PubKey, signature []byte if err != nil { return nil, true, err } - _, err = protoio.NewDelimitedWriter(sc).WriteMsg(&tmp2p.AuthSigMessage{PubKey: pbpk, Sig: signature}) + _, err = protoio.NewDelimitedWriter(sc).WriteMsg(&ocp2p.AuthSigMessage{PubKey: pbpk, Sig: signature}) if err != nil { return nil, true, err // abort } return nil, false, nil }, func(_ int) (val interface{}, abort bool, err error) { - var pba tmp2p.AuthSigMessage + var pba ocp2p.AuthSigMessage _, err = protoio.NewDelimitedReader(sc, 1024*1024).ReadMsg(&pba) if err != nil { return nil, true, err // abort diff --git a/p2p/netaddress.go b/p2p/netaddress.go index adaeff293..f0ded0941 100644 --- a/p2p/netaddress.go +++ b/p2p/netaddress.go @@ -14,7 +14,7 @@ import ( "strings" "time" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" ) // EmptyNetAddress defines the string representation of an empty NetAddress diff --git a/p2p/node_info.go b/p2p/node_info.go index 1ce86db02..be828552f 100644 --- a/p2p/node_info.go +++ b/p2p/node_info.go @@ -6,9 +6,10 @@ import ( "fmt" "reflect" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + tmbytes "github.com/line/ostracon/libs/bytes" tmstrings "github.com/line/ostracon/libs/strings" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" "github.com/line/ostracon/version" ) diff --git a/p2p/pex/pex_reactor.go b/p2p/pex/pex_reactor.go index 54fb92957..383be76b8 100644 --- a/p2p/pex/pex_reactor.go +++ b/p2p/pex/pex_reactor.go @@ -8,13 +8,14 @@ import ( "github.com/gogo/protobuf/proto" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + "github.com/line/ostracon/libs/cmap" tmmath "github.com/line/ostracon/libs/math" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/libs/service" "github.com/line/ostracon/p2p" "github.com/line/ostracon/p2p/conn" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" ) type Peer = p2p.Peer diff --git a/p2p/pex/pex_reactor_test.go b/p2p/pex/pex_reactor_test.go index ac94e5b01..dde682e69 100644 --- a/p2p/pex/pex_reactor_test.go +++ b/p2p/pex/pex_reactor_test.go @@ -13,11 +13,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" "github.com/line/ostracon/p2p/mock" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" ) var ( diff --git a/p2p/transport.go b/p2p/transport.go index 65b87c249..fc2fa8ffb 100644 --- a/p2p/transport.go +++ b/p2p/transport.go @@ -8,10 +8,11 @@ import ( "golang.org/x/net/netutil" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/libs/protoio" "github.com/line/ostracon/p2p/conn" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" ) const ( diff --git a/p2p/transport_test.go b/p2p/transport_test.go index 58555a671..3d8183218 100644 --- a/p2p/transport_test.go +++ b/p2p/transport_test.go @@ -12,10 +12,11 @@ import ( "testing" "time" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/libs/protoio" "github.com/line/ostracon/p2p/conn" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" "github.com/miekg/dns" "github.com/stretchr/testify/require" ) diff --git a/proto/ostracon/p2p/conn.pb.go b/proto/ostracon/p2p/conn.pb.go index 9e7d52d1c..aca675994 100644 --- a/proto/ostracon/p2p/conn.pb.go +++ b/proto/ostracon/p2p/conn.pb.go @@ -24,236 +24,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type PacketPing struct { -} - -func (m *PacketPing) Reset() { *m = PacketPing{} } -func (m *PacketPing) String() string { return proto.CompactTextString(m) } -func (*PacketPing) ProtoMessage() {} -func (*PacketPing) Descriptor() ([]byte, []int) { - return fileDescriptor_aeb1ccf8456edf44, []int{0} -} -func (m *PacketPing) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PacketPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketPing.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PacketPing) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketPing.Merge(m, src) -} -func (m *PacketPing) XXX_Size() int { - return m.Size() -} -func (m *PacketPing) XXX_DiscardUnknown() { - xxx_messageInfo_PacketPing.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketPing proto.InternalMessageInfo - -type PacketPong struct { -} - -func (m *PacketPong) Reset() { *m = PacketPong{} } -func (m *PacketPong) String() string { return proto.CompactTextString(m) } -func (*PacketPong) ProtoMessage() {} -func (*PacketPong) Descriptor() ([]byte, []int) { - return fileDescriptor_aeb1ccf8456edf44, []int{1} -} -func (m *PacketPong) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PacketPong) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketPong.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PacketPong) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketPong.Merge(m, src) -} -func (m *PacketPong) XXX_Size() int { - return m.Size() -} -func (m *PacketPong) XXX_DiscardUnknown() { - xxx_messageInfo_PacketPong.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketPong proto.InternalMessageInfo - -type PacketMsg struct { - ChannelID int32 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - EOF bool `protobuf:"varint,2,opt,name=eof,proto3" json:"eof,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *PacketMsg) Reset() { *m = PacketMsg{} } -func (m *PacketMsg) String() string { return proto.CompactTextString(m) } -func (*PacketMsg) ProtoMessage() {} -func (*PacketMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_aeb1ccf8456edf44, []int{2} -} -func (m *PacketMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PacketMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PacketMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketMsg.Merge(m, src) -} -func (m *PacketMsg) XXX_Size() int { - return m.Size() -} -func (m *PacketMsg) XXX_DiscardUnknown() { - xxx_messageInfo_PacketMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketMsg proto.InternalMessageInfo - -func (m *PacketMsg) GetChannelID() int32 { - if m != nil { - return m.ChannelID - } - return 0 -} - -func (m *PacketMsg) GetEOF() bool { - if m != nil { - return m.EOF - } - return false -} - -func (m *PacketMsg) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type Packet struct { - // Types that are valid to be assigned to Sum: - // *Packet_PacketPing - // *Packet_PacketPong - // *Packet_PacketMsg - Sum isPacket_Sum `protobuf_oneof:"sum"` -} - -func (m *Packet) Reset() { *m = Packet{} } -func (m *Packet) String() string { return proto.CompactTextString(m) } -func (*Packet) ProtoMessage() {} -func (*Packet) Descriptor() ([]byte, []int) { - return fileDescriptor_aeb1ccf8456edf44, []int{3} -} -func (m *Packet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Packet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Packet) XXX_Merge(src proto.Message) { - xxx_messageInfo_Packet.Merge(m, src) -} -func (m *Packet) XXX_Size() int { - return m.Size() -} -func (m *Packet) XXX_DiscardUnknown() { - xxx_messageInfo_Packet.DiscardUnknown(m) -} - -var xxx_messageInfo_Packet proto.InternalMessageInfo - -type isPacket_Sum interface { - isPacket_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Packet_PacketPing struct { - PacketPing *PacketPing `protobuf:"bytes,1,opt,name=packet_ping,json=packetPing,proto3,oneof" json:"packet_ping,omitempty"` -} -type Packet_PacketPong struct { - PacketPong *PacketPong `protobuf:"bytes,2,opt,name=packet_pong,json=packetPong,proto3,oneof" json:"packet_pong,omitempty"` -} -type Packet_PacketMsg struct { - PacketMsg *PacketMsg `protobuf:"bytes,3,opt,name=packet_msg,json=packetMsg,proto3,oneof" json:"packet_msg,omitempty"` -} - -func (*Packet_PacketPing) isPacket_Sum() {} -func (*Packet_PacketPong) isPacket_Sum() {} -func (*Packet_PacketMsg) isPacket_Sum() {} - -func (m *Packet) GetSum() isPacket_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Packet) GetPacketPing() *PacketPing { - if x, ok := m.GetSum().(*Packet_PacketPing); ok { - return x.PacketPing - } - return nil -} - -func (m *Packet) GetPacketPong() *PacketPong { - if x, ok := m.GetSum().(*Packet_PacketPong); ok { - return x.PacketPong - } - return nil -} - -func (m *Packet) GetPacketMsg() *PacketMsg { - if x, ok := m.GetSum().(*Packet_PacketMsg); ok { - return x.PacketMsg - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Packet) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Packet_PacketPing)(nil), - (*Packet_PacketPong)(nil), - (*Packet_PacketMsg)(nil), - } -} - type AuthSigMessage struct { PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` Sig []byte `protobuf:"bytes,2,opt,name=sig,proto3" json:"sig,omitempty"` @@ -263,7 +33,7 @@ func (m *AuthSigMessage) Reset() { *m = AuthSigMessage{} } func (m *AuthSigMessage) String() string { return proto.CompactTextString(m) } func (*AuthSigMessage) ProtoMessage() {} func (*AuthSigMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_aeb1ccf8456edf44, []int{4} + return fileDescriptor_aeb1ccf8456edf44, []int{0} } func (m *AuthSigMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -307,230 +77,30 @@ func (m *AuthSigMessage) GetSig() []byte { } func init() { - proto.RegisterType((*PacketPing)(nil), "ostracon.p2p.PacketPing") - proto.RegisterType((*PacketPong)(nil), "ostracon.p2p.PacketPong") - proto.RegisterType((*PacketMsg)(nil), "ostracon.p2p.PacketMsg") - proto.RegisterType((*Packet)(nil), "ostracon.p2p.Packet") proto.RegisterType((*AuthSigMessage)(nil), "ostracon.p2p.AuthSigMessage") } func init() { proto.RegisterFile("ostracon/p2p/conn.proto", fileDescriptor_aeb1ccf8456edf44) } var fileDescriptor_aeb1ccf8456edf44 = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x8b, 0xd3, 0x40, - 0x14, 0xc7, 0x33, 0x66, 0xb7, 0x6b, 0x5e, 0xa3, 0xc8, 0x20, 0x6c, 0xcc, 0x21, 0x2d, 0x39, 0x15, - 0x94, 0x04, 0xe2, 0x45, 0xf1, 0x64, 0x74, 0xc5, 0x65, 0x29, 0x96, 0x78, 0x13, 0x24, 0x24, 0xe9, - 0x38, 0x19, 0xda, 0xce, 0x0c, 0x9d, 0xe4, 0x90, 0x6f, 0xe1, 0x77, 0xf2, 0xb2, 0xc7, 0x3d, 0x7a, - 0x2a, 0x92, 0x7e, 0x11, 0xc9, 0xa4, 0xdb, 0x46, 0x70, 0x6f, 0xff, 0xff, 0x7b, 0xef, 0x37, 0xef, - 0x3d, 0xe6, 0xc1, 0xa5, 0x50, 0xd5, 0x36, 0x2b, 0x04, 0x0f, 0x65, 0x24, 0xc3, 0x42, 0x70, 0x1e, - 0xc8, 0xad, 0xa8, 0x04, 0xb6, 0xef, 0x13, 0x81, 0x8c, 0xa4, 0xfb, 0x9c, 0x0a, 0x2a, 0x74, 0x22, - 0xec, 0x54, 0x5f, 0xe3, 0xba, 0x47, 0xb8, 0xd8, 0x36, 0xb2, 0x12, 0xe1, 0x8a, 0x34, 0xaa, 0xcf, - 0xf9, 0x36, 0xc0, 0x22, 0x2b, 0x56, 0xa4, 0x5a, 0x30, 0x4e, 0x07, 0x4e, 0x70, 0xea, 0x97, 0x60, - 0xf5, 0x6e, 0xae, 0x28, 0x7e, 0x05, 0x50, 0x94, 0x19, 0xe7, 0x64, 0x9d, 0xb2, 0xa5, 0x83, 0xa6, - 0x68, 0x76, 0x1e, 0x3f, 0x69, 0x77, 0x13, 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xe3, 0x6e, 0xef, - 0x19, 0xbf, 0xf7, 0x9e, 0xf1, 0xed, 0x25, 0x65, 0x55, 0x59, 0xe7, 0x41, 0x21, 0x36, 0xe1, 0x9a, - 0x71, 0x12, 0x9e, 0xae, 0x45, 0xdf, 0xc2, 0xf0, 0x78, 0xf2, 0x91, 0x8e, 0xbd, 0xfe, 0x1b, 0x00, - 0x00, 0xff, 0xff, 0x8c, 0xc6, 0xa3, 0x5d, 0x53, 0x02, 0x00, 0x00, -} - -func (m *PacketPing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketPing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PacketPong) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketPong) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketPong) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PacketMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintConn(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x1a - } - if m.EOF { - i-- - if m.EOF { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.ChannelID != 0 { - i = encodeVarintConn(dAtA, i, uint64(m.ChannelID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Packet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Packet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Packet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Packet_PacketPing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Packet_PacketPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PacketPing != nil { - { - size, err := m.PacketPing.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Packet_PacketPong) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Packet_PacketPong) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PacketPong != nil { - { - size, err := m.PacketPong.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Packet_PacketMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + // 226 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x2f, 0x2e, 0x29, + 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0x30, 0x2a, 0xd0, 0x4f, 0xce, 0xcf, 0xcb, 0xd3, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x49, 0xe8, 0x15, 0x18, 0x15, 0x48, 0x89, 0xa4, 0xe7, 0xa7, + 0xe7, 0x83, 0x25, 0xf4, 0x41, 0x2c, 0x88, 0x1a, 0x29, 0x29, 0xb8, 0xe6, 0xe4, 0xa2, 0xca, 0x82, + 0x92, 0x7c, 0xfd, 0xec, 0xd4, 0xca, 0x62, 0x88, 0x9c, 0x52, 0x2c, 0x17, 0x9f, 0x63, 0x69, 0x49, + 0x46, 0x70, 0x66, 0xba, 0x6f, 0x6a, 0x71, 0x71, 0x62, 0x7a, 0xaa, 0x90, 0x25, 0x17, 0x7b, 0x41, + 0x69, 0x52, 0x7c, 0x76, 0x6a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x94, 0x1e, 0xdc, + 0x0e, 0x88, 0x7e, 0xbd, 0x80, 0xd2, 0xa4, 0x9c, 0xcc, 0x64, 0xef, 0xd4, 0x4a, 0x27, 0x96, 0x13, + 0xf7, 0xe4, 0x19, 0x82, 0xd8, 0x0a, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, 0x04, 0xb8, 0x98, 0x8b, + 0x33, 0xd3, 0x25, 0x98, 0x14, 0x18, 0x35, 0x78, 0x82, 0x40, 0x4c, 0x27, 0xd7, 0x13, 0x8f, 0xe4, + 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, + 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, + 0xce, 0xcf, 0xd5, 0xcf, 0xc9, 0xcc, 0x4b, 0xd5, 0x47, 0xf8, 0x10, 0xec, 0x7e, 0x64, 0x0f, 0x27, + 0xb1, 0x81, 0xc5, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xc0, 0xb7, 0x36, 0x07, 0x01, + 0x00, 0x00, } -func (m *Packet_PacketMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PacketMsg != nil { - { - size, err := m.PacketMsg.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} func (m *AuthSigMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -582,92 +152,7 @@ func encodeVarintConn(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *PacketPing) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PacketPong) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PacketMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChannelID != 0 { - n += 1 + sovConn(uint64(m.ChannelID)) - } - if m.EOF { - n += 2 - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovConn(uint64(l)) - } - return n -} - -func (m *Packet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Packet_PacketPing) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PacketPing != nil { - l = m.PacketPing.Size() - n += 1 + l + sovConn(uint64(l)) - } - return n -} -func (m *Packet_PacketPong) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PacketPong != nil { - l = m.PacketPong.Size() - n += 1 + l + sovConn(uint64(l)) - } - return n -} -func (m *Packet_PacketMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PacketMsg != nil { - l = m.PacketMsg.Size() - n += 1 + l + sovConn(uint64(l)) - } - return n -} -func (m *AuthSigMessage) Size() (n int) { +func (m *AuthSigMessage) Size() (n int) { if m == nil { return 0 } @@ -688,384 +173,6 @@ func sovConn(x uint64) (n int) { func sozConn(x uint64) (n int) { return sovConn(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *PacketPing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PacketPing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PacketPing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PacketPong) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PacketPong: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PacketPong: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PacketMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PacketMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PacketMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelID", wireType) - } - m.ChannelID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChannelID |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EOF", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EOF = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Packet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Packet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Packet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketPing", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PacketPing{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Packet_PacketPing{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketPong", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PacketPong{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Packet_PacketPong{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketMsg", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PacketMsg{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Packet_PacketMsg{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *AuthSigMessage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/proto/ostracon/p2p/conn.proto b/proto/ostracon/p2p/conn.proto index 7fc2f2f64..b2535503b 100644 --- a/proto/ostracon/p2p/conn.proto +++ b/proto/ostracon/p2p/conn.proto @@ -6,23 +6,23 @@ option go_package = "github.com/line/ostracon/proto/ostracon/p2p"; import "gogoproto/gogo.proto"; import "ostracon/crypto/keys.proto"; -message PacketPing {} +//message PacketPing {} -message PacketPong {} +//message PacketPong {} -message PacketMsg { - int32 channel_id = 1 [(gogoproto.customname) = "ChannelID"]; - bool eof = 2 [(gogoproto.customname) = "EOF"]; - bytes data = 3; -} +//message PacketMsg { +// int32 channel_id = 1 [(gogoproto.customname) = "ChannelID"]; +// bool eof = 2 [(gogoproto.customname) = "EOF"]; +// bytes data = 3; +//} -message Packet { - oneof sum { - PacketPing packet_ping = 1; - PacketPong packet_pong = 2; - PacketMsg packet_msg = 3; - } -} +//message Packet { +// oneof sum { +// PacketPing packet_ping = 1; +// PacketPong packet_pong = 2; +// PacketMsg packet_msg = 3; +// } +//} message AuthSigMessage { ostracon.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; diff --git a/proto/ostracon/p2p/pex.pb.go b/proto/ostracon/p2p/pex.pb.go deleted file mode 100644 index 3858d6c2f..000000000 --- a/proto/ostracon/p2p/pex.pb.go +++ /dev/null @@ -1,769 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/p2p/pex.proto - -package p2p - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PexRequest struct { -} - -func (m *PexRequest) Reset() { *m = PexRequest{} } -func (m *PexRequest) String() string { return proto.CompactTextString(m) } -func (*PexRequest) ProtoMessage() {} -func (*PexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_babab98bd8d8cc43, []int{0} -} -func (m *PexRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PexRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PexRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PexRequest.Merge(m, src) -} -func (m *PexRequest) XXX_Size() int { - return m.Size() -} -func (m *PexRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PexRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PexRequest proto.InternalMessageInfo - -type PexAddrs struct { - Addrs []NetAddress `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs"` -} - -func (m *PexAddrs) Reset() { *m = PexAddrs{} } -func (m *PexAddrs) String() string { return proto.CompactTextString(m) } -func (*PexAddrs) ProtoMessage() {} -func (*PexAddrs) Descriptor() ([]byte, []int) { - return fileDescriptor_babab98bd8d8cc43, []int{1} -} -func (m *PexAddrs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PexAddrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PexAddrs.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PexAddrs) XXX_Merge(src proto.Message) { - xxx_messageInfo_PexAddrs.Merge(m, src) -} -func (m *PexAddrs) XXX_Size() int { - return m.Size() -} -func (m *PexAddrs) XXX_DiscardUnknown() { - xxx_messageInfo_PexAddrs.DiscardUnknown(m) -} - -var xxx_messageInfo_PexAddrs proto.InternalMessageInfo - -func (m *PexAddrs) GetAddrs() []NetAddress { - if m != nil { - return m.Addrs - } - return nil -} - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_PexRequest - // *Message_PexAddrs - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_babab98bd8d8cc43, []int{2} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return m.Size() -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_PexRequest struct { - PexRequest *PexRequest `protobuf:"bytes,1,opt,name=pex_request,json=pexRequest,proto3,oneof" json:"pex_request,omitempty"` -} -type Message_PexAddrs struct { - PexAddrs *PexAddrs `protobuf:"bytes,2,opt,name=pex_addrs,json=pexAddrs,proto3,oneof" json:"pex_addrs,omitempty"` -} - -func (*Message_PexRequest) isMessage_Sum() {} -func (*Message_PexAddrs) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetPexRequest() *PexRequest { - if x, ok := m.GetSum().(*Message_PexRequest); ok { - return x.PexRequest - } - return nil -} - -func (m *Message) GetPexAddrs() *PexAddrs { - if x, ok := m.GetSum().(*Message_PexAddrs); ok { - return x.PexAddrs - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_PexRequest)(nil), - (*Message_PexAddrs)(nil), - } -} - -func init() { - proto.RegisterType((*PexRequest)(nil), "ostracon.p2p.PexRequest") - proto.RegisterType((*PexAddrs)(nil), "ostracon.p2p.PexAddrs") - proto.RegisterType((*Message)(nil), "ostracon.p2p.Message") -} - -func init() { proto.RegisterFile("ostracon/p2p/pex.proto", fileDescriptor_babab98bd8d8cc43) } - -var fileDescriptor_babab98bd8d8cc43 = []byte{ - // 268 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcb, 0x2f, 0x2e, 0x29, - 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0x30, 0x2a, 0xd0, 0x2f, 0x48, 0xad, 0xd0, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x89, 0xeb, 0x15, 0x18, 0x15, 0x48, 0x49, 0xa0, 0xa8, 0x2a, 0xa9, - 0x2c, 0x48, 0x2d, 0x86, 0xa8, 0x93, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, - 0x88, 0xa8, 0x12, 0x0f, 0x17, 0x57, 0x40, 0x6a, 0x45, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, - 0x92, 0x03, 0x17, 0x47, 0x40, 0x6a, 0x85, 0x63, 0x4a, 0x4a, 0x51, 0xb1, 0x90, 0x09, 0x17, 0x6b, - 0x22, 0x88, 0x21, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xa1, 0x87, 0x6c, 0x8f, 0x9e, 0x5f, - 0x6a, 0x09, 0x48, 0x59, 0x6a, 0x71, 0xb1, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x10, 0xc5, - 0x4a, 0x2d, 0x8c, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0xd6, 0x5c, 0xdc, - 0x05, 0xa9, 0x15, 0xf1, 0x45, 0x10, 0xc3, 0x25, 0x18, 0x15, 0x18, 0x31, 0xcd, 0x41, 0x58, 0xee, - 0xc1, 0x10, 0xc4, 0x55, 0x00, 0xe7, 0x09, 0x99, 0x72, 0x71, 0x82, 0x34, 0x43, 0x9c, 0xc0, 0x04, - 0xd6, 0x2a, 0x86, 0xa1, 0x15, 0xec, 0x52, 0x0f, 0x86, 0x20, 0x8e, 0x02, 0x28, 0xdb, 0x89, 0x95, - 0x8b, 0xb9, 0xb8, 0x34, 0xd7, 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, - 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, - 0xa2, 0xb4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x73, 0x32, 0xf3, - 0x52, 0xf5, 0x11, 0x01, 0x06, 0x0e, 0x1b, 0xe4, 0xf0, 0x4b, 0x62, 0x03, 0x8b, 0x19, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xcb, 0x19, 0xb2, 0xb2, 0x7c, 0x01, 0x00, 0x00, -} - -func (m *PexRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PexAddrs) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PexAddrs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PexAddrs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addrs) > 0 { - for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Addrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPex(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_PexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PexRequest != nil { - { - size, err := m.PexRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPex(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Message_PexAddrs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PexAddrs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PexAddrs != nil { - { - size, err := m.PexAddrs.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPex(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func encodeVarintPex(dAtA []byte, offset int, v uint64) int { - offset -= sovPex(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PexAddrs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Addrs) > 0 { - for _, e := range m.Addrs { - l = e.Size() - n += 1 + l + sovPex(uint64(l)) - } - } - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_PexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PexRequest != nil { - l = m.PexRequest.Size() - n += 1 + l + sovPex(uint64(l)) - } - return n -} -func (m *Message_PexAddrs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PexAddrs != nil { - l = m.PexAddrs.Size() - n += 1 + l + sovPex(uint64(l)) - } - return n -} - -func sovPex(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPex(x uint64) (n int) { - return sovPex(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PexRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PexRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PexRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipPex(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPex - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PexAddrs) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PexAddrs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PexAddrs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPex - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPex - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addrs = append(m.Addrs, NetAddress{}) - if err := m.Addrs[len(m.Addrs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPex(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPex - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PexRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPex - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPex - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PexRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PexRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PexAddrs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPex - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPex - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PexAddrs{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PexAddrs{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPex(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPex - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPex(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPex - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPex - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPex - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPex - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPex - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPex - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPex = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPex = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPex = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/p2p/types.pb.go b/proto/ostracon/p2p/types.pb.go deleted file mode 100644 index 569d6fd43..000000000 --- a/proto/ostracon/p2p/types.pb.go +++ /dev/null @@ -1,1399 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/p2p/types.proto - -package p2p - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type NetAddress struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - IP string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` -} - -func (m *NetAddress) Reset() { *m = NetAddress{} } -func (m *NetAddress) String() string { return proto.CompactTextString(m) } -func (*NetAddress) ProtoMessage() {} -func (*NetAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_309178781c11bf68, []int{0} -} -func (m *NetAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NetAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NetAddress.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NetAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetAddress.Merge(m, src) -} -func (m *NetAddress) XXX_Size() int { - return m.Size() -} -func (m *NetAddress) XXX_DiscardUnknown() { - xxx_messageInfo_NetAddress.DiscardUnknown(m) -} - -var xxx_messageInfo_NetAddress proto.InternalMessageInfo - -func (m *NetAddress) GetID() string { - if m != nil { - return m.ID - } - return "" -} - -func (m *NetAddress) GetIP() string { - if m != nil { - return m.IP - } - return "" -} - -func (m *NetAddress) GetPort() uint32 { - if m != nil { - return m.Port - } - return 0 -} - -type ProtocolVersion struct { - P2P uint64 `protobuf:"varint,1,opt,name=p2p,proto3" json:"p2p,omitempty"` - Block uint64 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"` - App uint64 `protobuf:"varint,3,opt,name=app,proto3" json:"app,omitempty"` -} - -func (m *ProtocolVersion) Reset() { *m = ProtocolVersion{} } -func (m *ProtocolVersion) String() string { return proto.CompactTextString(m) } -func (*ProtocolVersion) ProtoMessage() {} -func (*ProtocolVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_309178781c11bf68, []int{1} -} -func (m *ProtocolVersion) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProtocolVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtocolVersion.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProtocolVersion) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtocolVersion.Merge(m, src) -} -func (m *ProtocolVersion) XXX_Size() int { - return m.Size() -} -func (m *ProtocolVersion) XXX_DiscardUnknown() { - xxx_messageInfo_ProtocolVersion.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtocolVersion proto.InternalMessageInfo - -func (m *ProtocolVersion) GetP2P() uint64 { - if m != nil { - return m.P2P - } - return 0 -} - -func (m *ProtocolVersion) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *ProtocolVersion) GetApp() uint64 { - if m != nil { - return m.App - } - return 0 -} - -type DefaultNodeInfo struct { - ProtocolVersion ProtocolVersion `protobuf:"bytes,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version"` - DefaultNodeID string `protobuf:"bytes,2,opt,name=default_node_id,json=defaultNodeId,proto3" json:"default_node_id,omitempty"` - ListenAddr string `protobuf:"bytes,3,opt,name=listen_addr,json=listenAddr,proto3" json:"listen_addr,omitempty"` - Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"` - Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` - Channels []byte `protobuf:"bytes,6,opt,name=channels,proto3" json:"channels,omitempty"` - Moniker string `protobuf:"bytes,7,opt,name=moniker,proto3" json:"moniker,omitempty"` - Other DefaultNodeInfoOther `protobuf:"bytes,8,opt,name=other,proto3" json:"other"` -} - -func (m *DefaultNodeInfo) Reset() { *m = DefaultNodeInfo{} } -func (m *DefaultNodeInfo) String() string { return proto.CompactTextString(m) } -func (*DefaultNodeInfo) ProtoMessage() {} -func (*DefaultNodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_309178781c11bf68, []int{2} -} -func (m *DefaultNodeInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DefaultNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DefaultNodeInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DefaultNodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefaultNodeInfo.Merge(m, src) -} -func (m *DefaultNodeInfo) XXX_Size() int { - return m.Size() -} -func (m *DefaultNodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_DefaultNodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_DefaultNodeInfo proto.InternalMessageInfo - -func (m *DefaultNodeInfo) GetProtocolVersion() ProtocolVersion { - if m != nil { - return m.ProtocolVersion - } - return ProtocolVersion{} -} - -func (m *DefaultNodeInfo) GetDefaultNodeID() string { - if m != nil { - return m.DefaultNodeID - } - return "" -} - -func (m *DefaultNodeInfo) GetListenAddr() string { - if m != nil { - return m.ListenAddr - } - return "" -} - -func (m *DefaultNodeInfo) GetNetwork() string { - if m != nil { - return m.Network - } - return "" -} - -func (m *DefaultNodeInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *DefaultNodeInfo) GetChannels() []byte { - if m != nil { - return m.Channels - } - return nil -} - -func (m *DefaultNodeInfo) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *DefaultNodeInfo) GetOther() DefaultNodeInfoOther { - if m != nil { - return m.Other - } - return DefaultNodeInfoOther{} -} - -type DefaultNodeInfoOther struct { - TxIndex string `protobuf:"bytes,1,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` - RPCAddress string `protobuf:"bytes,2,opt,name=rpc_address,json=rpcAddress,proto3" json:"rpc_address,omitempty"` -} - -func (m *DefaultNodeInfoOther) Reset() { *m = DefaultNodeInfoOther{} } -func (m *DefaultNodeInfoOther) String() string { return proto.CompactTextString(m) } -func (*DefaultNodeInfoOther) ProtoMessage() {} -func (*DefaultNodeInfoOther) Descriptor() ([]byte, []int) { - return fileDescriptor_309178781c11bf68, []int{3} -} -func (m *DefaultNodeInfoOther) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DefaultNodeInfoOther) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DefaultNodeInfoOther.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DefaultNodeInfoOther) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefaultNodeInfoOther.Merge(m, src) -} -func (m *DefaultNodeInfoOther) XXX_Size() int { - return m.Size() -} -func (m *DefaultNodeInfoOther) XXX_DiscardUnknown() { - xxx_messageInfo_DefaultNodeInfoOther.DiscardUnknown(m) -} - -var xxx_messageInfo_DefaultNodeInfoOther proto.InternalMessageInfo - -func (m *DefaultNodeInfoOther) GetTxIndex() string { - if m != nil { - return m.TxIndex - } - return "" -} - -func (m *DefaultNodeInfoOther) GetRPCAddress() string { - if m != nil { - return m.RPCAddress - } - return "" -} - -func init() { - proto.RegisterType((*NetAddress)(nil), "ostracon.p2p.NetAddress") - proto.RegisterType((*ProtocolVersion)(nil), "ostracon.p2p.ProtocolVersion") - proto.RegisterType((*DefaultNodeInfo)(nil), "ostracon.p2p.DefaultNodeInfo") - proto.RegisterType((*DefaultNodeInfoOther)(nil), "ostracon.p2p.DefaultNodeInfoOther") -} - -func init() { proto.RegisterFile("ostracon/p2p/types.proto", fileDescriptor_309178781c11bf68) } - -var fileDescriptor_309178781c11bf68 = []byte{ - // 480 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x3d, 0x8f, 0xd3, 0x40, - 0x10, 0x8d, 0x1d, 0xe7, 0xe3, 0x26, 0x17, 0x72, 0xac, 0x22, 0xe4, 0x3b, 0x09, 0x3b, 0x4a, 0x15, - 0x09, 0x29, 0x96, 0x42, 0x45, 0x83, 0x44, 0x08, 0x45, 0x9a, 0x60, 0xad, 0x10, 0x05, 0x4d, 0xe4, - 0x78, 0xf7, 0x92, 0x55, 0x7c, 0xbb, 0xab, 0xf5, 0x1e, 0x84, 0x7f, 0xc1, 0xcf, 0xba, 0xf2, 0x4a, - 0x2a, 0x0b, 0x39, 0x05, 0x7f, 0x03, 0x79, 0xed, 0x80, 0x89, 0xae, 0x9b, 0x37, 0x5f, 0x6f, 0xe6, - 0xe9, 0x81, 0x2b, 0x52, 0xad, 0xa2, 0x58, 0xf0, 0x40, 0xce, 0x64, 0xa0, 0xbf, 0x4b, 0x9a, 0x4e, - 0xa5, 0x12, 0x5a, 0xa0, 0xcb, 0x53, 0x65, 0x2a, 0x67, 0xf2, 0x66, 0xb8, 0x15, 0x5b, 0x61, 0x0a, - 0x41, 0x11, 0x95, 0x3d, 0xe3, 0x10, 0x60, 0x45, 0xf5, 0x3b, 0x42, 0x14, 0x4d, 0x53, 0xf4, 0x02, - 0x6c, 0x46, 0x5c, 0x6b, 0x64, 0x4d, 0x2e, 0xe6, 0xed, 0x3c, 0xf3, 0xed, 0xe5, 0x02, 0xdb, 0x8c, - 0x98, 0xbc, 0x74, 0xed, 0x5a, 0x3e, 0xc4, 0x36, 0x93, 0x08, 0x81, 0x23, 0x85, 0xd2, 0x6e, 0x73, - 0x64, 0x4d, 0xfa, 0xd8, 0xc4, 0xe3, 0x4f, 0x30, 0x08, 0x8b, 0xd5, 0xb1, 0x48, 0x3e, 0x53, 0x95, - 0x32, 0xc1, 0xd1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0xff, 0x4b, 0x71, 0xa6, 0xe1, 0xc7, 0xa2, - 0xb3, 0xd2, 0xa3, 0x1c, 0x1b, 0x6f, 0x60, 0xf8, 0x54, 0x13, 0xba, 0x86, 0xae, 0x3e, 0xac, 0x19, - 0x27, 0xf4, 0x50, 0x3a, 0x04, 0x77, 0xf4, 0x61, 0x59, 0x40, 0x14, 0x40, 0x4f, 0xc9, 0xd8, 0xbc, - 0x4e, 0xd3, 0xb4, 0x12, 0xed, 0x59, 0x9e, 0xf9, 0x80, 0xc3, 0xf7, 0x95, 0xb7, 0x30, 0x28, 0x19, - 0x57, 0xf1, 0xfc, 0xc3, 0x43, 0xee, 0x59, 0x8f, 0xb9, 0x67, 0xfd, 0xca, 0x3d, 0xeb, 0xc7, 0xd1, - 0x6b, 0x3c, 0x1e, 0xbd, 0xc6, 0xcf, 0xa3, 0xd7, 0xf8, 0xf2, 0x6a, 0xcb, 0xf4, 0xee, 0x7e, 0x33, - 0x8d, 0xc5, 0x5d, 0x90, 0x30, 0x4e, 0x83, 0x7f, 0xee, 0x36, 0xd6, 0xad, 0x9b, 0x7d, 0xd3, 0x36, - 0xb9, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x34, 0x79, 0x6e, 0x87, 0x03, 0x03, 0x00, 0x00, -} - -func (m *NetAddress) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NetAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Port != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x18 - } - if len(m.IP) > 0 { - i -= len(m.IP) - copy(dAtA[i:], m.IP) - i = encodeVarintTypes(dAtA, i, uint64(len(m.IP))) - i-- - dAtA[i] = 0x12 - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProtocolVersion) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtocolVersion) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtocolVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.App != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.App)) - i-- - dAtA[i] = 0x18 - } - if m.Block != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x10 - } - if m.P2P != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.P2P)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DefaultNodeInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefaultNodeInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DefaultNodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Other.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0x3a - } - if len(m.Channels) > 0 { - i -= len(m.Channels) - copy(dAtA[i:], m.Channels) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Channels))) - i-- - dAtA[i] = 0x32 - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x2a - } - if len(m.Network) > 0 { - i -= len(m.Network) - copy(dAtA[i:], m.Network) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Network))) - i-- - dAtA[i] = 0x22 - } - if len(m.ListenAddr) > 0 { - i -= len(m.ListenAddr) - copy(dAtA[i:], m.ListenAddr) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ListenAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.DefaultNodeID) > 0 { - i -= len(m.DefaultNodeID) - copy(dAtA[i:], m.DefaultNodeID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.DefaultNodeID))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.ProtocolVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *DefaultNodeInfoOther) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefaultNodeInfoOther) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DefaultNodeInfoOther) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RPCAddress) > 0 { - i -= len(m.RPCAddress) - copy(dAtA[i:], m.RPCAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.RPCAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.TxIndex) > 0 { - i -= len(m.TxIndex) - copy(dAtA[i:], m.TxIndex) - i = encodeVarintTypes(dAtA, i, uint64(len(m.TxIndex))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *NetAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.IP) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Port != 0 { - n += 1 + sovTypes(uint64(m.Port)) - } - return n -} - -func (m *ProtocolVersion) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.P2P != 0 { - n += 1 + sovTypes(uint64(m.P2P)) - } - if m.Block != 0 { - n += 1 + sovTypes(uint64(m.Block)) - } - if m.App != 0 { - n += 1 + sovTypes(uint64(m.App)) - } - return n -} - -func (m *DefaultNodeInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ProtocolVersion.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.DefaultNodeID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ListenAddr) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Network) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Channels) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Other.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *DefaultNodeInfoOther) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TxIndex) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.RPCAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *NetAddress) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NetAddress: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NetAddress: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtocolVersion) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtocolVersion: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtocolVersion: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field P2P", wireType) - } - m.P2P = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.P2P |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - m.App = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.App |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DefaultNodeInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefaultNodeInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefaultNodeInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProtocolVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProtocolVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultNodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DefaultNodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListenAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ListenAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Network = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Channels = append(m.Channels[:0], dAtA[iNdEx:postIndex]...) - if m.Channels == nil { - m.Channels = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Other", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Other.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DefaultNodeInfoOther) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefaultNodeInfoOther: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefaultNodeInfoOther: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RPCAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RPCAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/test/fuzz/p2p/pex/init-corpus/main.go b/test/fuzz/p2p/pex/init-corpus/main.go index f95d392ba..5a050f505 100644 --- a/test/fuzz/p2p/pex/init-corpus/main.go +++ b/test/fuzz/p2p/pex/init-corpus/main.go @@ -10,9 +10,10 @@ import ( "os" "path/filepath" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/p2p" - tmp2p "github.com/line/ostracon/proto/ostracon/p2p" ) func main() { diff --git a/proto/ostracon/p2p/pex.proto b/third_party/proto/tendermint/p2p/pex.proto similarity index 65% rename from proto/ostracon/p2p/pex.proto rename to third_party/proto/tendermint/p2p/pex.proto index 1439e6ac6..dfe238dbe 100644 --- a/proto/ostracon/p2p/pex.proto +++ b/third_party/proto/tendermint/p2p/pex.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package ostracon.p2p; +package tendermint.p2p; -option go_package = "github.com/line/ostracon/proto/ostracon/p2p"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; -import "ostracon/p2p/types.proto"; +import "tendermint/p2p/types.proto"; import "gogoproto/gogo.proto"; message PexRequest {} diff --git a/proto/ostracon/p2p/types.proto b/third_party/proto/tendermint/p2p/types.proto similarity index 90% rename from proto/ostracon/p2p/types.proto rename to third_party/proto/tendermint/p2p/types.proto index 4db191263..0d42ea400 100644 --- a/proto/ostracon/p2p/types.proto +++ b/third_party/proto/tendermint/p2p/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package ostracon.p2p; +package tendermint.p2p; -option go_package = "github.com/line/ostracon/proto/ostracon/p2p"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; import "gogoproto/gogo.proto"; From 7235ef135615a2aeb27be67ffaed41052c1dfa66 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 6 Jan 2023 22:09:35 +0900 Subject: [PATCH 03/25] feat: clean up `proto/ostracon/store/` directory proto --- proto/ostracon/store/types.pb.go | 334 ------------------ proto/ostracon/store/types.proto | 9 - store/store.go | 3 +- store/store_test.go | 3 +- .../proto/tendermint/store/types.proto | 9 + 5 files changed, 13 insertions(+), 345 deletions(-) delete mode 100644 proto/ostracon/store/types.pb.go delete mode 100644 proto/ostracon/store/types.proto create mode 100644 third_party/proto/tendermint/store/types.proto diff --git a/proto/ostracon/store/types.pb.go b/proto/ostracon/store/types.pb.go deleted file mode 100644 index a57abe157..000000000 --- a/proto/ostracon/store/types.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/store/types.proto - -package store - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type BlockStoreState struct { - Base int64 `protobuf:"varint,1,opt,name=base,proto3" json:"base,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *BlockStoreState) Reset() { *m = BlockStoreState{} } -func (m *BlockStoreState) String() string { return proto.CompactTextString(m) } -func (*BlockStoreState) ProtoMessage() {} -func (*BlockStoreState) Descriptor() ([]byte, []int) { - return fileDescriptor_429926436d348b85, []int{0} -} -func (m *BlockStoreState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockStoreState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockStoreState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BlockStoreState) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockStoreState.Merge(m, src) -} -func (m *BlockStoreState) XXX_Size() int { - return m.Size() -} -func (m *BlockStoreState) XXX_DiscardUnknown() { - xxx_messageInfo_BlockStoreState.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockStoreState proto.InternalMessageInfo - -func (m *BlockStoreState) GetBase() int64 { - if m != nil { - return m.Base - } - return 0 -} - -func (m *BlockStoreState) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func init() { - proto.RegisterType((*BlockStoreState)(nil), "ostracon.store.BlockStoreState") -} - -func init() { proto.RegisterFile("ostracon/store/types.proto", fileDescriptor_429926436d348b85) } - -var fileDescriptor_429926436d348b85 = []byte{ - // 166 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x2f, 0x2e, 0x29, - 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xc9, 0xe9, 0x81, 0xe5, 0x94, 0x6c, 0xb9, - 0xf8, 0x9d, 0x72, 0xf2, 0x93, 0xb3, 0x83, 0x41, 0xbc, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x21, - 0x2e, 0x96, 0xa4, 0xc4, 0xe2, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x30, 0x5b, 0x48, - 0x8c, 0x8b, 0x2d, 0x23, 0x35, 0x33, 0x3d, 0xa3, 0x44, 0x82, 0x09, 0x2c, 0x0a, 0xe5, 0x39, 0xb9, - 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, - 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x6e, 0x7a, 0x66, 0x49, 0x46, - 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x4e, 0x66, 0x5e, 0xaa, 0x3e, 0xdc, 0x51, 0x60, 0x87, - 0xe8, 0xa3, 0xba, 0x31, 0x89, 0x0d, 0x2c, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x79, 0x5d, - 0xc8, 0x90, 0xbc, 0x00, 0x00, 0x00, -} - -func (m *BlockStoreState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockStoreState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockStoreState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if m.Base != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Base)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BlockStoreState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Base != 0 { - n += 1 + sovTypes(uint64(m.Base)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BlockStoreState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockStoreState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockStoreState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) - } - m.Base = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Base |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/store/types.proto b/proto/ostracon/store/types.proto deleted file mode 100644 index 11cab895b..000000000 --- a/proto/ostracon/store/types.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package ostracon.store; - -option go_package = "github.com/line/ostracon/proto/ostracon/store"; - -message BlockStoreState { - int64 base = 1; - int64 height = 2; -} diff --git a/store/store.go b/store/store.go index 51d8ad27b..3c1bd5c02 100644 --- a/store/store.go +++ b/store/store.go @@ -7,8 +7,9 @@ import ( "github.com/gogo/protobuf/proto" dbm "github.com/tendermint/tm-db" + tmstore "github.com/tendermint/tendermint/proto/tendermint/store" + tmsync "github.com/line/ostracon/libs/sync" - tmstore "github.com/line/ostracon/proto/ostracon/store" tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/store/store_test.go b/store/store_test.go index b78b7f14d..a44d238be 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -14,11 +14,12 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" + tmstore "github.com/tendermint/tendermint/proto/tendermint/store" + cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto" "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" - tmstore "github.com/line/ostracon/proto/ostracon/store" tmversion "github.com/line/ostracon/proto/ostracon/version" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" diff --git a/third_party/proto/tendermint/store/types.proto b/third_party/proto/tendermint/store/types.proto new file mode 100644 index 000000000..af2f97ad0 --- /dev/null +++ b/third_party/proto/tendermint/store/types.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package tendermint.store; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/store"; + +message BlockStoreState { + int64 base = 1; + int64 height = 2; +} From 89527e3eef713b9968a0160616e8edfdae67431b Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 6 Jan 2023 22:40:53 +0900 Subject: [PATCH 04/25] feat: clean up `crypto`, `mempool` and `statesync` directory proto --- abci/cmd/abci-cli/abci-cli.go | 12 +- abci/types/types.pb.go | 379 ++-- crypto/merkle/proof.go | 3 +- crypto/merkle/proof_op.go | 2 +- crypto/merkle/proof_test.go | 2 +- crypto/merkle/proof_value.go | 3 +- mempool/reactor.go | 3 +- mempool/reactor_test.go | 3 +- proto/ostracon/abci/types.proto | 4 +- proto/ostracon/crypto/proof.pb.go | 1422 -------------- proto/ostracon/mempool/types.pb.go | 556 ------ proto/ostracon/statesync/types.pb.go | 1628 ----------------- proto/ostracon/types/types.pb.go | 161 +- proto/ostracon/types/types.proto | 6 +- statesync/messages.go | 2 +- statesync/messages_test.go | 3 +- statesync/reactor.go | 3 +- statesync/reactor_test.go | 3 +- statesync/syncer.go | 3 +- statesync/syncer_test.go | 3 +- .../proto/tendermint/crypto/keys.proto | 17 + .../proto/tendermint}/crypto/proof.proto | 4 +- .../proto/tendermint}/mempool/types.proto | 4 +- .../proto/tendermint}/statesync/types.proto | 4 +- 24 files changed, 325 insertions(+), 3905 deletions(-) delete mode 100644 proto/ostracon/crypto/proof.pb.go delete mode 100644 proto/ostracon/mempool/types.pb.go delete mode 100644 proto/ostracon/statesync/types.pb.go create mode 100644 third_party/proto/tendermint/crypto/keys.proto rename {proto/ostracon => third_party/proto/tendermint}/crypto/proof.proto (88%) rename {proto/ostracon => third_party/proto/tendermint}/mempool/types.proto (52%) rename {proto/ostracon => third_party/proto/tendermint}/statesync/types.proto (85%) diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 6b0e80fd0..134c04219 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -11,12 +11,8 @@ import ( "path/filepath" "strings" - "github.com/line/ostracon/config" - "github.com/spf13/cobra" - - "github.com/line/ostracon/libs/log" - tmos "github.com/line/ostracon/libs/os" + tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/code" @@ -26,8 +22,10 @@ import ( servertest "github.com/line/ostracon/abci/tests/server" "github.com/line/ostracon/abci/types" "github.com/line/ostracon/abci/version" + "github.com/line/ostracon/config" "github.com/line/ostracon/crypto/encoding" - "github.com/line/ostracon/proto/ostracon/crypto" + "github.com/line/ostracon/libs/log" + tmos "github.com/line/ostracon/libs/os" ) // client is a global variable so it can be reused by the console @@ -109,7 +107,7 @@ type queryResponse struct { Key []byte Value []byte Height int64 - ProofOps *crypto.ProofOps + ProofOps *tmcrypto.ProofOps } func Execute() error { diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 743a92be0..d66a77e5b 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -10,8 +10,9 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - crypto "github.com/line/ostracon/proto/ostracon/crypto" + crypto1 "github.com/line/ostracon/proto/ostracon/crypto" types1 "github.com/line/ostracon/proto/ostracon/types" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -3137,8 +3138,8 @@ func (m *Validator) GetPower() int64 { // ValidatorUpdate type ValidatorUpdate struct { - PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` + PubKey crypto1.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` + Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` } func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } @@ -3174,11 +3175,11 @@ func (m *ValidatorUpdate) XXX_DiscardUnknown() { var xxx_messageInfo_ValidatorUpdate proto.InternalMessageInfo -func (m *ValidatorUpdate) GetPubKey() crypto.PublicKey { +func (m *ValidatorUpdate) GetPubKey() crypto1.PublicKey { if m != nil { return m.PubKey } - return crypto.PublicKey{} + return crypto1.PublicKey{} } func (m *ValidatorUpdate) GetPower() int64 { @@ -3457,190 +3458,190 @@ func init() { func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_addf585b2317eb36) } var fileDescriptor_addf585b2317eb36 = []byte{ - // 2914 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0x4b, 0x73, 0xe3, 0xc6, - 0x11, 0xe6, 0xfb, 0xd1, 0x12, 0x29, 0x6a, 0x56, 0xde, 0xe5, 0x62, 0x6d, 0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x0f, 0x8f, 0xc5, 0x7b, 0x68, 0x53, 0xad, - 0xde, 0x59, 0x37, 0xa3, 0x94, 0x07, 0xfc, 0x92, 0xce, 0x7b, 0x88, 0x27, 0xfa, 0x29, 0xb6, 0xa9, - 0x75, 0x35, 0x6d, 0xde, 0x77, 0xb8, 0x1e, 0xb3, 0xaf, 0x0e, 0xdd, 0x01, 0x7a, 0x15, 0xaa, 0xd8, - 0x18, 0x8a, 0x09, 0x00, 0x73, 0xb0, 0x9e, 0x10, 0x19, 0xc6, 0xd0, 0x7d, 0xfd, 0x0a, 0x16, 0xd7, - 0xe8, 0x05, 0x28, 0x0d, 0xcc, 0xe9, 0x54, 0x27, 0xcd, 0x25, 0x66, 0xfb, 0x68, 0xc2, 0xab, 0x33, - 0x9d, 0x6e, 0x46, 0x11, 0xda, 0x68, 0x0f, 0xea, 0x13, 0xdd, 0x21, 0xaa, 0x63, 0x68, 0x96, 0x33, - 0x36, 0x89, 0xd3, 0x5c, 0x66, 0xf6, 0x37, 0xe2, 0xed, 0xf7, 0x74, 0x87, 0x1c, 0xb9, 0xaa, 0xdd, - 0x8c, 0x52, 0x9b, 0x04, 0x05, 0xd4, 0x9b, 0x79, 0x72, 0x82, 0x6d, 0xcf, 0x5d, 0xb3, 0x96, 0xe6, - 0xed, 0x80, 0xea, 0xba, 0xd6, 0xd4, 0x9b, 0x19, 0x14, 0xa0, 0x77, 0xe0, 0xd2, 0xc4, 0xd4, 0x86, - 0x9e, 0x33, 0x75, 0x30, 0x9e, 0x19, 0xf7, 0x9b, 0x75, 0xe6, 0xf2, 0x89, 0x84, 0x17, 0x34, 0xb5, - 0xa1, 0xeb, 0xa0, 0x4d, 0xd5, 0xbb, 0x19, 0x65, 0x75, 0x12, 0x15, 0xa2, 0xf7, 0x61, 0x4d, 0xb3, - 0xac, 0xc9, 0x79, 0xd4, 0xf7, 0x0a, 0xf3, 0xfd, 0x64, 0xbc, 0xef, 0x16, 0xb5, 0x88, 0x3a, 0x47, - 0xda, 0x05, 0x29, 0xba, 0x07, 0x0d, 0x1e, 0x8e, 0x36, 0xf6, 0x22, 0xea, 0xaf, 0x3c, 0x28, 0xbf, - 0x9d, 0x12, 0x94, 0x0a, 0x1e, 0x78, 0x91, 0x55, 0xef, 0x87, 0x24, 0x68, 0x17, 0xea, 0x34, 0x3c, - 0x02, 0x0e, 0xff, 0xc6, 0x1d, 0xca, 0x89, 0x41, 0x12, 0x74, 0xb7, 0x8c, 0x03, 0xe3, 0xed, 0x32, - 0x14, 0x4f, 0xb5, 0xc9, 0x0c, 0xcb, 0x4f, 0xc0, 0x52, 0x00, 0x6e, 0x50, 0x13, 0xca, 0x53, 0xec, - 0x38, 0xda, 0x08, 0x33, 0x6c, 0xaa, 0x2a, 0xee, 0x50, 0xae, 0xc3, 0x72, 0x10, 0x64, 0xe4, 0xa9, - 0x67, 0x48, 0x01, 0x84, 0x1a, 0x9e, 0x62, 0xdb, 0xa1, 0xa8, 0x21, 0x0c, 0xc5, 0x10, 0xdd, 0x80, - 0x1a, 0x0b, 0x69, 0xd5, 0xbd, 0x4f, 0x11, 0xac, 0xa0, 0x2c, 0x33, 0xe1, 0xb1, 0x50, 0xda, 0x80, - 0x25, 0xeb, 0x96, 0xe5, 0xa9, 0xe4, 0x99, 0x0a, 0x58, 0xb7, 0x2c, 0xa1, 0x20, 0xbf, 0x0c, 0x8d, - 0x28, 0xee, 0xa0, 0x06, 0xe4, 0xef, 0xe3, 0x73, 0xf1, 0x3c, 0x7a, 0x89, 0xd6, 0xc4, 0xb4, 0xd8, - 0x33, 0xaa, 0x8a, 0x98, 0xe3, 0xef, 0x73, 0x9e, 0xb1, 0x07, 0x39, 0xe8, 0xfb, 0x50, 0xa0, 0xb8, - 0xed, 0x41, 0x30, 0x07, 0xf5, 0x4d, 0x17, 0xd4, 0x37, 0x7b, 0x2e, 0xa8, 0x6f, 0x57, 0x3e, 0xff, - 0x72, 0x23, 0xf3, 0xe9, 0x9f, 0x36, 0xb2, 0x0a, 0xb3, 0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4e, 0x75, 0x82, 0xa7, - 0x16, 0x39, 0x57, 0x84, 0xb5, 0xfc, 0xc7, 0x1c, 0xe5, 0x9b, 0xa1, 0x34, 0x13, 0xbb, 0xae, 0xee, - 0xc1, 0xc9, 0x05, 0x6a, 0x8c, 0xc5, 0xd6, 0x7a, 0x1d, 0x60, 0xa4, 0x39, 0xea, 0xc7, 0x9a, 0x41, - 0xf0, 0x50, 0x2c, 0x78, 0x40, 0x82, 0x24, 0xa8, 0xd0, 0xd1, 0xcc, 0xc1, 0x43, 0x51, 0xee, 0x78, - 0xe3, 0xc0, 0x2c, 0xcb, 0xdf, 0x64, 0x96, 0xe1, 0x15, 0xae, 0x44, 0x56, 0x38, 0xc0, 0x05, 0xab, - 0x41, 0x2e, 0x48, 0xdf, 0xcc, 0xb2, 0x75, 0xd3, 0xd6, 0xc9, 0x39, 0xdb, 0x96, 0xbc, 0xe2, 0x8d, - 0x69, 0x3d, 0x3d, 0xc5, 0x53, 0xcb, 0x34, 0x27, 0x2a, 0x87, 0xac, 0x25, 0x66, 0xba, 0x2c, 0x84, - 0x1d, 0x86, 0x5c, 0x3f, 0xcf, 0xf9, 0x87, 0xce, 0x67, 0xfc, 0xff, 0x67, 0xcb, 0x2b, 0xff, 0x82, - 0x15, 0xfe, 0x61, 0x22, 0x81, 0xee, 0xc1, 0xaa, 0x77, 0xec, 0xd5, 0x19, 0x83, 0x03, 0x37, 0x94, - 0x17, 0x43, 0x8d, 0xc6, 0x69, 0x58, 0xec, 0xa0, 0x63, 0xb8, 0x12, 0x01, 0x33, 0xcf, 0x71, 0x6e, - 0x21, 0x4c, 0x7b, 0x24, 0x8c, 0x69, 0xae, 0x5f, 0x7f, 0x95, 0xf2, 0xdf, 0xe8, 0xa8, 0xed, 0xd0, - 0x7a, 0x32, 0x48, 0x89, 0x62, 0x77, 0xfd, 0x06, 0xd4, 0x6c, 0x4c, 0x34, 0xdd, 0x50, 0x43, 0xb5, - 0xfa, 0x32, 0x17, 0x8a, 0x0e,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xc4, 0xa2, 0x77, 0xa1, 0x16, 0x66, 0xfe, 0x8b, 0xfc, 0x28, 0x20, 0x2d, 0xd4, 0x61, 0xa5, - 0xbe, 0xc3, 0x45, 0xc0, 0x22, 0xbf, 0x0d, 0x48, 0x0b, 0xb5, 0x5b, 0xd1, 0x09, 0xac, 0x5e, 0xa4, - 0xe8, 0x8b, 0xfe, 0x43, 0x20, 0x2d, 0xdc, 0x7e, 0x45, 0x3a, 0xa0, 0x18, 0x5a, 0xbf, 0xf0, 0x0f, - 0x05, 0xd2, 0xe2, 0xbd, 0x58, 0xf4, 0x01, 0xd4, 0x23, 0x4c, 0x79, 0xa1, 0x9f, 0x0b, 0xa4, 0xc5, - 0x5a, 0xb2, 0xe8, 0x6d, 0x58, 0x0e, 0x51, 0xeb, 0x05, 0x7e, 0x34, 0x90, 0x16, 0xe9, 0xcd, 0x6e, - 0xbf, 0xfa, 0xf9, 0x57, 0xeb, 0xd9, 0x2f, 0xbe, 0x5a, 0xcf, 0xfe, 0xf9, 0xab, 0xf5, 0xec, 0xa7, - 0x0f, 0xd6, 0x33, 0x5f, 0x3c, 0x58, 0xcf, 0xfc, 0xe1, 0xc1, 0x7a, 0xe6, 0xdd, 0x1b, 0x23, 0x9d, - 0x8c, 0x67, 0xfd, 0xcd, 0x81, 0x39, 0xdd, 0x9a, 0xe8, 0x06, 0xde, 0x8a, 0xf9, 0x0f, 0xac, 0x5f, - 0x62, 0xc9, 0xf1, 0xf6, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xee, 0xae, 0xb1, 0x25, 0x26, - 0x00, 0x00, + // 2919 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0x4b, 0x73, 0x23, 0xd5, + 0x15, 0xd6, 0x5b, 0xea, 0x63, 0x4b, 0x96, 0xef, 0x98, 0x19, 0xd1, 0x03, 0xf6, 0xa4, 0x27, 0x04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0x79, 0x7e, 0xfd, 0x17, 0xed, 0x42, 0xcd, 0x4f, 0x7f, + 0xe6, 0xfc, 0x54, 0x20, 0xcf, 0x2b, 0xc5, 0xa2, 0x77, 0xa0, 0x1e, 0x65, 0xfe, 0x8b, 0xfc, 0x2a, + 0x20, 0x2f, 0x54, 0x63, 0xa5, 0xbe, 0xa3, 0x49, 0xc0, 0x22, 0x3f, 0x0e, 0xc8, 0x0b, 0x15, 0x5c, + 0xd1, 0x31, 0xac, 0x5e, 0xa4, 0xe8, 0x8b, 0xfe, 0x45, 0x20, 0x2f, 0x5c, 0x80, 0x45, 0x06, 0xa0, + 0x04, 0x5a, 0xbf, 0xf0, 0x2f, 0x05, 0xf2, 0xe2, 0xd5, 0x58, 0xf4, 0x3e, 0x34, 0x62, 0x4c, 0x79, + 0xa1, 0xdf, 0x0b, 0xe4, 0xc5, 0x8a, 0xb2, 0xe8, 0x2d, 0x58, 0x8e, 0x50, 0xeb, 0x05, 0x7e, 0x35, + 0x90, 0x17, 0xa9, 0xce, 0x6e, 0xbf, 0xf2, 0xd9, 0x97, 0xeb, 0xf9, 0xcf, 0xbf, 0x5c, 0xcf, 0xff, + 0xf5, 0xcb, 0xf5, 0xfc, 0x27, 0x5f, 0xad, 0xe7, 0x3e, 0xff, 0x6a, 0x3d, 0xf7, 0xa7, 0xaf, 0xd6, + 0x73, 0xef, 0x5c, 0x3f, 0x31, 0xc8, 0x78, 0x36, 0xd8, 0x1c, 0x5a, 0xd3, 0xad, 0x89, 0x61, 0xe2, + 0xad, 0x84, 0x7f, 0xc1, 0x06, 0x15, 0x16, 0x1c, 0x6f, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0x91, + 0x00, 0x74, 0x9c, 0x29, 0x26, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/crypto/merkle/proof.go b/crypto/merkle/proof.go index 14f27e4d8..e9c65e9d7 100644 --- a/crypto/merkle/proof.go +++ b/crypto/merkle/proof.go @@ -5,8 +5,9 @@ import ( "errors" "fmt" + tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + "github.com/line/ostracon/crypto/tmhash" - tmcrypto "github.com/line/ostracon/proto/ostracon/crypto" ) const ( diff --git a/crypto/merkle/proof_op.go b/crypto/merkle/proof_op.go index dc98b5ce5..038037cf5 100644 --- a/crypto/merkle/proof_op.go +++ b/crypto/merkle/proof_op.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - tmcrypto "github.com/line/ostracon/proto/ostracon/crypto" + tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" ) //---------------------------------------- diff --git a/crypto/merkle/proof_test.go b/crypto/merkle/proof_test.go index 625512487..22ab900f0 100644 --- a/crypto/merkle/proof_test.go +++ b/crypto/merkle/proof_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmcrypto "github.com/line/ostracon/proto/ostracon/crypto" + tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" ) const ProofOpDomino = "test:domino" diff --git a/crypto/merkle/proof_value.go b/crypto/merkle/proof_value.go index ce3214938..c7c8868f5 100644 --- a/crypto/merkle/proof_value.go +++ b/crypto/merkle/proof_value.go @@ -4,8 +4,9 @@ import ( "bytes" "fmt" + tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + "github.com/line/ostracon/crypto/tmhash" - tmcrypto "github.com/line/ostracon/proto/ostracon/crypto" ) const ProofOpValue = "simple:v" diff --git a/mempool/reactor.go b/mempool/reactor.go index e22aa8053..aa67c613c 100644 --- a/mempool/reactor.go +++ b/mempool/reactor.go @@ -6,12 +6,13 @@ import ( "math" "time" + protomem "github.com/tendermint/tendermint/proto/tendermint/mempool" + cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/clist" "github.com/line/ostracon/libs/log" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" - protomem "github.com/line/ostracon/proto/ostracon/mempool" "github.com/line/ostracon/types" ) diff --git a/mempool/reactor_test.go b/mempool/reactor_test.go index 277a6e749..15acd97e6 100644 --- a/mempool/reactor_test.go +++ b/mempool/reactor_test.go @@ -13,6 +13,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + memproto "github.com/tendermint/tendermint/proto/tendermint/mempool" + "github.com/line/ostracon/abci/example/kvstore" abci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" @@ -20,7 +22,6 @@ import ( tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/p2p" "github.com/line/ostracon/p2p/mock" - memproto "github.com/line/ostracon/proto/ostracon/mempool" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" ) diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index 38b47294c..a7c1a9144 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -5,7 +5,7 @@ option go_package = "github.com/line/ostracon/abci/types"; // For more information on gogo.proto, see: // https://github.com/gogo/protobuf/blob/master/extensions.md -import "ostracon/crypto/proof.proto"; +import "tendermint/crypto/proof.proto"; import "ostracon/types/types.proto"; import "ostracon/crypto/keys.proto"; import "ostracon/types/params.proto"; @@ -204,7 +204,7 @@ message ResponseQuery { int64 index = 5; bytes key = 6; bytes value = 7; - ostracon.crypto.ProofOps proof_ops = 8; + tendermint.crypto.ProofOps proof_ops = 8; int64 height = 9; string codespace = 10; } diff --git a/proto/ostracon/crypto/proof.pb.go b/proto/ostracon/crypto/proof.pb.go deleted file mode 100644 index d9052b871..000000000 --- a/proto/ostracon/crypto/proof.pb.go +++ /dev/null @@ -1,1422 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/crypto/proof.proto - -package crypto - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Proof struct { - Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - LeafHash []byte `protobuf:"bytes,3,opt,name=leaf_hash,json=leafHash,proto3" json:"leaf_hash,omitempty"` - Aunts [][]byte `protobuf:"bytes,4,rep,name=aunts,proto3" json:"aunts,omitempty"` -} - -func (m *Proof) Reset() { *m = Proof{} } -func (m *Proof) String() string { return proto.CompactTextString(m) } -func (*Proof) ProtoMessage() {} -func (*Proof) Descriptor() ([]byte, []int) { - return fileDescriptor_465438feca9dfd7e, []int{0} -} -func (m *Proof) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proof.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Proof) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proof.Merge(m, src) -} -func (m *Proof) XXX_Size() int { - return m.Size() -} -func (m *Proof) XXX_DiscardUnknown() { - xxx_messageInfo_Proof.DiscardUnknown(m) -} - -var xxx_messageInfo_Proof proto.InternalMessageInfo - -func (m *Proof) GetTotal() int64 { - if m != nil { - return m.Total - } - return 0 -} - -func (m *Proof) GetIndex() int64 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *Proof) GetLeafHash() []byte { - if m != nil { - return m.LeafHash - } - return nil -} - -func (m *Proof) GetAunts() [][]byte { - if m != nil { - return m.Aunts - } - return nil -} - -type ValueOp struct { - // Encoded in ProofOp.Key. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // To encode in ProofOp.Data - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (m *ValueOp) Reset() { *m = ValueOp{} } -func (m *ValueOp) String() string { return proto.CompactTextString(m) } -func (*ValueOp) ProtoMessage() {} -func (*ValueOp) Descriptor() ([]byte, []int) { - return fileDescriptor_465438feca9dfd7e, []int{1} -} -func (m *ValueOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValueOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValueOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValueOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValueOp.Merge(m, src) -} -func (m *ValueOp) XXX_Size() int { - return m.Size() -} -func (m *ValueOp) XXX_DiscardUnknown() { - xxx_messageInfo_ValueOp.DiscardUnknown(m) -} - -var xxx_messageInfo_ValueOp proto.InternalMessageInfo - -func (m *ValueOp) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ValueOp) GetProof() *Proof { - if m != nil { - return m.Proof - } - return nil -} - -type DominoOp struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Input string `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` - Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` -} - -func (m *DominoOp) Reset() { *m = DominoOp{} } -func (m *DominoOp) String() string { return proto.CompactTextString(m) } -func (*DominoOp) ProtoMessage() {} -func (*DominoOp) Descriptor() ([]byte, []int) { - return fileDescriptor_465438feca9dfd7e, []int{2} -} -func (m *DominoOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DominoOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DominoOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DominoOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_DominoOp.Merge(m, src) -} -func (m *DominoOp) XXX_Size() int { - return m.Size() -} -func (m *DominoOp) XXX_DiscardUnknown() { - xxx_messageInfo_DominoOp.DiscardUnknown(m) -} - -var xxx_messageInfo_DominoOp proto.InternalMessageInfo - -func (m *DominoOp) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *DominoOp) GetInput() string { - if m != nil { - return m.Input - } - return "" -} - -func (m *DominoOp) GetOutput() string { - if m != nil { - return m.Output - } - return "" -} - -// ProofOp defines an operation used for calculating Merkle root -// The data could be arbitrary format, providing nessecary data -// for example neighbouring node hash -type ProofOp struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *ProofOp) Reset() { *m = ProofOp{} } -func (m *ProofOp) String() string { return proto.CompactTextString(m) } -func (*ProofOp) ProtoMessage() {} -func (*ProofOp) Descriptor() ([]byte, []int) { - return fileDescriptor_465438feca9dfd7e, []int{3} -} -func (m *ProofOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProofOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProofOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProofOp.Merge(m, src) -} -func (m *ProofOp) XXX_Size() int { - return m.Size() -} -func (m *ProofOp) XXX_DiscardUnknown() { - xxx_messageInfo_ProofOp.DiscardUnknown(m) -} - -var xxx_messageInfo_ProofOp proto.InternalMessageInfo - -func (m *ProofOp) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ProofOp) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ProofOp) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// ProofOps is Merkle proof defined by the list of ProofOps -type ProofOps struct { - Ops []ProofOp `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops"` -} - -func (m *ProofOps) Reset() { *m = ProofOps{} } -func (m *ProofOps) String() string { return proto.CompactTextString(m) } -func (*ProofOps) ProtoMessage() {} -func (*ProofOps) Descriptor() ([]byte, []int) { - return fileDescriptor_465438feca9dfd7e, []int{4} -} -func (m *ProofOps) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProofOps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProofOps.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProofOps) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProofOps.Merge(m, src) -} -func (m *ProofOps) XXX_Size() int { - return m.Size() -} -func (m *ProofOps) XXX_DiscardUnknown() { - xxx_messageInfo_ProofOps.DiscardUnknown(m) -} - -var xxx_messageInfo_ProofOps proto.InternalMessageInfo - -func (m *ProofOps) GetOps() []ProofOp { - if m != nil { - return m.Ops - } - return nil -} - -func init() { - proto.RegisterType((*Proof)(nil), "ostracon.crypto.Proof") - proto.RegisterType((*ValueOp)(nil), "ostracon.crypto.ValueOp") - proto.RegisterType((*DominoOp)(nil), "ostracon.crypto.DominoOp") - proto.RegisterType((*ProofOp)(nil), "ostracon.crypto.ProofOp") - proto.RegisterType((*ProofOps)(nil), "ostracon.crypto.ProofOps") -} - -func init() { proto.RegisterFile("ostracon/crypto/proof.proto", fileDescriptor_465438feca9dfd7e) } - -var fileDescriptor_465438feca9dfd7e = []byte{ - // 354 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0x3d, 0x6f, 0xe2, 0x40, - 0x10, 0xb5, 0xb1, 0xf9, 0x1a, 0x90, 0xee, 0xb4, 0x42, 0xc8, 0x3a, 0x24, 0x9f, 0xe5, 0xca, 0xc5, - 0xc9, 0x3e, 0x91, 0x36, 0x15, 0x49, 0x41, 0xd2, 0x10, 0x6d, 0x91, 0x22, 0x4d, 0xb4, 0x80, 0xc1, - 0x56, 0x8c, 0x67, 0x65, 0xaf, 0xa5, 0xf0, 0x2f, 0xf2, 0xb3, 0x28, 0x29, 0x53, 0x45, 0x11, 0xfc, - 0x91, 0x68, 0x77, 0x4d, 0xa2, 0xa0, 0x74, 0xef, 0xbd, 0x99, 0x79, 0xf3, 0x46, 0x03, 0x23, 0x2c, - 0x45, 0xc1, 0x16, 0x98, 0x47, 0x8b, 0x62, 0xcb, 0x05, 0x46, 0xbc, 0x40, 0x5c, 0x85, 0xbc, 0x40, - 0x81, 0xe4, 0xd7, 0xa9, 0x18, 0xea, 0xe2, 0x9f, 0xc1, 0x1a, 0xd7, 0xa8, 0x6a, 0x91, 0x44, 0xba, - 0xcd, 0x5f, 0x41, 0xf3, 0x4e, 0x4e, 0x91, 0x01, 0x34, 0x05, 0x0a, 0x96, 0x39, 0xa6, 0x67, 0x06, - 0x16, 0xd5, 0x44, 0xaa, 0x69, 0xbe, 0x8c, 0x9f, 0x9d, 0x86, 0x56, 0x15, 0x21, 0x23, 0xe8, 0x66, - 0x31, 0x5b, 0x3d, 0x26, 0xac, 0x4c, 0x1c, 0xcb, 0x33, 0x83, 0x3e, 0xed, 0x48, 0x61, 0xca, 0xca, - 0x44, 0x8e, 0xb0, 0x2a, 0x17, 0xa5, 0x63, 0x7b, 0x56, 0xd0, 0xa7, 0x9a, 0xf8, 0x37, 0xd0, 0xbe, - 0x67, 0x59, 0x15, 0xcf, 0x38, 0xf9, 0x0d, 0xd6, 0x53, 0xbc, 0x55, 0x7b, 0xfa, 0x54, 0x42, 0xf2, - 0x0f, 0x9a, 0x2a, 0xba, 0xda, 0xd2, 0x1b, 0x0f, 0xc3, 0xb3, 0xec, 0xa1, 0x8a, 0x48, 0x75, 0x93, - 0x7f, 0x0b, 0x9d, 0x6b, 0xdc, 0xa4, 0x39, 0x7e, 0xf7, 0xea, 0x6a, 0x2f, 0x95, 0x98, 0x57, 0x42, - 0x79, 0x75, 0xa9, 0x26, 0x64, 0x08, 0x2d, 0xac, 0x84, 0x94, 0x2d, 0x25, 0xd7, 0xcc, 0xbf, 0x82, - 0xb6, 0xf2, 0x9e, 0x71, 0x42, 0xc0, 0x16, 0x5b, 0x1e, 0xd7, 0x5e, 0x0a, 0x9f, 0xec, 0x1b, 0x5f, - 0x51, 0x09, 0xd8, 0x4b, 0x26, 0x58, 0x7d, 0xb5, 0xc2, 0xfe, 0x25, 0x74, 0x6a, 0x93, 0x92, 0xfc, - 0x07, 0x0b, 0x79, 0xe9, 0x98, 0x9e, 0x15, 0xf4, 0xc6, 0xce, 0xcf, 0x87, 0xcc, 0xf8, 0xc4, 0xde, - 0xbd, 0xfd, 0x35, 0xa8, 0x6c, 0x9d, 0x4c, 0x77, 0x07, 0xd7, 0xdc, 0x1f, 0x5c, 0xf3, 0xfd, 0xe0, - 0x9a, 0x2f, 0x47, 0xd7, 0xd8, 0x1f, 0x5d, 0xe3, 0xf5, 0xe8, 0x1a, 0x0f, 0xe1, 0x3a, 0x15, 0x49, - 0x35, 0x0f, 0x17, 0xb8, 0x89, 0xb2, 0x34, 0x8f, 0xa3, 0xcf, 0x7f, 0xeb, 0x37, 0x9e, 0xbd, 0x7f, - 0xde, 0x52, 0xf2, 0xc5, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x5b, 0xb9, 0x40, 0x18, 0x02, - 0x00, 0x00, -} - -func (m *Proof) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Proof) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Aunts) > 0 { - for iNdEx := len(m.Aunts) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Aunts[iNdEx]) - copy(dAtA[i:], m.Aunts[iNdEx]) - i = encodeVarintProof(dAtA, i, uint64(len(m.Aunts[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.LeafHash) > 0 { - i -= len(m.LeafHash) - copy(dAtA[i:], m.LeafHash) - i = encodeVarintProof(dAtA, i, uint64(len(m.LeafHash))) - i-- - dAtA[i] = 0x1a - } - if m.Index != 0 { - i = encodeVarintProof(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - } - if m.Total != 0 { - i = encodeVarintProof(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ValueOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValueOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValueOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProof(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProof(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DominoOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DominoOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DominoOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Output) > 0 { - i -= len(m.Output) - copy(dAtA[i:], m.Output) - i = encodeVarintProof(dAtA, i, uint64(len(m.Output))) - i-- - dAtA[i] = 0x1a - } - if len(m.Input) > 0 { - i -= len(m.Input) - copy(dAtA[i:], m.Input) - i = encodeVarintProof(dAtA, i, uint64(len(m.Input))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProof(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProofOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProofOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProofOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintProof(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProof(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintProof(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProofOps) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProofOps) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProofOps) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Ops) > 0 { - for iNdEx := len(m.Ops) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ops[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProof(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintProof(dAtA []byte, offset int, v uint64) int { - offset -= sovProof(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Proof) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovProof(uint64(m.Total)) - } - if m.Index != 0 { - n += 1 + sovProof(uint64(m.Index)) - } - l = len(m.LeafHash) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - if len(m.Aunts) > 0 { - for _, b := range m.Aunts { - l = len(b) - n += 1 + l + sovProof(uint64(l)) - } - } - return n -} - -func (m *ValueOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovProof(uint64(l)) - } - return n -} - -func (m *DominoOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Input) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Output) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - return n -} - -func (m *ProofOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - return n -} - -func (m *ProofOps) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Ops) > 0 { - for _, e := range m.Ops { - l = e.Size() - n += 1 + l + sovProof(uint64(l)) - } - } - return n -} - -func sovProof(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProof(x uint64) (n int) { - return sovProof(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Proof) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Proof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeafHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LeafHash = append(m.LeafHash[:0], dAtA[iNdEx:postIndex]...) - if m.LeafHash == nil { - m.LeafHash = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aunts", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aunts = append(m.Aunts, make([]byte, postIndex-iNdEx)) - copy(m.Aunts[len(m.Aunts)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValueOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValueOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValueOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proof == nil { - m.Proof = &Proof{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DominoOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DominoOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DominoOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Input", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Input = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Output = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProofOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProofOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProofOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProofOps) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProofOps: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProofOps: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ops", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ops = append(m.Ops, ProofOp{}) - if err := m.Ops[len(m.Ops)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProof(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProof - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProof - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProof - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProof - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProof - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProof - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProof = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProof = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProof = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/mempool/types.pb.go b/proto/ostracon/mempool/types.pb.go deleted file mode 100644 index 433b89636..000000000 --- a/proto/ostracon/mempool/types.pb.go +++ /dev/null @@ -1,556 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/mempool/types.proto - -package mempool - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Txs struct { - Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` -} - -func (m *Txs) Reset() { *m = Txs{} } -func (m *Txs) String() string { return proto.CompactTextString(m) } -func (*Txs) ProtoMessage() {} -func (*Txs) Descriptor() ([]byte, []int) { - return fileDescriptor_1ae4eaa94a26a893, []int{0} -} -func (m *Txs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Txs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Txs.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Txs) XXX_Merge(src proto.Message) { - xxx_messageInfo_Txs.Merge(m, src) -} -func (m *Txs) XXX_Size() int { - return m.Size() -} -func (m *Txs) XXX_DiscardUnknown() { - xxx_messageInfo_Txs.DiscardUnknown(m) -} - -var xxx_messageInfo_Txs proto.InternalMessageInfo - -func (m *Txs) GetTxs() [][]byte { - if m != nil { - return m.Txs - } - return nil -} - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_Txs - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_1ae4eaa94a26a893, []int{1} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return m.Size() -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_Txs struct { - Txs *Txs `protobuf:"bytes,1,opt,name=txs,proto3,oneof" json:"txs,omitempty"` -} - -func (*Message_Txs) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetTxs() *Txs { - if x, ok := m.GetSum().(*Message_Txs); ok { - return x.Txs - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_Txs)(nil), - } -} - -func init() { - proto.RegisterType((*Txs)(nil), "ostracon.mempool.Txs") - proto.RegisterType((*Message)(nil), "ostracon.mempool.Message") -} - -func init() { proto.RegisterFile("ostracon/mempool/types.proto", fileDescriptor_1ae4eaa94a26a893) } - -var fileDescriptor_1ae4eaa94a26a893 = []byte{ - // 180 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc9, 0x2f, 0x2e, 0x29, - 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0xcf, 0x4d, 0xcd, 0x2d, 0xc8, 0xcf, 0xcf, 0xd1, 0x2f, 0xa9, 0x2c, - 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xea, 0x41, 0x65, 0x95, - 0xc4, 0xb9, 0x98, 0x43, 0x2a, 0x8a, 0x85, 0x04, 0xb8, 0x98, 0x4b, 0x2a, 0x8a, 0x25, 0x18, 0x15, - 0x98, 0x35, 0x78, 0x82, 0x40, 0x4c, 0x25, 0x6b, 0x2e, 0x76, 0xdf, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, - 0x54, 0x21, 0x4d, 0x98, 0x24, 0xa3, 0x06, 0xb7, 0x91, 0xa8, 0x1e, 0xba, 0x19, 0x7a, 0x21, 0x15, - 0xc5, 0x1e, 0x0c, 0x60, 0x5d, 0x4e, 0xac, 0x5c, 0xcc, 0xc5, 0xa5, 0xb9, 0x4e, 0x9e, 0x27, 0x1e, - 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, - 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9f, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, - 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x93, 0x99, 0x97, 0xaa, 0x0f, 0x77, 0x2f, 0xd8, 0x85, 0xfa, 0xe8, - 0xce, 0x4f, 0x62, 0x03, 0x8b, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xb0, 0x0a, 0x7e, - 0xd9, 0x00, 0x00, 0x00, -} - -func (m *Txs) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Txs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Txs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_Txs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_Txs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Txs != nil { - { - size, err := m.Txs.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Txs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_Txs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Txs != nil { - l = m.Txs.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Txs) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Txs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Txs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Txs{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_Txs{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/statesync/types.pb.go b/proto/ostracon/statesync/types.pb.go deleted file mode 100644 index db9f080ab..000000000 --- a/proto/ostracon/statesync/types.pb.go +++ /dev/null @@ -1,1628 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/statesync/types.proto - -package statesync - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_SnapshotsRequest - // *Message_SnapshotsResponse - // *Message_ChunkRequest - // *Message_ChunkResponse - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_347327882fa4a28e, []int{0} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return m.Size() -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_SnapshotsRequest struct { - SnapshotsRequest *SnapshotsRequest `protobuf:"bytes,1,opt,name=snapshots_request,json=snapshotsRequest,proto3,oneof" json:"snapshots_request,omitempty"` -} -type Message_SnapshotsResponse struct { - SnapshotsResponse *SnapshotsResponse `protobuf:"bytes,2,opt,name=snapshots_response,json=snapshotsResponse,proto3,oneof" json:"snapshots_response,omitempty"` -} -type Message_ChunkRequest struct { - ChunkRequest *ChunkRequest `protobuf:"bytes,3,opt,name=chunk_request,json=chunkRequest,proto3,oneof" json:"chunk_request,omitempty"` -} -type Message_ChunkResponse struct { - ChunkResponse *ChunkResponse `protobuf:"bytes,4,opt,name=chunk_response,json=chunkResponse,proto3,oneof" json:"chunk_response,omitempty"` -} - -func (*Message_SnapshotsRequest) isMessage_Sum() {} -func (*Message_SnapshotsResponse) isMessage_Sum() {} -func (*Message_ChunkRequest) isMessage_Sum() {} -func (*Message_ChunkResponse) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetSnapshotsRequest() *SnapshotsRequest { - if x, ok := m.GetSum().(*Message_SnapshotsRequest); ok { - return x.SnapshotsRequest - } - return nil -} - -func (m *Message) GetSnapshotsResponse() *SnapshotsResponse { - if x, ok := m.GetSum().(*Message_SnapshotsResponse); ok { - return x.SnapshotsResponse - } - return nil -} - -func (m *Message) GetChunkRequest() *ChunkRequest { - if x, ok := m.GetSum().(*Message_ChunkRequest); ok { - return x.ChunkRequest - } - return nil -} - -func (m *Message) GetChunkResponse() *ChunkResponse { - if x, ok := m.GetSum().(*Message_ChunkResponse); ok { - return x.ChunkResponse - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_SnapshotsRequest)(nil), - (*Message_SnapshotsResponse)(nil), - (*Message_ChunkRequest)(nil), - (*Message_ChunkResponse)(nil), - } -} - -type SnapshotsRequest struct { -} - -func (m *SnapshotsRequest) Reset() { *m = SnapshotsRequest{} } -func (m *SnapshotsRequest) String() string { return proto.CompactTextString(m) } -func (*SnapshotsRequest) ProtoMessage() {} -func (*SnapshotsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_347327882fa4a28e, []int{1} -} -func (m *SnapshotsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SnapshotsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotsRequest.Merge(m, src) -} -func (m *SnapshotsRequest) XXX_Size() int { - return m.Size() -} -func (m *SnapshotsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotsRequest proto.InternalMessageInfo - -type SnapshotsResponse struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *SnapshotsResponse) Reset() { *m = SnapshotsResponse{} } -func (m *SnapshotsResponse) String() string { return proto.CompactTextString(m) } -func (*SnapshotsResponse) ProtoMessage() {} -func (*SnapshotsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_347327882fa4a28e, []int{2} -} -func (m *SnapshotsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SnapshotsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotsResponse.Merge(m, src) -} -func (m *SnapshotsResponse) XXX_Size() int { - return m.Size() -} -func (m *SnapshotsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotsResponse proto.InternalMessageInfo - -func (m *SnapshotsResponse) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *SnapshotsResponse) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -func (m *SnapshotsResponse) GetChunks() uint32 { - if m != nil { - return m.Chunks - } - return 0 -} - -func (m *SnapshotsResponse) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *SnapshotsResponse) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -type ChunkRequest struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *ChunkRequest) Reset() { *m = ChunkRequest{} } -func (m *ChunkRequest) String() string { return proto.CompactTextString(m) } -func (*ChunkRequest) ProtoMessage() {} -func (*ChunkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_347327882fa4a28e, []int{3} -} -func (m *ChunkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ChunkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkRequest.Merge(m, src) -} -func (m *ChunkRequest) XXX_Size() int { - return m.Size() -} -func (m *ChunkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkRequest proto.InternalMessageInfo - -func (m *ChunkRequest) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ChunkRequest) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -func (m *ChunkRequest) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -type ChunkResponse struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` - Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"` - Missing bool `protobuf:"varint,5,opt,name=missing,proto3" json:"missing,omitempty"` -} - -func (m *ChunkResponse) Reset() { *m = ChunkResponse{} } -func (m *ChunkResponse) String() string { return proto.CompactTextString(m) } -func (*ChunkResponse) ProtoMessage() {} -func (*ChunkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_347327882fa4a28e, []int{4} -} -func (m *ChunkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ChunkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkResponse.Merge(m, src) -} -func (m *ChunkResponse) XXX_Size() int { - return m.Size() -} -func (m *ChunkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkResponse proto.InternalMessageInfo - -func (m *ChunkResponse) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ChunkResponse) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -func (m *ChunkResponse) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *ChunkResponse) GetChunk() []byte { - if m != nil { - return m.Chunk - } - return nil -} - -func (m *ChunkResponse) GetMissing() bool { - if m != nil { - return m.Missing - } - return false -} - -func init() { - proto.RegisterType((*Message)(nil), "ostracon.statesync.Message") - proto.RegisterType((*SnapshotsRequest)(nil), "ostracon.statesync.SnapshotsRequest") - proto.RegisterType((*SnapshotsResponse)(nil), "ostracon.statesync.SnapshotsResponse") - proto.RegisterType((*ChunkRequest)(nil), "ostracon.statesync.ChunkRequest") - proto.RegisterType((*ChunkResponse)(nil), "ostracon.statesync.ChunkResponse") -} - -func init() { proto.RegisterFile("ostracon/statesync/types.proto", fileDescriptor_347327882fa4a28e) } - -var fileDescriptor_347327882fa4a28e = []byte{ - // 394 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x4d, 0x6b, 0xdb, 0x40, - 0x14, 0x94, 0xfc, 0xcd, 0xab, 0x55, 0xec, 0xa5, 0x14, 0xd1, 0x83, 0x70, 0x45, 0x0b, 0x3d, 0x49, - 0xb4, 0xfd, 0x07, 0xee, 0xa1, 0xa6, 0xa5, 0x97, 0x75, 0xe9, 0xa1, 0x97, 0xb2, 0x96, 0xb7, 0x92, - 0x68, 0xb5, 0xab, 0xea, 0xad, 0xa0, 0xfe, 0x01, 0x39, 0xe5, 0x92, 0x9f, 0x95, 0xa3, 0xc9, 0x29, - 0xc7, 0x60, 0xff, 0x91, 0xa0, 0xd5, 0x47, 0x14, 0x3b, 0x24, 0x04, 0x72, 0xd3, 0xcc, 0x7b, 0x9a, - 0x9d, 0x19, 0x78, 0xe0, 0x48, 0x54, 0x19, 0x0b, 0xa4, 0xf0, 0x51, 0x31, 0xc5, 0x71, 0x23, 0x02, - 0x5f, 0x6d, 0x52, 0x8e, 0x5e, 0x9a, 0x49, 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 0xb0, 0xfb, - 0x1d, 0xc6, 0xed, 0x52, 0x1e, 0xed, 0xe3, 0x05, 0xf4, 0x63, 0xb1, 0xe6, 0xff, 0x2b, 0x1b, 0x25, - 0x70, 0x4f, 0x4c, 0xb0, 0x6e, 0x35, 0xf4, 0x34, 0xba, 0x05, 0xab, 0x73, 0x56, 0xf1, 0x4a, 0x40, - 0x6c, 0x18, 0x26, 0x31, 0x62, 0x2c, 0x42, 0x1d, 0x6f, 0x44, 0x6b, 0x38, 0xff, 0x7a, 0xbe, 0x73, - 0xcc, 0xed, 0xce, 0x31, 0xaf, 0x76, 0x8e, 0x79, 0xb6, 0x77, 0x8c, 0xed, 0xde, 0x31, 0x2e, 0xf7, - 0x8e, 0xf1, 0xf3, 0x7d, 0x18, 0xab, 0x28, 0x5f, 0x79, 0x81, 0x4c, 0xfc, 0xbf, 0xb1, 0xe0, 0x7e, - 0x73, 0x32, 0xfa, 0x44, 0xfc, 0xe3, 0x0b, 0x5a, 0x0d, 0xf4, 0xe4, 0xe3, 0x75, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xde, 0x40, 0x9e, 0x4b, 0x5e, 0x03, 0x00, 0x00, -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_SnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SnapshotsRequest != nil { - { - size, err := m.SnapshotsRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Message_SnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SnapshotsResponse != nil { - { - size, err := m.SnapshotsResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Message_ChunkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_ChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ChunkRequest != nil { - { - size, err := m.ChunkRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Message_ChunkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_ChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ChunkResponse != nil { - { - size, err := m.ChunkResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *SnapshotsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *SnapshotsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x2a - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - if m.Chunks != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ChunkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChunkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ChunkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChunkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Missing { - i-- - if m.Missing { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if len(m.Chunk) > 0 { - i -= len(m.Chunk) - copy(dAtA[i:], m.Chunk) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Chunk))) - i-- - dAtA[i] = 0x22 - } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_SnapshotsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SnapshotsRequest != nil { - l = m.SnapshotsRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_SnapshotsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SnapshotsResponse != nil { - l = m.SnapshotsResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_ChunkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChunkRequest != nil { - l = m.ChunkRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_ChunkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChunkResponse != nil { - l = m.ChunkResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *SnapshotsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *SnapshotsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Chunks != 0 { - n += 1 + sovTypes(uint64(m.Chunks)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ChunkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - return n -} - -func (m *ChunkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - l = len(m.Chunk) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Missing { - n += 2 - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotsRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotsRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SnapshotsRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotsResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotsResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SnapshotsResponse{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ChunkRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_ChunkRequest{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ChunkResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_ChunkResponse{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - m.Chunks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Chunks |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChunkRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChunkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChunkResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChunkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunk = append(m.Chunk[:0], dAtA[iNdEx:postIndex]...) - if m.Chunk == nil { - m.Chunk = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Missing", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Missing = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/types/types.pb.go b/proto/ostracon/types/types.pb.go index c5fb62e9a..1a48a1da1 100644 --- a/proto/ostracon/types/types.pb.go +++ b/proto/ostracon/types/types.pb.go @@ -9,8 +9,8 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - crypto "github.com/line/ostracon/proto/ostracon/crypto" version "github.com/line/ostracon/proto/ostracon/version" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" io "io" math "math" math_bits "math/bits" @@ -1066,90 +1066,91 @@ func init() { func init() { proto.RegisterFile("ostracon/types/types.proto", fileDescriptor_0e52e849a4baef8c) } var fileDescriptor_0e52e849a4baef8c = []byte{ - // 1328 bytes of a gzipped FileDescriptorProto + // 1335 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1a, 0x47, 0x14, 0xf7, 0xc2, 0x62, 0xe0, 0x01, 0x36, 0x5e, 0x39, 0x0e, 0xc1, 0x09, 0x46, 0x54, 0x6d, 0x9d, - 0x34, 0x5d, 0x12, 0xb7, 0x87, 0x56, 0x3d, 0x44, 0x60, 0x3b, 0x0e, 0x8a, 0x8d, 0xd1, 0x42, 0x52, - 0xb5, 0x97, 0xd5, 0x02, 0x63, 0xd8, 0x66, 0xd9, 0x59, 0xed, 0x0c, 0xae, 0x9d, 0x4f, 0x50, 0xf9, + 0xb4, 0x5d, 0x12, 0x37, 0x87, 0x56, 0x3d, 0x44, 0x60, 0x3b, 0x0e, 0x8a, 0x8d, 0xd1, 0x42, 0x52, + 0xb5, 0x97, 0xd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x62, 0x0f, 0x5c, 0x8b, 0x8e, 0x7d, - 0x24, 0x35, 0x3a, 0x31, 0x54, 0x7e, 0x51, 0x60, 0x5e, 0x68, 0x3e, 0xc2, 0x9a, 0x72, 0x31, 0x6b, - 0xb1, 0xcb, 0x58, 0x8b, 0xbf, 0x2d, 0x6b, 0xf7, 0x00, 0xc2, 0x54, 0x48, 0x41, 0x2d, 0xc7, 0xd7, - 0x33, 0x1b, 0xd7, 0x66, 0xa7, 0x11, 0xe9, 0xb5, 0xed, 0x81, 0x3c, 0xce, 0x91, 0x90, 0xca, 0x1f, - 0x0a, 0xa4, 0x43, 0xbf, 0x76, 0x0f, 0x72, 0x41, 0x4e, 0xe6, 0x81, 0x63, 0x0d, 0xa4, 0x66, 0x56, - 0x2f, 0x49, 0xec, 0xbe, 0x63, 0x0d, 0x8c, 0x8c, 0xcc, 0x85, 0x0d, 0x2e, 0xae, 0x40, 0xec, 0x92, - 0x0a, 0x4c, 0x95, 0x3c, 0xfe, 0x76, 0x25, 0x9f, 0x2a, 0x8e, 0x3a, 0x5b, 0x9c, 0x9f, 0x63, 0x90, - 0x6a, 0xf1, 0xf3, 0x65, 0x39, 0xff, 0xff, 0x39, 0x58, 0x85, 0xb4, 0x87, 0x1d, 0x53, 0x78, 0x54, - 0xee, 0x49, 0x79, 0xd8, 0x31, 0xce, 0x95, 0x3b, 0xf1, 0x4e, 0x0e, 0xc9, 0xfc, 0x3b, 0x60, 0x2c, - 0x39, 0xcb, 0x98, 0x0b, 0x59, 0x41, 0x84, 0xec, 0x73, 0x3a, 0x63, 0x80, 0xb7, 0x4d, 0x65, 0xb6, - 0x27, 0x8b, 0xa4, 0x05, 0xce, 0x90, 0x28, 0x86, 0x17, 0x8d, 0x41, 0xb6, 0xd9, 0x95, 0x8b, 0xc5, - 0x68, 0x48, 0x54, 0xe5, 0x7b, 0x05, 0x60, 0x97, 0x71, 0xca, 0xf7, 0xca, 0xfa, 0x13, 0xe1, 0xcb, - 0x9b, 0x53, 0x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c, 0xf9, 0x06, 0x92, 0x75, 0x07, 0xf7, 0x9e, 0x36, 0xb6, 0xc2, 0x44, + 0x94, 0x49, 0x22, 0xda, 0x43, 0x58, 0xf4, 0x2c, 0x9f, 0x9a, 0x04, 0x51, 0x73, 0xc8, 0x77, 0xc1, + 0x17, 0xcd, 0x6c, 0xdc, 0xd0, 0xa7, 0x2b, 0xa0, 0x4f, 0x6d, 0x55, 0xae, 0x91, 0xf3, 0xa2, 0xc6, + 0xca, 0xf3, 0x04, 0xcc, 0x4b, 0x2a, 0xbe, 0x80, 0xa4, 0xa4, 0x94, 0x2f, 0x97, 0xd9, 0x58, 0x9d, + 0xcc, 0x27, 0x1d, 0xfa, 0x26, 0x76, 0x09, 0x72, 0xc9, 0x98, 0xc8, 0xd9, 0x82, 0x08, 0xed, 0x03, + 0x48, 0xf5, 0x86, 0x96, 0xed, 0x9a, 0x76, 0x9f, 0x67, 0x93, 0xae, 0x67, 0x4e, 0x5f, 0xad, 0x25, + 0x37, 0x99, 0xad, 0xb1, 0x65, 0x24, 0xb9, 0xb3, 0xd1, 0xd7, 0x56, 0x60, 0x7e, 0x88, 0xec, 0xc1, + 0x90, 0x72, 0x4a, 0xe2, 0x86, 0x1c, 0x69, 0x9f, 0x81, 0xca, 0x84, 0x50, 0x50, 0xf9, 0xca, 0x45, + 0x5d, 0xa8, 0x44, 0x0f, 0x54, 0xa2, 0x77, 0x02, 0x95, 0xd4, 0x53, 0x6c, 0xe1, 0xe7, 0x7f, 0xae, + 0x29, 0x06, 0x8f, 0xd0, 0x6a, 0x90, 0x73, 0x2c, 0x42, 0xcd, 0x2e, 0xa3, 0x8c, 0x2d, 0x9f, 0xe0, + 0x53, 0x5c, 0x9d, 0x25, 0x43, 0x52, 0x2a, 0x13, 0xcf, 0xb0, 0x18, 0x61, 0xea, 0x6b, 0xeb, 0x90, + 0xe7, 0x53, 0xf4, 0xf0, 0x68, 0x64, 0x53, 0x93, 0x33, 0x3e, 0xcf, 0x19, 0x5f, 0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 0xbf, 0x5c, 0xc9, 0xa7, + 0x8a, 0xa3, 0xce, 0x16, 0xe7, 0xe7, 0x18, 0xa4, 0x5a, 0xfc, 0x7c, 0x59, 0xce, 0xff, 0x7f, 0x0e, + 0x56, 0x21, 0xed, 0x61, 0xc7, 0x14, 0x1e, 0x95, 0x7b, 0x52, 0x1e, 0x76, 0x8c, 0x33, 0xe5, 0x4e, + 0xbc, 0x93, 0x43, 0x32, 0xff, 0x0e, 0x18, 0x4b, 0xce, 0x32, 0xe6, 0x42, 0x56, 0x10, 0x21, 0xfb, + 0x9c, 0xce, 0x18, 0xe0, 0x6d, 0x53, 0xb4, 0xb9, 0x95, 0xd9, 0xa4, 0x05, 0xce, 0x90, 0x28, 0x86, + 0x17, 0x8d, 0x41, 0xb6, 0xd9, 0x95, 0xf3, 0xc5, 0x68, 0x48, 0x54, 0xe5, 0x7b, 0x05, 0x60, 0x97, + 0x71, 0xca, 0xf7, 0xca, 0xfa, 0x13, 0xe1, 0xcb, 0x9b, 0x53, 0xab, 0x5e, 0x3f, 0xbf, 0x58, 0x72, + 0xed, 0x2c, 0x89, 0x66, 0x5c, 0x83, 0xdc, 0x44, 0x82, 0x04, 0x05, 0x89, 0x9c, 0x99, 0x22, 0x6c, + 0x1a, 0x6d, 0x44, 0x8d, 0xec, 0x41, 0x64, 0x54, 0xf9, 0x55, 0x81, 0x34, 0xcf, 0x67, 0x0f, 0x51, + 0x6b, 0xaa, 0x72, 0xca, 0x65, 0x2b, 0x77, 0x03, 0x40, 0x4c, 0x42, 0xec, 0x67, 0x48, 0xaa, 0x29, + 0xcd, 0x2d, 0x6d, 0xfb, 0x19, 0xd2, 0xee, 0x86, 0x34, 0xc7, 0xdf, 0x44, 0xb3, 0x3c, 0xc0, 0x01, + 0xd9, 0x57, 0x21, 0xe9, 0x8e, 0x47, 0x26, 0xbb, 0xf8, 0x55, 0xa1, 0x4f, 0x77, 0x3c, 0xea, 0x1c, + 0x12, 0xf6, 0x28, 0xea, 0x1c, 0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 0xfd, 0x78, 0xbf, 0xb3, 0x9d, + 0x57, 0x04, 0xba, 0xe5, 0xa3, 0x03, 0x4c, 0x11, 0x47, 0xdf, 0x86, 0x6b, 0xe7, 0xa0, 0xc3, 0x8d, + 0x2d, 0x1d, 0x9f, 0x94, 0x73, 0x2d, 0x1f, 0x89, 0x73, 0xc3, 0x23, 0x74, 0x28, 0x9c, 0x8d, 0xd8, + 0x6f, 0xed, 0xb7, 0x6b, 0xbb, 0xf9, 0x72, 0x31, 0x7f, 0x7c, 0x52, 0xce, 0x06, 0x97, 0x1f, 0xc3, + 0x4f, 0x76, 0x56, 0xdf, 0x79, 0x71, 0x5a, 0x52, 0x5e, 0x9e, 0x96, 0x94, 0xbf, 0x4e, 0x4b, 0xca, + 0xf3, 0xd7, 0xa5, 0xb9, 0x97, 0xaf, 0x4b, 0x73, 0xbf, 0xbf, 0x2e, 0xcd, 0x7d, 0xfd, 0xc9, 0xc0, + 0xa6, 0xc3, 0x71, 0x57, 0xef, 0xe1, 0x51, 0xd5, 0xb1, 0x5d, 0x54, 0x0d, 0xff, 0x23, 0x88, 0x3f, + 0x27, 0xd3, 0x7f, 0x19, 0xba, 0xf3, 0xdc, 0xfa, 0xe9, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x33, + 0xf8, 0xa1, 0x5b, 0xeb, 0x0c, 0x00, 0x00, } func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/types/types.proto b/proto/ostracon/types/types.proto index 2384d5794..c53d2bd61 100644 --- a/proto/ostracon/types/types.proto +++ b/proto/ostracon/types/types.proto @@ -5,7 +5,7 @@ option go_package = "github.com/line/ostracon/proto/ostracon/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -import "ostracon/crypto/proof.proto"; +import "tendermint/crypto/proof.proto"; import "ostracon/version/types.proto"; import "ostracon/types/validator.proto"; @@ -43,7 +43,7 @@ message PartSetHeader { message Part { uint32 index = 1; bytes bytes = 2; - ostracon.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; + tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; } // BlockID @@ -160,5 +160,5 @@ message BlockMeta { message TxProof { bytes root_hash = 1; bytes data = 2; - ostracon.crypto.Proof proof = 3; + tendermint.crypto.Proof proof = 3; } diff --git a/statesync/messages.go b/statesync/messages.go index 5528f01f7..b07227bbf 100644 --- a/statesync/messages.go +++ b/statesync/messages.go @@ -6,7 +6,7 @@ import ( "github.com/gogo/protobuf/proto" - ssproto "github.com/line/ostracon/proto/ostracon/statesync" + ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" ) const ( diff --git a/statesync/messages_test.go b/statesync/messages_test.go index 4afb86d8d..3f7d713ae 100644 --- a/statesync/messages_test.go +++ b/statesync/messages_test.go @@ -7,7 +7,8 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/require" - ssproto "github.com/line/ostracon/proto/ostracon/statesync" + ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" + tmproto "github.com/line/ostracon/proto/ostracon/types" ) diff --git a/statesync/reactor.go b/statesync/reactor.go index e1df45354..c0000d692 100644 --- a/statesync/reactor.go +++ b/statesync/reactor.go @@ -5,11 +5,12 @@ import ( "sort" "time" + ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" - ssproto "github.com/line/ostracon/proto/ostracon/statesync" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" diff --git a/statesync/reactor_test.go b/statesync/reactor_test.go index 3b8ea29e9..47d383522 100644 --- a/statesync/reactor_test.go +++ b/statesync/reactor_test.go @@ -18,10 +18,11 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/p2p" p2pmocks "github.com/line/ostracon/p2p/mocks" - ssproto "github.com/line/ostracon/proto/ostracon/statesync" proxymocks "github.com/line/ostracon/proxy/mocks" ) diff --git a/statesync/syncer.go b/statesync/syncer.go index 4372a2f88..391e2dde4 100644 --- a/statesync/syncer.go +++ b/statesync/syncer.go @@ -7,13 +7,14 @@ import ( "fmt" "time" + ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/light" "github.com/line/ostracon/p2p" - ssproto "github.com/line/ostracon/proto/ostracon/statesync" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" diff --git a/statesync/syncer_test.go b/statesync/syncer_test.go index 6945e2673..b76d3070b 100644 --- a/statesync/syncer_test.go +++ b/statesync/syncer_test.go @@ -12,6 +12,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" @@ -19,7 +21,6 @@ import ( "github.com/line/ostracon/p2p" p2pmocks "github.com/line/ostracon/p2p/mocks" tmstate "github.com/line/ostracon/proto/ostracon/state" - ssproto "github.com/line/ostracon/proto/ostracon/statesync" tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/proxy" proxymocks "github.com/line/ostracon/proxy/mocks" diff --git a/third_party/proto/tendermint/crypto/keys.proto b/third_party/proto/tendermint/crypto/keys.proto new file mode 100644 index 000000000..16fd7adf3 --- /dev/null +++ b/third_party/proto/tendermint/crypto/keys.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +// PublicKey defines the keys available for use with Tendermint Validators +message PublicKey { + option (gogoproto.compare) = true; + option (gogoproto.equal) = true; + + oneof sum { + bytes ed25519 = 1; + bytes secp256k1 = 2; + } +} diff --git a/proto/ostracon/crypto/proof.proto b/third_party/proto/tendermint/crypto/proof.proto similarity index 88% rename from proto/ostracon/crypto/proof.proto rename to third_party/proto/tendermint/crypto/proof.proto index 7ea7b277f..975df7685 100644 --- a/proto/ostracon/crypto/proof.proto +++ b/third_party/proto/tendermint/crypto/proof.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package ostracon.crypto; +package tendermint.crypto; -option go_package = "github.com/line/ostracon/proto/ostracon/crypto"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; diff --git a/proto/ostracon/mempool/types.proto b/third_party/proto/tendermint/mempool/types.proto similarity index 52% rename from proto/ostracon/mempool/types.proto rename to third_party/proto/tendermint/mempool/types.proto index e71ab51ef..b55d9717b 100644 --- a/proto/ostracon/mempool/types.proto +++ b/third_party/proto/tendermint/mempool/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package ostracon.mempool; +package tendermint.mempool; -option go_package = "github.com/line/ostracon/proto/ostracon/mempool"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/mempool"; message Txs { repeated bytes txs = 1; diff --git a/proto/ostracon/statesync/types.proto b/third_party/proto/tendermint/statesync/types.proto similarity index 85% rename from proto/ostracon/statesync/types.proto rename to third_party/proto/tendermint/statesync/types.proto index 1470e93bf..8d4a714c1 100644 --- a/proto/ostracon/statesync/types.proto +++ b/third_party/proto/tendermint/statesync/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package ostracon.statesync; +package tendermint.statesync; -option go_package = "github.com/line/ostracon/proto/ostracon/statesync"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/statesync"; message Message { oneof sum { From 9e23a22808d46ac0672ae57bec4b1806d7f87240 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 6 Jan 2023 23:09:15 +0900 Subject: [PATCH 05/25] feat: clean up `proto/ostracon/crypto` directory proto (cherry picked from commit 1eeb90f872e692c676d6530e9146689220cffe47) From 0b02c874d5410ea786592225b83b495ae9a8bd95 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 6 Jan 2023 23:43:42 +0900 Subject: [PATCH 06/25] feat: clean up `proto/ostracon/version` directory proto --- evidence/pool_test.go | 2 +- evidence/verify_test.go | 2 +- light/helpers_test.go | 3 +- light/store/db/db_test.go | 2 +- mempool/clist_mempool_system_test.go | 3 +- proto/ostracon/state/types.pb.go | 103 ++-- proto/ostracon/state/types.proto | 4 +- proto/ostracon/types/types.pb.go | 172 +++--- proto/ostracon/types/types.proto | 4 +- proto/ostracon/version/types.pb.go | 576 ------------------ state/execution_test.go | 3 +- state/rollback.go | 3 +- state/rollback_test.go | 2 +- state/state.go | 3 +- statesync/reactor_test.go | 19 +- statesync/stateprovider_test.go | 8 +- statesync/syncer_test.go | 2 +- store/store_test.go | 2 +- .../proto/tendermint}/version/types.proto | 4 +- types/block.go | 3 +- types/block_test.go | 3 +- types/evidence_test.go | 3 +- types/light_test.go | 3 +- types/protobuf_test.go | 10 +- 24 files changed, 186 insertions(+), 753 deletions(-) delete mode 100644 proto/ostracon/version/types.pb.go rename {proto/ostracon => third_party/proto/tendermint}/version/types.proto (84%) diff --git a/evidence/pool_test.go b/evidence/pool_test.go index 74c4b9dac..d85114081 100644 --- a/evidence/pool_test.go +++ b/evidence/pool_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/crypto" @@ -16,7 +17,6 @@ import ( "github.com/line/ostracon/evidence/mocks" "github.com/line/ostracon/libs/log" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" sm "github.com/line/ostracon/state" smmocks "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/store" diff --git a/evidence/verify_test.go b/evidence/verify_test.go index 54f729bfd..ce6158810 100644 --- a/evidence/verify_test.go +++ b/evidence/verify_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/crypto" @@ -18,7 +19,6 @@ import ( "github.com/line/ostracon/libs/log" "github.com/line/ostracon/light" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" sm "github.com/line/ostracon/state" smmocks "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/types" diff --git a/light/helpers_test.go b/light/helpers_test.go index 5a5330e61..925e3c3cb 100644 --- a/light/helpers_test.go +++ b/light/helpers_test.go @@ -5,13 +5,14 @@ import ( "fmt" "time" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/tmhash" tmbytes "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/libs/rand" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" diff --git a/light/store/db/db_test.go b/light/store/db/db_test.go index 7e1638862..1dc4ae9bb 100644 --- a/light/store/db/db_test.go +++ b/light/store/db/db_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/types" "github.com/line/ostracon/version" ) diff --git a/mempool/clist_mempool_system_test.go b/mempool/clist_mempool_system_test.go index 2b8bd70fa..65d9e1bd3 100644 --- a/mempool/clist_mempool_system_test.go +++ b/mempool/clist_mempool_system_test.go @@ -14,11 +14,12 @@ import ( "github.com/stretchr/testify/assert" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/abci/example/counter" abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" "github.com/line/ostracon/version" diff --git a/proto/ostracon/state/types.pb.go b/proto/ostracon/state/types.pb.go index 1ccdd4765..f5b262366 100644 --- a/proto/ostracon/state/types.pb.go +++ b/proto/ostracon/state/types.pb.go @@ -11,7 +11,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/line/ostracon/abci/types" types1 "github.com/line/ostracon/proto/ostracon/types" - version "github.com/line/ostracon/proto/ostracon/version" + version "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" math_bits "math/bits" @@ -431,56 +431,57 @@ func init() { func init() { proto.RegisterFile("ostracon/state/types.proto", fileDescriptor_898987a4421067cd) } var fileDescriptor_898987a4421067cd = []byte{ - // 783 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6a, 0xf3, 0x46, - 0x14, 0xb5, 0xea, 0x2f, 0xb1, 0x3d, 0x8a, 0xed, 0x76, 0x52, 0xa8, 0xe2, 0x04, 0xd9, 0x35, 0xfd, - 0x09, 0x85, 0xca, 0x90, 0x2e, 0xba, 0x09, 0x94, 0xc8, 0x0e, 0x8d, 0x21, 0x14, 0xa3, 0x84, 0x2c, - 0xba, 0x11, 0x63, 0x69, 0x2c, 0x89, 0xca, 0x1a, 0xa1, 0x19, 0xbb, 0xe9, 0xba, 0x2f, 0x90, 0x5d, - 0x5f, 0x29, 0xcb, 0x2c, 0xba, 0xe8, 0x2a, 0x2d, 0xce, 0xa6, 0x4f, 0x51, 0xca, 0xfc, 0xe8, 0xc7, - 0xa6, 0x81, 0x94, 0x6f, 0x27, 0xdd, 0x73, 0xee, 0xd1, 0x99, 0x3b, 0xe7, 0x22, 0xd0, 0x23, 0x94, - 0x65, 0xc8, 0x23, 0xc9, 0x88, 0x32, 0xc4, 0xf0, 0x88, 0xfd, 0x92, 0x62, 0x6a, 0xa5, 0x19, 0x61, - 0x04, 0x76, 0x72, 0xcc, 0x12, 0x58, 0xef, 0xe3, 0x80, 0x04, 0x44, 0x40, 0x23, 0xfe, 0x24, 0x59, - 0xbd, 0xa3, 0x42, 0x01, 0xcd, 0xbd, 0xa8, 0x2a, 0xd0, 0x2b, 0xc5, 0x45, 0x75, 0x0b, 0x33, 0x77, - 0xb0, 0x35, 0x8a, 0x23, 0x1f, 0x31, 0x92, 0x29, 0xfc, 0x78, 0x07, 0x4f, 0x51, 0x86, 0x96, 0x79, - 0xf3, 0x49, 0x01, 0xae, 0x71, 0x46, 0xa3, 0x9c, 0xa4, 0xd0, 0x7e, 0x40, 0x48, 0x10, 0xe3, 0x91, - 0x78, 0x9b, 0xaf, 0x16, 0x23, 0x16, 0x2d, 0x31, 0x65, 0x68, 0x99, 0x4a, 0xc2, 0xf0, 0x77, 0x0d, - 0xb4, 0x2f, 0xec, 0xf1, 0xd4, 0xc1, 0x34, 0x25, 0x09, 0xc5, 0x14, 0x5e, 0x00, 0xdd, 0xc7, 0x71, - 0xb4, 0xc6, 0x99, 0xcb, 0xee, 0xa9, 0xa1, 0x0d, 0xea, 0xa7, 0xfa, 0xd9, 0xc0, 0x2a, 0x06, 0xc0, - 0x8f, 0x66, 0xe5, 0xf4, 0x89, 0x64, 0xde, 0xde, 0x3b, 0xc0, 0xcf, 0x1f, 0x29, 0x3c, 0x07, 0x2d, - 0x9c, 0xf8, 0xee, 0x3c, 0x26, 0xde, 0x4f, 0xc6, 0x07, 0x03, 0xed, 0x54, 0x3f, 0xeb, 0xbf, 0x22, - 0x70, 0x99, 0xf8, 0x36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xad, 0x08, 0x73, 0x4b, 0x5c, 0xd2, 0x71, 0x19, 0xe6, 0xb2, 0x5b, 0xc5, 0xfa, 0x3f, 0x17, - 0x0b, 0xbc, 0xd7, 0x62, 0xfd, 0x00, 0x3e, 0xdb, 0x5a, 0xac, 0x1d, 0xf5, 0xc2, 0x9c, 0x2e, 0xcc, - 0x0d, 0x2a, 0x9b, 0xb6, 0x2d, 0x94, 0x3b, 0xcc, 0xe3, 0x97, 0x61, 0xba, 0x8a, 0x19, 0x75, 0x43, - 0x44, 0x43, 0xe3, 0x60, 0xa0, 0x9d, 0x1e, 0xc8, 0xf8, 0x39, 0xb2, 0x7e, 0x85, 0x68, 0x08, 0x8f, - 0x40, 0x13, 0xa5, 0xa9, 0xa4, 0xb4, 0x05, 0xa5, 0x81, 0xd2, 0x54, 0x40, 0x5f, 0xaa, 0xa1, 0xa7, - 0x19, 0x21, 0x0b, 0xc9, 0xf8, 0xbb, 0x21, 0x28, 0x22, 0x22, 0x33, 0x5e, 0xe6, 0x44, 0xfb, 0xfb, - 0xc7, 0x8d, 0xa9, 0x3d, 0x6d, 0x4c, 0xed, 0xaf, 0x8d, 0xa9, 0x3d, 0xbc, 0x98, 0xb5, 0xa7, 0x17, - 0xb3, 0xf6, 0xc7, 0x8b, 0x59, 0xfb, 0xf1, 0xeb, 0x20, 0x62, 0xe1, 0x6a, 0x6e, 0x79, 0x64, 0x39, - 0x8a, 0xa3, 0x04, 0x8f, 0x8a, 0x1f, 0x89, 0xfc, 0xaf, 0x6d, 0xff, 0x0d, 0xe7, 0xfb, 0xa2, 0xfa, - 0xcd, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x89, 0xef, 0x00, 0x54, 0x26, 0x07, 0x00, 0x00, + // 791 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x8e, 0xe3, 0x44, + 0x14, 0x8d, 0xc9, 0x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fd, 0x7e, 0x67, 0xb7, 0x7e, 0xf8, + 0x3a, 0x26, 0x3c, 0xd9, 0xad, 0x9d, 0x90, 0x6e, 0xdd, 0x94, 0x64, 0xd8, 0xad, 0xfe, 0x34, 0xea, + 0xdf, 0x76, 0xfc, 0x47, 0x5c, 0x9f, 0xc9, 0xea, 0x37, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x38, + 0xf8, 0xf4, 0x33, 0x2a, 0x07, 0x00, 0x00, } func (m *ABCIResponses) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index 830bfa122..70137238b 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -8,7 +8,7 @@ import "ostracon/abci/types.proto"; import "ostracon/types/types.proto"; import "ostracon/types/validator.proto"; import "ostracon/types/params.proto"; -import "ostracon/version/types.proto"; +import "tendermint/version/types.proto"; import "google/protobuf/timestamp.proto"; // ABCIResponses retains the responses @@ -33,7 +33,7 @@ message ConsensusParamsInfo { } message Version { - ostracon.version.Consensus consensus = 1 [(gogoproto.nullable) = false]; + tendermint.version.Consensus consensus = 1 [(gogoproto.nullable) = false]; string software = 2; } diff --git a/proto/ostracon/types/types.pb.go b/proto/ostracon/types/types.pb.go index 1a48a1da1..11251c6a2 100644 --- a/proto/ostracon/types/types.pb.go +++ b/proto/ostracon/types/types.pb.go @@ -9,8 +9,8 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - version "github.com/line/ostracon/proto/ostracon/version" crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + version "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" math_bits "math/bits" @@ -1066,91 +1066,91 @@ func init() { func init() { proto.RegisterFile("ostracon/types/types.proto", fileDescriptor_0e52e849a4baef8c) } var fileDescriptor_0e52e849a4baef8c = []byte{ - // 1335 bytes of a gzipped FileDescriptorProto -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x83, 0x03, 0xe4, 0x13, 0x3b, 0xc8, 0x44, 0x7a, 0x4b, 0x33, 0xf9, - 0x1d, 0x58, 0x8e, 0xdd, 0xb7, 0x28, 0xf6, 0x85, 0xbf, 0xf2, 0x39, 0xe4, 0x5a, 0x96, 0x4f, 0xdb, - 0x88, 0x3e, 0x40, 0x56, 0x1f, 0xf9, 0xda, 0x32, 0x24, 0x28, 0xa6, 0x96, 0x53, 0x50, 0xca, 0xca, - 0x7a, 0xce, 0x10, 0x03, 0x4d, 0x03, 0x75, 0x68, 0x91, 0x61, 0x21, 0x56, 0x56, 0xd6, 0xb3, 0x06, - 0xff, 0xae, 0x0c, 0x41, 0x65, 0xa1, 0x2c, 0xc2, 0x76, 0xfb, 0xe8, 0x30, 0x88, 0xe0, 0x03, 0x66, - 0xed, 0x1e, 0x51, 0x44, 0x64, 0x88, 0x18, 0x68, 0x77, 0x21, 0xc1, 0x73, 0x2f, 0xc4, 0xcb, 0xca, - 0x7a, 0x66, 0xa3, 0xa0, 0x4f, 0xf6, 0xa6, 0x8b, 0xbd, 0xe9, 0x2d, 0xe6, 0xaf, 0xab, 0x2f, 0x5e, - 0xad, 0xcd, 0x19, 0x02, 0x5c, 0xf9, 0x06, 0x92, 0x75, 0x07, 0xf7, 0x9e, 0x36, 0xb6, 0xc2, 0x44, - 0x94, 0x49, 0x22, 0xda, 0x43, 0x58, 0xf4, 0x2c, 0x9f, 0x9a, 0x04, 0x51, 0x73, 0xc8, 0x77, 0xc1, - 0x17, 0xcd, 0x6c, 0xdc, 0xd0, 0xa7, 0x2b, 0xa0, 0x4f, 0x6d, 0x55, 0xae, 0x91, 0xf3, 0xa2, 0xc6, - 0xca, 0xf3, 0x04, 0xcc, 0x4b, 0x2a, 0xbe, 0x80, 0xa4, 0xa4, 0x94, 0x2f, 0x97, 0xd9, 0x58, 0x9d, - 0xcc, 0x27, 0x1d, 0xfa, 0x26, 0x76, 0x09, 0x72, 0xc9, 0x98, 0xc8, 0xd9, 0x82, 0x08, 0xed, 0x03, - 0x48, 0xf5, 0x86, 0x96, 0xed, 0x9a, 0x76, 0x9f, 0x67, 0x93, 0xae, 0x67, 0x4e, 0x5f, 0xad, 0x25, - 0x37, 0x99, 0xad, 0xb1, 0x65, 0x24, 0xb9, 0xb3, 0xd1, 0xd7, 0x56, 0x60, 0x7e, 0x88, 0xec, 0xc1, - 0x90, 0x72, 0x4a, 0xe2, 0x86, 0x1c, 0x69, 0x9f, 0x81, 0xca, 0x84, 0x50, 0x50, 0xf9, 0xca, 0x45, - 0x5d, 0xa8, 0x44, 0x0f, 0x54, 0xa2, 0x77, 0x02, 0x95, 0xd4, 0x53, 0x6c, 0xe1, 0xe7, 0x7f, 0xae, - 0x29, 0x06, 0x8f, 0xd0, 0x6a, 0x90, 0x73, 0x2c, 0x42, 0xcd, 0x2e, 0xa3, 0x8c, 0x2d, 0x9f, 0xe0, - 0x53, 0x5c, 0x9d, 0x25, 0x43, 0x52, 0x2a, 0x13, 0xcf, 0xb0, 0x18, 0x61, 0xea, 0x6b, 0xeb, 0x90, - 0xe7, 0x53, 0xf4, 0xf0, 0x68, 0x64, 0x53, 0x93, 0x33, 0x3e, 0xcf, 0x19, 0x5f, 0x60, 0xf6, 0x4d, - 0x6e, 0x7e, 0xc0, 0xb8, 0x5f, 0x85, 0x74, 0xdf, 0xa2, 0x96, 0x80, 0x24, 0x39, 0x24, 0xc5, 0x0c, - 0xdc, 0xf9, 0x21, 0x2c, 0x86, 0x7a, 0x23, 0x02, 0x92, 0x12, 0xb3, 0x4c, 0xcc, 0x1c, 0x78, 0x1b, - 0x96, 0x5d, 0x74, 0x48, 0xcd, 0x59, 0x74, 0x9a, 0xa3, 0x35, 0xe6, 0x7b, 0x3c, 0x1d, 0xf1, 0x3e, - 0x2c, 0xf4, 0x02, 0xea, 0x05, 0x16, 0x38, 0x36, 0x17, 0x5a, 0x39, 0xec, 0x1a, 0xa4, 0x2c, 0xcf, - 0x13, 0x80, 0x0c, 0x07, 0x24, 0x2d, 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x95, 0xf3, 0xc5, 0x68, 0x48, 0x54, 0xe5, 0x7b, 0x05, 0x60, 0x97, - 0x71, 0xca, 0xf7, 0xca, 0xfa, 0x13, 0xe1, 0xcb, 0x9b, 0x53, 0xab, 0x5e, 0x3f, 0xbf, 0x58, 0x72, - 0xed, 0x2c, 0x89, 0x66, 0x5c, 0x83, 0xdc, 0x44, 0x82, 0x04, 0x05, 0x89, 0x9c, 0x99, 0x22, 0x6c, - 0x1a, 0x6d, 0x44, 0x8d, 0xec, 0x41, 0x64, 0x54, 0xf9, 0x55, 0x81, 0x34, 0xcf, 0x67, 0x0f, 0x51, - 0x6b, 0xaa, 0x72, 0xca, 0x65, 0x2b, 0x77, 0x03, 0x40, 0x4c, 0x42, 0xec, 0x67, 0x48, 0xaa, 0x29, - 0xcd, 0x2d, 0x6d, 0xfb, 0x19, 0xd2, 0xee, 0x86, 0x34, 0xc7, 0xdf, 0x44, 0xb3, 0x3c, 0xc0, 0x01, - 0xd9, 0x57, 0x21, 0xe9, 0x8e, 0x47, 0x26, 0xbb, 0xf8, 0x55, 0xa1, 0x4f, 0x77, 0x3c, 0xea, 0x1c, - 0x12, 0xf6, 0x28, 0xea, 0x1c, 0xf2, 0xc7, 0x12, 0x13, 0xa5, 0x8f, 0xb1, 0xec, 0xd3, 0xe2, 0x65, - 0x94, 0x62, 0x06, 0xde, 0x96, 0x34, 0x50, 0x59, 0x43, 0x0e, 0x9e, 0x6e, 0xec, 0x5b, 0xd3, 0xdf, - 0xf2, 0x19, 0x26, 0x3b, 0xd0, 0xad, 0xdf, 0x14, 0xc8, 0x44, 0xee, 0x03, 0xed, 0x0e, 0x5c, 0xa9, - 0xef, 0xee, 0x6f, 0x3e, 0x34, 0x1b, 0x5b, 0xe6, 0xfd, 0xdd, 0xda, 0x8e, 0xf9, 0xa8, 0xf9, 0xb0, - 0xb9, 0xff, 0x65, 0x33, 0x3f, 0x57, 0x5c, 0x39, 0x3e, 0x29, 0x6b, 0x11, 0xec, 0x23, 0x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0xb9, 0x97, 0xaf, 0x4b, 0x73, 0xbf, 0xbf, 0x2e, 0xcd, 0x7d, 0xfd, 0xc9, 0xc0, - 0xa6, 0xc3, 0x71, 0x57, 0xef, 0xe1, 0x51, 0xd5, 0xb1, 0x5d, 0x54, 0x0d, 0xff, 0x23, 0x88, 0x3f, - 0x27, 0xd3, 0x7f, 0x19, 0xba, 0xf3, 0xdc, 0xfa, 0xe9, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x33, - 0xf8, 0xa1, 0x5b, 0xeb, 0x0c, 0x00, 0x00, + // 1336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0xdb, 0xc6, + 0x12, 0x37, 0x25, 0xca, 0x92, 0x46, 0x92, 0x2d, 0x13, 0x8e, 0xa3, 0x28, 0x89, 0x2c, 0xe8, 0xe1, + 0xbd, 0xe7, 0xe4, 0xbd, 0x52, 0x49, 0x9a, 0x43, 0x7b, 0x28, 0x02, 0xc9, 0x76, 0x1c, 0x21, 0xb6, + 0x2c, 0x50, 0x4a, 0x8a, 0xf6, 0x42, 0x50, 0xe2, 0x46, 0x62, 0x43, 0x71, 0x09, 0xee, 0xca, 0xb5, + 0xf3, 0x09, 0x0a, 0x9f, 0x82, 0xdc, 0x7d, 0x6a, 0x0f, 0xbd, 0xf5, 0x0b, 0x14, 0x3d, 0xe7, 0x98, + 0x5b, 0x0b, 0x14, 0x48, 0x0b, 0xa7, 0x87, 0xf6, 0x5b, 0x14, 0xfb, 0x87, 0x14, 0x25, 0xdb, 0x41, + 0x10, 0xa4, 0x17, 0x81, 0x3b, 0xf3, 0x9b, 0xdd, 0xd9, 0xdf, 0xfc, 0x76, 0x67, 0x05, 0x65, 0x4c, + 0x68, 0x60, 0x0d, 0xb0, 0x57, 0xa7, 0x47, 0x3e, 0x22, 0xe2, 0x57, 0xf7, 0x03, 0x4c, 0xb1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x48, 0x86, 0x19, + 0xb8, 0xf3, 0xbf, 0xb0, 0x1c, 0x29, 0x8e, 0x08, 0x48, 0x46, 0xcc, 0x32, 0x35, 0x73, 0xe0, 0x2d, + 0x58, 0xf5, 0xd0, 0x21, 0x35, 0xe7, 0xd1, 0x59, 0x8e, 0xd6, 0x98, 0xef, 0xf1, 0x6c, 0xc4, 0xbf, + 0x61, 0x69, 0x10, 0x52, 0x2f, 0xb0, 0xc0, 0xb1, 0x85, 0xc8, 0xca, 0x61, 0x57, 0x20, 0x63, 0xf9, + 0xbe, 0x00, 0xe4, 0x38, 0x20, 0x6d, 0xf9, 0x3e, 0x77, 0xdd, 0x84, 0x15, 0xbe, 0xc7, 0x00, 0x91, + 0x89, 0x4b, 0xe5, 0x24, 0x79, 0x8e, 0x59, 0x66, 0x0e, 0x43, 0xd8, 0x39, 0xf6, 0x5f, 0x50, 0x40, + 0x07, 0x8e, 0x8d, 0xbc, 0x01, 0x12, 0xb8, 0x02, 0xc7, 0xe5, 0x43, 0x23, 0x07, 0xdd, 0x80, 0xa2, + 0x1f, 0x60, 0x1f, 0x13, 0x14, 0x98, 0x96, 0x6d, 0x07, 0x88, 0x90, 0xd2, 0x92, 0x98, 0x2f, 0xb4, + 0x37, 0x84, 0x59, 0xbb, 0x04, 0xa9, 0x00, 0x4f, 0x3c, 0xbb, 0xf4, 0x27, 0xa3, 0x2c, 0x65, 0x88, + 0x11, 0x33, 0x8b, 0xf3, 0xf1, 0x97, 0x60, 0x52, 0x1e, 0x80, 0x12, 0xa8, 0x5b, 0x16, 0xb5, 0xb4, + 0x22, 0x24, 0xe9, 0x21, 0x29, 0x29, 0xd5, 0xe4, 0x46, 0xde, 0x60, 0x9f, 0xb5, 0x3f, 0x12, 0xa0, + 0x3e, 0xc6, 0x14, 0x69, 0xb7, 0x41, 0x65, 0x45, 0xe5, 0x4a, 0x5d, 0x3a, 0xab, 0xfc, 0xae, 0x33, + 0xf4, 0x90, 0xbd, 0x47, 0x86, 0xbd, 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03, 0x4c, 0x11, 0x47, 0xdf, 0x82, 0x2b, 0xe7, 0xa0, 0xa3, + 0x8d, 0xad, 0x1c, 0x9f, 0x54, 0x0b, 0x9d, 0x00, 0x89, 0x73, 0xc3, 0x23, 0x74, 0x28, 0x9d, 0x8d, + 0xd8, 0xef, 0xec, 0x77, 0x1b, 0xbb, 0xc5, 0x6a, 0xb9, 0x78, 0x7c, 0x52, 0xcd, 0x87, 0x97, 0x1f, + 0xc3, 0x4f, 0x77, 0xd6, 0xdc, 0x79, 0x79, 0x5a, 0x51, 0x5e, 0x9d, 0x56, 0x94, 0xdf, 0x4f, 0x2b, + 0xca, 0xf3, 0x37, 0x95, 0x85, 0x57, 0x6f, 0x2a, 0x0b, 0xbf, 0xbc, 0xa9, 0x2c, 0x7c, 0xf9, 0xd1, + 0xd0, 0xa1, 0xa3, 0x49, 0x5f, 0x1f, 0xe0, 0x71, 0xdd, 0x75, 0x3c, 0x54, 0x8f, 0xfe, 0x25, 0x88, + 0x3f, 0x28, 0xb3, 0x7f, 0x1a, 0xfa, 0x8b, 0xdc, 0xfa, 0xf1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x13, 0x0b, 0x71, 0xbb, 0xef, 0x0c, 0x00, 0x00, } func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/types/types.proto b/proto/ostracon/types/types.proto index c53d2bd61..1639c75c7 100644 --- a/proto/ostracon/types/types.proto +++ b/proto/ostracon/types/types.proto @@ -6,7 +6,7 @@ option go_package = "github.com/line/ostracon/proto/ostracon/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "tendermint/crypto/proof.proto"; -import "ostracon/version/types.proto"; +import "tendermint/version/types.proto"; import "ostracon/types/validator.proto"; // BlockIdFlag indicates which BlcokID the signature is for @@ -57,7 +57,7 @@ message BlockID { // Header defines the structure of an Ostracon block header. message Header { // basic block info - ostracon.version.Consensus version = 1 [(gogoproto.nullable) = false]; + tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; string chain_id = 2 [(gogoproto.customname) = "ChainID"]; int64 height = 3; google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; diff --git a/proto/ostracon/version/types.pb.go b/proto/ostracon/version/types.pb.go deleted file mode 100644 index 31852df8a..000000000 --- a/proto/ostracon/version/types.pb.go +++ /dev/null @@ -1,576 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/version/types.proto - -package version - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// App includes the protocol and software version for the application. -// This information is included in ResponseInfo. The App.Protocol can be -// updated in ResponseEndBlock. -type App struct { - Protocol uint64 `protobuf:"varint,1,opt,name=protocol,proto3" json:"protocol,omitempty"` - Software string `protobuf:"bytes,2,opt,name=software,proto3" json:"software,omitempty"` -} - -func (m *App) Reset() { *m = App{} } -func (m *App) String() string { return proto.CompactTextString(m) } -func (*App) ProtoMessage() {} -func (*App) Descriptor() ([]byte, []int) { - return fileDescriptor_b542608fc4467892, []int{0} -} -func (m *App) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *App) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_App.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *App) XXX_Merge(src proto.Message) { - xxx_messageInfo_App.Merge(m, src) -} -func (m *App) XXX_Size() int { - return m.Size() -} -func (m *App) XXX_DiscardUnknown() { - xxx_messageInfo_App.DiscardUnknown(m) -} - -var xxx_messageInfo_App proto.InternalMessageInfo - -func (m *App) GetProtocol() uint64 { - if m != nil { - return m.Protocol - } - return 0 -} - -func (m *App) GetSoftware() string { - if m != nil { - return m.Software - } - return "" -} - -// Consensus captures the consensus rules for processing a block in the blockchain, -// including all blockchain data structures and the rules of the application's -// state transition machine. -type Consensus struct { - Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` - App uint64 `protobuf:"varint,2,opt,name=app,proto3" json:"app,omitempty"` -} - -func (m *Consensus) Reset() { *m = Consensus{} } -func (m *Consensus) String() string { return proto.CompactTextString(m) } -func (*Consensus) ProtoMessage() {} -func (*Consensus) Descriptor() ([]byte, []int) { - return fileDescriptor_b542608fc4467892, []int{1} -} -func (m *Consensus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Consensus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Consensus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Consensus) XXX_Merge(src proto.Message) { - xxx_messageInfo_Consensus.Merge(m, src) -} -func (m *Consensus) XXX_Size() int { - return m.Size() -} -func (m *Consensus) XXX_DiscardUnknown() { - xxx_messageInfo_Consensus.DiscardUnknown(m) -} - -var xxx_messageInfo_Consensus proto.InternalMessageInfo - -func (m *Consensus) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Consensus) GetApp() uint64 { - if m != nil { - return m.App - } - return 0 -} - -func init() { - proto.RegisterType((*App)(nil), "ostracon.version.App") - proto.RegisterType((*Consensus)(nil), "ostracon.version.Consensus") -} - -func init() { proto.RegisterFile("ostracon/version/types.proto", fileDescriptor_b542608fc4467892) } - -var fileDescriptor_b542608fc4467892 = []byte{ - // 219 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b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7, 0xe7, 0xea, 0xe7, 0x64, 0xe6, 0xa5, - 0xea, 0xc3, 0x7d, 0x0a, 0x71, 0x3e, 0xba, 0xc7, 0x93, 0xd8, 0xc0, 0xe2, 0xc6, 0x80, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x2e, 0x30, 0xa4, 0xfa, 0x13, 0x01, 0x00, 0x00, -} - -func (this *Consensus) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Consensus) - if !ok { - that2, ok := that.(Consensus) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Block != that1.Block { - return false - } - if this.App != that1.App { - return false - } - return true -} -func (m *App) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *App) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *App) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Software) > 0 { - i -= len(m.Software) - copy(dAtA[i:], m.Software) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Software))) - i-- - dAtA[i] = 0x12 - } - if m.Protocol != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Consensus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Consensus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Consensus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.App != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.App)) - i-- - dAtA[i] = 0x10 - } - if m.Block != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *App) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Protocol != 0 { - n += 1 + sovTypes(uint64(m.Protocol)) - } - l = len(m.Software) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Consensus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != 0 { - n += 1 + sovTypes(uint64(m.Block)) - } - if m.App != 0 { - n += 1 + sovTypes(uint64(m.App)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *App) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: App: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: App: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - m.Protocol = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Protocol |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Software", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Software = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Consensus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Consensus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Consensus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - m.App = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.App |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/state/execution_test.go b/state/execution_test.go index 389d5b866..f7d3031e5 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -9,6 +9,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -18,7 +20,6 @@ import ( "github.com/line/ostracon/libs/log" mmock "github.com/line/ostracon/mempool/mock" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/state/mocks" diff --git a/state/rollback.go b/state/rollback.go index 4876083c2..5016183a8 100644 --- a/state/rollback.go +++ b/state/rollback.go @@ -4,8 +4,9 @@ import ( "errors" "fmt" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + tmstate "github.com/line/ostracon/proto/ostracon/state" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/version" ) diff --git a/state/rollback_test.go b/state/rollback_test.go index 7ff1193ba..a6fec691b 100644 --- a/state/rollback_test.go +++ b/state/rollback_test.go @@ -5,12 +5,12 @@ import ( "testing" "github.com/stretchr/testify/require" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/tmhash" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/state" "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/types" diff --git a/state/state.go b/state/state.go index 300d99f2f..ab9f1868b 100644 --- a/state/state.go +++ b/state/state.go @@ -7,10 +7,11 @@ import ( "os" "time" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/crypto" tmstate "github.com/line/ostracon/proto/ostracon/state" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" diff --git a/statesync/reactor_test.go b/statesync/reactor_test.go index 47d383522..743a0fd73 100644 --- a/statesync/reactor_test.go +++ b/statesync/reactor_test.go @@ -4,26 +4,25 @@ import ( "testing" "time" - "github.com/line/ostracon/config" - "github.com/line/ostracon/libs/log" - tmstate "github.com/line/ostracon/proto/ostracon/state" - tmversion "github.com/line/ostracon/proto/ostracon/version" - "github.com/line/ostracon/proxy" - sm "github.com/line/ostracon/state" - "github.com/line/ostracon/statesync/mocks" - "github.com/line/ostracon/types" - "github.com/line/ostracon/version" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" abci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/config" + "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" p2pmocks "github.com/line/ostracon/p2p/mocks" + tmstate "github.com/line/ostracon/proto/ostracon/state" + "github.com/line/ostracon/proxy" proxymocks "github.com/line/ostracon/proxy/mocks" + sm "github.com/line/ostracon/state" + "github.com/line/ostracon/statesync/mocks" + "github.com/line/ostracon/types" + "github.com/line/ostracon/version" ) func TestReactor_Receive_ChunkRequest(t *testing.T) { diff --git a/statesync/stateprovider_test.go b/statesync/stateprovider_test.go index 4611faac6..a1c597002 100644 --- a/statesync/stateprovider_test.go +++ b/statesync/stateprovider_test.go @@ -9,21 +9,23 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/light" "github.com/line/ostracon/proto/ostracon/state" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" ctypes "github.com/line/ostracon/rpc/core/types" rpcserver "github.com/line/ostracon/rpc/jsonrpc/server" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestNewLightClientStateProvider(t *testing.T) { diff --git a/statesync/syncer_test.go b/statesync/syncer_test.go index b76d3070b..71dece7b7 100644 --- a/statesync/syncer_test.go +++ b/statesync/syncer_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/require" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" @@ -21,7 +22,6 @@ import ( "github.com/line/ostracon/p2p" p2pmocks "github.com/line/ostracon/p2p/mocks" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/proxy" proxymocks "github.com/line/ostracon/proxy/mocks" sm "github.com/line/ostracon/state" diff --git a/store/store_test.go b/store/store_test.go index a44d238be..2c6010933 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -15,12 +15,12 @@ import ( dbm "github.com/tendermint/tm-db" tmstore "github.com/tendermint/tendermint/proto/tendermint/store" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto" "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" - tmversion "github.com/line/ostracon/proto/ostracon/version" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" diff --git a/proto/ostracon/version/types.proto b/third_party/proto/tendermint/version/types.proto similarity index 84% rename from proto/ostracon/version/types.proto rename to third_party/proto/tendermint/version/types.proto index 135dbd49e..6061868bd 100644 --- a/proto/ostracon/version/types.proto +++ b/third_party/proto/tendermint/version/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package ostracon.version; +package tendermint.version; -option go_package = "github.com/line/ostracon/proto/ostracon/version"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/version"; import "gogoproto/gogo.proto"; diff --git a/types/block.go b/types/block.go index 508f53e00..0871f2596 100644 --- a/types/block.go +++ b/types/block.go @@ -12,6 +12,8 @@ import ( "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" @@ -21,7 +23,6 @@ import ( tmmath "github.com/line/ostracon/libs/math" tmsync "github.com/line/ostracon/libs/sync" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/version" ) diff --git a/types/block_test.go b/types/block_test.go index b14ae9bf0..2c04960ee 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -17,6 +17,8 @@ import ( gogotypes "github.com/gogo/protobuf/types" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" @@ -25,7 +27,6 @@ import ( "github.com/line/ostracon/libs/bytes" tmrand "github.com/line/ostracon/libs/rand" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" ) diff --git a/types/evidence_test.go b/types/evidence_test.go index 7c653315a..9ceff4ff8 100644 --- a/types/evidence_test.go +++ b/types/evidence_test.go @@ -8,11 +8,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" tmproto "github.com/line/ostracon/proto/ostracon/types" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/version" ) diff --git a/types/light_test.go b/types/light_test.go index 69ed380c0..e0f4a14b6 100644 --- a/types/light_test.go +++ b/types/light_test.go @@ -7,8 +7,9 @@ import ( "github.com/stretchr/testify/assert" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/line/ostracon/crypto" - tmversion "github.com/line/ostracon/proto/ostracon/version" "github.com/line/ostracon/version" ) diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 3c53aafbe..f358d53fe 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -3,19 +3,17 @@ package types import ( "testing" - "github.com/line/ostracon/crypto/secp256k1" - "github.com/golang/protobuf/proto" // nolint: staticcheck // still used by gogoproto - "github.com/tendermint/go-amino" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/tendermint/go-amino" + tmversion "github.com/tendermint/tendermint/proto/tendermint/version" abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" - "github.com/line/ostracon/proto/ostracon/version" + "github.com/line/ostracon/crypto/secp256k1" "github.com/line/ostracon/types/time" ) @@ -85,7 +83,7 @@ func TestABCIHeader(t *testing.T) { // build a full header var height int64 = 5 header := newHeader(height, []byte("lastCommitHash"), []byte("dataHash"), []byte("evidenceHash")) - protocolVersion := version.Consensus{Block: 7, App: 8} + protocolVersion := tmversion.Consensus{Block: 7, App: 8} timestamp := time.Now() lastBlockID := BlockID{ Hash: []byte("hash"), From 051dc7f5d940d6a49972175614b57bc8df376cef Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 7 Jan 2023 01:08:58 +0900 Subject: [PATCH 07/25] feat: clean up `proto/ostracon/types` proto directory --- abci/example/kvstore/kvstore_test.go | 12 +- abci/types/messages_test.go | 6 +- abci/types/types.pb.go | 387 +-- blockchain/v1/reactor_test.go | 2 +- consensus/byzantine_test.go | 5 +- consensus/common_test.go | 2 +- consensus/invalid_test.go | 3 +- consensus/msgs.go | 3 +- consensus/msgs_test.go | 3 +- consensus/reactor.go | 3 +- consensus/reactor_test.go | 2 +- consensus/replay_test.go | 7 +- consensus/state.go | 6 +- consensus/state_test.go | 10 +- consensus/types/height_vote_set.go | 3 +- consensus/types/height_vote_set_test.go | 3 +- evidence/pool.go | 8 +- evidence/pool_test.go | 2 +- evidence/reactor.go | 8 +- evidence/reactor_test.go | 7 +- evidence/verify_test.go | 2 +- light/helpers_test.go | 2 +- light/store/db/db.go | 4 +- mempool/clist_mempool.go | 3 +- p2p/conn/connection_test.go | 4 +- privval/file.go | 2 +- privval/file_test.go | 3 +- privval/msgs_test.go | 3 +- privval/retry_signer_client.go | 3 +- privval/signer_client.go | 3 +- privval/signer_client_test.go | 3 +- privval/signer_requestHandler.go | 3 +- proto/ostracon/abci/types.proto | 8 +- proto/ostracon/consensus/types.pb.go | 118 +- proto/ostracon/consensus/types.proto | 20 +- proto/ostracon/consensus/wal.pb.go | 73 +- proto/ostracon/consensus/wal.proto | 4 +- proto/ostracon/privval/types.pb.go | 108 +- proto/ostracon/privval/types.proto | 10 +- proto/ostracon/state/types.pb.go | 121 +- proto/ostracon/state/types.proto | 9 +- proto/ostracon/types/block.pb.go | 36 +- proto/ostracon/types/block.proto | 3 +- proto/ostracon/types/canonical.pb.go | 1378 -------- proto/ostracon/types/events.pb.go | 386 --- proto/ostracon/types/evidence.pb.go | 89 +- proto/ostracon/types/evidence.proto | 5 +- proto/ostracon/types/params.pb.go | 1780 ---------- proto/ostracon/types/types.pb.go | 3009 ++--------------- proto/ostracon/types/types.proto | 159 +- rpc/client/evidence_test.go | 3 +- rpc/core/types/responses.go | 3 +- state/execution.go | 3 +- state/execution_test.go | 2 +- state/export_test.go | 2 +- state/helpers_test.go | 2 +- state/mocks/store.go | 15 +- state/state.go | 2 +- state/state_test.go | 2 +- state/store.go | 2 +- state/store_test.go | 2 +- state/validation_test.go | 3 +- statesync/messages_test.go | 4 +- statesync/stateprovider_test.go | 2 +- store/store.go | 11 +- test/kms/bench_test.go | 10 +- .../proto/tendermint/consensus/types.proto | 92 + .../proto/tendermint/consensus/wal.proto | 46 + .../proto/tendermint/types/block.proto | 15 + .../proto/tendermint}/types/canonical.proto | 6 +- .../proto/tendermint}/types/events.proto | 4 +- .../proto/tendermint/types/evidence.proto | 38 + .../proto/tendermint}/types/params.proto | 4 +- .../proto/tendermint/types/types.proto | 157 + .../proto/tendermint/types/validator.proto | 25 + .../internal/test_harness.go | 9 +- types/block.go | 32 +- types/block_meta.go | 8 +- types/block_test.go | 2 +- types/canonical.go | 3 +- types/canonical_test.go | 3 +- types/evidence.go | 34 +- types/evidence_test.go | 2 +- types/genesis.go | 3 +- types/light.go | 14 +- types/params.go | 3 +- types/params_test.go | 3 +- types/part_set.go | 3 +- types/priv_validator.go | 3 +- types/proposal.go | 3 +- types/proposal_test.go | 3 +- types/protobuf.go | 8 +- types/signed_msg_type.go | 2 +- types/test_util.go | 2 +- types/tx.go | 3 +- types/tx_test.go | 3 +- types/validator.go | 10 +- types/validator_set.go | 12 +- types/validator_set_test.go | 10 +- types/vote.go | 3 +- types/vote_set.go | 3 +- types/vote_set_test.go | 2 +- types/vote_test.go | 3 +- 103 files changed, 1447 insertions(+), 7030 deletions(-) delete mode 100644 proto/ostracon/types/canonical.pb.go delete mode 100644 proto/ostracon/types/events.pb.go delete mode 100644 proto/ostracon/types/params.pb.go create mode 100644 third_party/proto/tendermint/consensus/types.proto create mode 100644 third_party/proto/tendermint/consensus/wal.proto create mode 100644 third_party/proto/tendermint/types/block.proto rename {proto/ostracon => third_party/proto/tendermint}/types/canonical.proto (91%) rename {proto/ostracon => third_party/proto/tendermint}/types/events.proto (52%) create mode 100644 third_party/proto/tendermint/types/evidence.proto rename {proto/ostracon => third_party/proto/tendermint}/types/params.proto (95%) create mode 100644 third_party/proto/tendermint/types/types.proto create mode 100644 third_party/proto/tendermint/types/validator.proto diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 969764d98..f641ef30f 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -7,17 +7,15 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/line/ostracon/libs/log" - "github.com/line/ostracon/libs/service" - abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/code" abciserver "github.com/line/ostracon/abci/server" "github.com/line/ostracon/abci/types" - tmproto "github.com/line/ostracon/proto/ostracon/types" + "github.com/line/ostracon/libs/log" + "github.com/line/ostracon/libs/service" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) const ( @@ -105,7 +103,7 @@ func TestPersistentKVStoreInfo(t *testing.T) { // make and apply block height = int64(1) hash := []byte("foo") - header := tmproto.Header{ + header := ocproto.Header{ Height: height, } kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header}) @@ -198,7 +196,7 @@ func makeApplyBlock( // make and apply block height := int64(heightInt) hash := []byte("foo") - header := tmproto.Header{ + header := ocproto.Header{ Height: height, } diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index df0853cec..f5d488ae7 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -9,7 +9,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) func TestMarshalJSON(t *testing.T) { @@ -61,7 +61,7 @@ func TestWriteReadMessageSimple(t *testing.T) { func TestWriteReadMessage(t *testing.T) { cases := []proto.Message{ - &tmproto.Header{ + &ocproto.Header{ Height: 4, ChainID: "test", }, @@ -73,7 +73,7 @@ func TestWriteReadMessage(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(tmproto.Header) + msg := new(ocproto.Header) err = ReadMessage(buf, msg) assert.Nil(t, err) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index d66a77e5b..8fdd2d64a 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -13,6 +13,7 @@ import ( crypto1 "github.com/line/ostracon/proto/ostracon/crypto" types1 "github.com/line/ostracon/proto/ostracon/types" crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + types2 "github.com/tendermint/tendermint/proto/tendermint/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -2722,9 +2723,9 @@ func (m *ResponseEndRecheckTx) GetCode() uint32 { // that can be adjusted by the abci app type ConsensusParams struct { Block *BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Evidence *types1.EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *types1.ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` - Version *types1.VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Evidence *types2.EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *types2.ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` + Version *types2.VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` } func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } @@ -2767,21 +2768,21 @@ func (m *ConsensusParams) GetBlock() *BlockParams { return nil } -func (m *ConsensusParams) GetEvidence() *types1.EvidenceParams { +func (m *ConsensusParams) GetEvidence() *types2.EvidenceParams { if m != nil { return m.Evidence } return nil } -func (m *ConsensusParams) GetValidator() *types1.ValidatorParams { +func (m *ConsensusParams) GetValidator() *types2.ValidatorParams { if m != nil { return m.Validator } return nil } -func (m *ConsensusParams) GetVersion() *types1.VersionParams { +func (m *ConsensusParams) GetVersion() *types2.VersionParams { if m != nil { return m.Version } @@ -3458,190 +3459,190 @@ func init() { func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_addf585b2317eb36) } var fileDescriptor_addf585b2317eb36 = []byte{ - // 2919 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0x4b, 0x73, 0x23, 0xd5, - 0x15, 0xd6, 0x5b, 0xea, 0x63, 0x4b, 0x96, 0xef, 0x98, 0x19, 0xd1, 0x03, 0xf6, 0xa4, 0x27, 0x04, - 0x98, 0x80, 0x0d, 0x33, 0x24, 0xbc, 0x02, 0x41, 0xd6, 0x08, 0xe4, 0xd8, 0x63, 0x7b, 0xda, 0x62, - 0x28, 0x5e, 0x69, 0x5a, 0xd2, 0xb5, 0xd5, 0x19, 0xa9, 0xbb, 0xe9, 0xbe, 0x32, 0x76, 0x96, 0x49, - 0xa5, 0x2a, 0xc5, 0x8a, 0xaa, 0x54, 0x65, 0xc7, 0xff, 0xc8, 0x22, 0x55, 0x59, 0x86, 0x25, 0xcb, - 0x54, 0x16, 0x24, 0x05, 0x8b, 0x3c, 0xfe, 0x00, 0x95, 0x4d, 0x92, 0xba, 0x8f, 0x7e, 0xba, 0xbb, - 0xa5, 0x81, 0xec, 0xb2, 0xbb, 0xf7, 0xf4, 0x39, 0xa7, 0xef, 0xf3, 0x3b, 0xdf, 0x39, 0xdd, 0xf0, -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8a, 0xb2, 0xe8, 0x2d, 0x58, 0x8e, 0x50, 0xeb, 0x05, 0x7e, 0x35, - 0x90, 0x17, 0xa9, 0xce, 0x6e, 0xbf, 0xf2, 0xd9, 0x97, 0xeb, 0xf9, 0xcf, 0xbf, 0x5c, 0xcf, 0xff, - 0xf5, 0xcb, 0xf5, 0xfc, 0x27, 0x5f, 0xad, 0xe7, 0x3e, 0xff, 0x6a, 0x3d, 0xf7, 0xa7, 0xaf, 0xd6, - 0x73, 0xef, 0x5c, 0x3f, 0x31, 0xc8, 0x78, 0x36, 0xd8, 0x1c, 0x5a, 0xd3, 0xad, 0x89, 0x61, 0xe2, - 0xad, 0x84, 0x7f, 0xc1, 0x06, 0x15, 0x16, 0x1c, 0x6f, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0x91, - 0x00, 0x74, 0x9c, 0x29, 0x26, 0x00, 0x00, + // 2925 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0x4b, 0x73, 0xe3, 0xc6, + 0x11, 0xe6, 0x9b, 0x44, 0x4b, 0xa4, 0xa8, 0x59, 0x79, 0x97, 0x86, 0x6d, 0x69, 0x8d, 0x8d, 0x63, + 0x7b, 0x63, 0x4b, 0xf6, 0xae, 0x93, 0xf8, 0x6d, 0x53, 0x5c, 0xda, 0x54, 0xa4, 0x95, 0xb4, 0x10, + 0xbd, 0x2e, 0xbf, 0x02, 0x83, 0xe4, 0x88, 0x44, 0x96, 0x04, 0x60, 0x60, 0x28, 0x4b, 0x39, 0x26, + 0x95, 0xaa, 0x94, 0x4f, 0xae, 0x4a, 0x55, 0x6e, 0xfe, 0x1f, 0x39, 0xa4, 0x2a, 0xc7, 0xf8, 0xe8, + 0x63, 0x2a, 0x07, 0x27, 0x65, 0x1f, 0xf2, 0xf8, 0x03, 0xa9, 0x1c, 0xf2, 0xa8, 0x79, 0xe0, 0x45, + 0x02, 0x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c, 0x7c, 0x4f, 0x16, + 0x7d, 0x00, 0xb5, 0x19, 0xbe, 0xbc, 0xd4, 0x4f, 0x06, 0xf2, 0x72, 0xad, 0x59, 0xf4, 0x36, 0xac, + 0x46, 0x08, 0xf6, 0x12, 0x3f, 0x1c, 0xc8, 0xcb, 0xf4, 0x68, 0x77, 0x5f, 0xf9, 0xfc, 0xab, 0xcd, + 0xec, 0x17, 0x5f, 0x6d, 0x66, 0xff, 0xfc, 0xd5, 0x66, 0xf6, 0xd3, 0xaf, 0x37, 0x33, 0x5f, 0x7c, + 0xbd, 0x99, 0xf9, 0xc3, 0xd7, 0x9b, 0x99, 0x77, 0xaf, 0x0d, 0x0d, 0x32, 0x9a, 0xf6, 0xb6, 0xfb, + 0xd6, 0x64, 0x67, 0x6c, 0x98, 0x78, 0x27, 0xe6, 0x9f, 0xb0, 0x5e, 0x89, 0x25, 0xc7, 0x9b, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xd8, 0x1d, 0xa3, 0x31, 0x26, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -14176,7 +14177,7 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Evidence == nil { - m.Evidence = &types1.EvidenceParams{} + m.Evidence = &types2.EvidenceParams{} } if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -14212,7 +14213,7 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Validator == nil { - m.Validator = &types1.ValidatorParams{} + m.Validator = &types2.ValidatorParams{} } if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -14248,7 +14249,7 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Version == nil { - m.Version = &types1.VersionParams{} + m.Version = &types2.VersionParams{} } if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/blockchain/v1/reactor_test.go b/blockchain/v1/reactor_test.go index 6f69d2c23..92d89becb 100644 --- a/blockchain/v1/reactor_test.go +++ b/blockchain/v1/reactor_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -18,7 +19,6 @@ import ( "github.com/line/ostracon/libs/log" "github.com/line/ostracon/mempool/mock" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/store" diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index 12493f791..0caf325c8 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -12,19 +12,18 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - config2 "github.com/line/ostracon/config" - abcicli "github.com/line/ostracon/abci/client" abci "github.com/line/ostracon/abci/types" + config2 "github.com/line/ostracon/config" "github.com/line/ostracon/evidence" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" mempl "github.com/line/ostracon/mempool" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/store" "github.com/line/ostracon/types" diff --git a/consensus/common_test.go b/consensus/common_test.go index bd452915b..da4879d4b 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -17,6 +17,7 @@ import ( "github.com/go-kit/log/term" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abcicli "github.com/line/ostracon/abci/client" @@ -33,7 +34,6 @@ import ( mempl "github.com/line/ostracon/mempool" "github.com/line/ostracon/p2p" "github.com/line/ostracon/privval" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/store" "github.com/line/ostracon/types" diff --git a/consensus/invalid_test.go b/consensus/invalid_test.go index b5ca03c7e..adba6bd59 100644 --- a/consensus/invalid_test.go +++ b/consensus/invalid_test.go @@ -3,11 +3,12 @@ package consensus import ( "testing" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/consensus/msgs.go b/consensus/msgs.go index 72daaf4a8..8555dcb7a 100644 --- a/consensus/msgs.go +++ b/consensus/msgs.go @@ -6,12 +6,13 @@ import ( "github.com/gogo/protobuf/proto" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + cstypes "github.com/line/ostracon/consensus/types" "github.com/line/ostracon/libs/bits" tmmath "github.com/line/ostracon/libs/math" "github.com/line/ostracon/p2p" tmcons "github.com/line/ostracon/proto/ostracon/consensus" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/consensus/msgs_test.go b/consensus/msgs_test.go index 7c975aac2..c44133898 100644 --- a/consensus/msgs_test.go +++ b/consensus/msgs_test.go @@ -10,12 +10,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/libs/bits" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/p2p" tmcons "github.com/line/ostracon/proto/ostracon/consensus" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/consensus/reactor.go b/consensus/reactor.go index 4c417f5ad..b6bf875a6 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -9,6 +9,8 @@ import ( "github.com/gogo/protobuf/proto" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + cstypes "github.com/line/ostracon/consensus/types" "github.com/line/ostracon/libs/bits" tmevents "github.com/line/ostracon/libs/events" @@ -17,7 +19,6 @@ import ( tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" tmcons "github.com/line/ostracon/proto/ostracon/consensus" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 1c6b85d30..7bc688d8a 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abcicli "github.com/line/ostracon/abci/client" @@ -31,7 +32,6 @@ import ( mempl "github.com/line/ostracon/mempool" "github.com/line/ostracon/p2p" p2pmock "github.com/line/ostracon/p2p/mock" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" statemocks "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/store" diff --git a/consensus/replay_test.go b/consensus/replay_test.go index bd04a1d4f..dc27322a2 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -16,6 +16,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/kvstore" @@ -29,7 +30,7 @@ import ( mempl "github.com/line/ostracon/mempool" "github.com/line/ostracon/privval" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" @@ -1093,7 +1094,7 @@ func makeBlockchainFromWAL(wal WAL) ([]*types.Block, []*types.Commit, error) { case EndHeightMessage: // if its not the first one, we have a full block if thisBlockParts != nil { - var pbb = new(tmproto.Block) + var pbb = new(ocproto.Block) bz, err := ioutil.ReadAll(thisBlockParts.GetReader()) if err != nil { panic(err) @@ -1137,7 +1138,7 @@ func makeBlockchainFromWAL(wal WAL) ([]*types.Block, []*types.Commit, error) { if err != nil { panic(err) } - var pbb = new(tmproto.Block) + var pbb = new(ocproto.Block) err = proto.Unmarshal(bz, pbb) if err != nil { panic(err) diff --git a/consensus/state.go b/consensus/state.go index c3160dff0..1f4ad89c7 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -12,6 +12,8 @@ import ( "github.com/gogo/protobuf/proto" "github.com/pkg/errors" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + cfg "github.com/line/ostracon/config" cstypes "github.com/line/ostracon/consensus/types" "github.com/line/ostracon/crypto" @@ -24,7 +26,7 @@ import ( "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" @@ -1984,7 +1986,7 @@ func (cs *State) addProposalBlockPart(msg *BlockPartMessage, peerID p2p.ID) (add return added, err } - var pbb = new(tmproto.Block) + var pbb = new(ocproto.Block) err = proto.Unmarshal(bz, pbb) if err != nil { return added, err diff --git a/consensus/state_test.go b/consensus/state_test.go index a25b63c71..bccd11b43 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -7,21 +7,21 @@ import ( "testing" "time" - abci "github.com/line/ostracon/abci/types" - "github.com/line/ostracon/abci/types/mocks" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/abci/example/counter" + abci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types/mocks" cstypes "github.com/line/ostracon/consensus/types" "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/libs/log" tmpubsub "github.com/line/ostracon/libs/pubsub" tmrand "github.com/line/ostracon/libs/rand" p2pmock "github.com/line/ostracon/p2p/mock" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/consensus/types/height_vote_set.go b/consensus/types/height_vote_set.go index 711331dc9..6581c7ff3 100644 --- a/consensus/types/height_vote_set.go +++ b/consensus/types/height_vote_set.go @@ -6,10 +6,11 @@ import ( "strings" "sync" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmjson "github.com/line/ostracon/libs/json" tmmath "github.com/line/ostracon/libs/math" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/consensus/types/height_vote_set_test.go b/consensus/types/height_vote_set_test.go index d2f448622..9de1ad145 100644 --- a/consensus/types/height_vote_set_test.go +++ b/consensus/types/height_vote_set_test.go @@ -5,10 +5,11 @@ import ( "os" "testing" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" ) diff --git a/evidence/pool.go b/evidence/pool.go index 5356affc5..1f358dc84 100644 --- a/evidence/pool.go +++ b/evidence/pool.go @@ -14,7 +14,7 @@ import ( "github.com/line/ostracon/libs/clist" "github.com/line/ostracon/libs/log" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" ) @@ -362,7 +362,7 @@ func (evpool *Pool) listEvidence(prefixKey byte, maxBytes int64) ([]types.Eviden evSize int64 totalSize int64 evidence []types.Evidence - evList tmproto.EvidenceList // used for calculating the bytes size + evList ocproto.EvidenceList // used for calculating the bytes size ) iter, err := dbm.IteratePrefix(evpool.evidenceStore, []byte{prefixKey}) @@ -371,7 +371,7 @@ func (evpool *Pool) listEvidence(prefixKey byte, maxBytes int64) ([]types.Eviden } defer iter.Close() for ; iter.Valid(); iter.Next() { - var evpb tmproto.Evidence + var evpb ocproto.Evidence err := evpb.Unmarshal(iter.Value()) if err != nil { return evidence, totalSize, err @@ -534,7 +534,7 @@ type duplicateVoteSet struct { } func bytesToEv(evBytes []byte) (types.Evidence, error) { - var evpb tmproto.Evidence + var evpb ocproto.Evidence err := evpb.Unmarshal(evBytes) if err != nil { return &types.DuplicateVoteEvidence{}, err diff --git a/evidence/pool_test.go b/evidence/pool_test.go index d85114081..63f71f3d7 100644 --- a/evidence/pool_test.go +++ b/evidence/pool_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" @@ -16,7 +17,6 @@ import ( "github.com/line/ostracon/evidence" "github.com/line/ostracon/evidence/mocks" "github.com/line/ostracon/libs/log" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" smmocks "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/store" diff --git a/evidence/reactor.go b/evidence/reactor.go index d4f1ce941..59e04e3d4 100644 --- a/evidence/reactor.go +++ b/evidence/reactor.go @@ -7,7 +7,7 @@ import ( clist "github.com/line/ostracon/libs/clist" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) @@ -211,7 +211,7 @@ type PeerState interface { // encodemsg takes a array of evidence // returns the byte encoding of the List Message func encodeMsg(evis []types.Evidence) ([]byte, error) { - evi := make([]tmproto.Evidence, len(evis)) + evi := make([]ocproto.Evidence, len(evis)) for i := 0; i < len(evis); i++ { ev, err := types.EvidenceToProto(evis[i]) if err != nil { @@ -219,7 +219,7 @@ func encodeMsg(evis []types.Evidence) ([]byte, error) { } evi[i] = *ev } - epl := tmproto.EvidenceList{ + epl := ocproto.EvidenceList{ Evidence: evi, } @@ -229,7 +229,7 @@ func encodeMsg(evis []types.Evidence) ([]byte, error) { // decodemsg takes an array of bytes // returns an array of evidence func decodeMsg(bz []byte) (evis []types.Evidence, err error) { - lm := tmproto.EvidenceList{} + lm := ocproto.EvidenceList{} if err := lm.Unmarshal(bz); err != nil { return nil, err } diff --git a/evidence/reactor_test.go b/evidence/reactor_test.go index 4cbd105f3..bc4bf1ae5 100644 --- a/evidence/reactor_test.go +++ b/evidence/reactor_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" cfg "github.com/line/ostracon/config" @@ -23,7 +24,7 @@ import ( "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" p2pmocks "github.com/line/ostracon/p2p/mocks" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" ) @@ -396,14 +397,14 @@ func TestEvidenceVectors(t *testing.T) { for _, tc := range testCases { tc := tc - evi := make([]tmproto.Evidence, len(tc.evidenceList)) + evi := make([]ocproto.Evidence, len(tc.evidenceList)) for i := 0; i < len(tc.evidenceList); i++ { ev, err := types.EvidenceToProto(tc.evidenceList[i]) require.NoError(t, err, tc.testName) evi[i] = *ev } - epl := tmproto.EvidenceList{ + epl := ocproto.EvidenceList{ Evidence: evi, } diff --git a/evidence/verify_test.go b/evidence/verify_test.go index ce6158810..a0da17ce4 100644 --- a/evidence/verify_test.go +++ b/evidence/verify_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" @@ -18,7 +19,6 @@ import ( "github.com/line/ostracon/evidence/mocks" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/light" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" smmocks "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/types" diff --git a/light/helpers_test.go b/light/helpers_test.go index 925e3c3cb..8ae96e278 100644 --- a/light/helpers_test.go +++ b/light/helpers_test.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/crypto" @@ -12,7 +13,6 @@ import ( "github.com/line/ostracon/crypto/tmhash" tmbytes "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" diff --git a/light/store/db/db.go b/light/store/db/db.go index d53ef8cfd..948699189 100644 --- a/light/store/db/db.go +++ b/light/store/db/db.go @@ -10,7 +10,7 @@ import ( tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/light/store" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) @@ -120,7 +120,7 @@ func (s *dbs) LightBlock(height int64) (*types.LightBlock, error) { return nil, store.ErrLightBlockNotFound } - var lbpb tmproto.LightBlock + var lbpb ocproto.LightBlock err = lbpb.Unmarshal(bz) if err != nil { return nil, fmt.Errorf("unmarshal error: %w", err) diff --git a/mempool/clist_mempool.go b/mempool/clist_mempool.go index 05bf20adb..2766dc2c4 100644 --- a/mempool/clist_mempool.go +++ b/mempool/clist_mempool.go @@ -8,6 +8,8 @@ import ( "sync/atomic" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + abci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" auto "github.com/line/ostracon/libs/autofile" @@ -17,7 +19,6 @@ import ( tmos "github.com/line/ostracon/libs/os" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" ) diff --git a/p2p/conn/connection_test.go b/p2p/conn/connection_test.go index 78dad8903..64b8fa624 100644 --- a/p2p/conn/connection_test.go +++ b/p2p/conn/connection_test.go @@ -15,7 +15,7 @@ import ( "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/protoio" - "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) const maxPingPongPacketSize = 1024 // bytes @@ -533,7 +533,7 @@ func TestMConnectionReadErrorUnknownMsgType(t *testing.T) { defer mconnServer.Stop() // nolint:errcheck // ignore for tests // send msg with unknown msg type - _, err := protoio.NewDelimitedWriter(mconnClient.conn).WriteMsg(&types.Header{ChainID: "x"}) + _, err := protoio.NewDelimitedWriter(mconnClient.conn).WriteMsg(&ocproto.Header{ChainID: "x"}) require.NoError(t, err) assert.True(t, expectSend(chOnErr), "unknown msg type") } diff --git a/privval/file.go b/privval/file.go index b1a22e2aa..79e001d08 100644 --- a/privval/file.go +++ b/privval/file.go @@ -8,6 +8,7 @@ import ( "time" "github.com/gogo/protobuf/proto" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -16,7 +17,6 @@ import ( tmos "github.com/line/ostracon/libs/os" "github.com/line/ostracon/libs/protoio" "github.com/line/ostracon/libs/tempfile" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" ) diff --git a/privval/file_test.go b/privval/file_test.go index 50a614d8c..6e4941f90 100644 --- a/privval/file_test.go +++ b/privval/file_test.go @@ -9,6 +9,8 @@ import ( "testing" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -16,7 +18,6 @@ import ( "github.com/line/ostracon/crypto/tmhash" tmjson "github.com/line/ostracon/libs/json" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" ) diff --git a/privval/msgs_test.go b/privval/msgs_test.go index 4f7ecdc00..53ef049f1 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/require" @@ -14,7 +16,6 @@ import ( "github.com/line/ostracon/crypto/tmhash" cryptoproto "github.com/line/ostracon/proto/ostracon/crypto" privproto "github.com/line/ostracon/proto/ostracon/privval" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/privval/retry_signer_client.go b/privval/retry_signer_client.go index ec601f7c3..6e0ceee84 100644 --- a/privval/retry_signer_client.go +++ b/privval/retry_signer_client.go @@ -4,8 +4,9 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/privval/signer_client.go b/privval/signer_client.go index 2c2a21c63..5c76b01d4 100644 --- a/privval/signer_client.go +++ b/privval/signer_client.go @@ -4,10 +4,11 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" privvalproto "github.com/line/ostracon/proto/ostracon/privval" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/privval/signer_client_test.go b/privval/signer_client_test.go index 1aef3e020..3357e53d6 100644 --- a/privval/signer_client_test.go +++ b/privval/signer_client_test.go @@ -8,6 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/tmhash" @@ -15,7 +17,6 @@ import ( tmrand "github.com/line/ostracon/libs/rand" cryptoproto "github.com/line/ostracon/proto/ostracon/crypto" privvalproto "github.com/line/ostracon/proto/ostracon/privval" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/privval/signer_requestHandler.go b/privval/signer_requestHandler.go index 133f33025..605e21590 100644 --- a/privval/signer_requestHandler.go +++ b/privval/signer_requestHandler.go @@ -3,11 +3,12 @@ package privval import ( "fmt" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" cryptoproto "github.com/line/ostracon/proto/ostracon/crypto" privvalproto "github.com/line/ostracon/proto/ostracon/privval" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index a7c1a9144..2dbb73992 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -6,9 +6,9 @@ option go_package = "github.com/line/ostracon/abci/types"; // For more information on gogo.proto, see: // https://github.com/gogo/protobuf/blob/master/extensions.md import "tendermint/crypto/proof.proto"; +import "tendermint/types/params.proto"; import "ostracon/types/types.proto"; import "ostracon/crypto/keys.proto"; -import "ostracon/types/params.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; @@ -309,9 +309,9 @@ message ResponseEndRecheckTx { // that can be adjusted by the abci app message ConsensusParams { BlockParams block = 1; - ostracon.types.EvidenceParams evidence = 2; - ostracon.types.ValidatorParams validator = 3; - ostracon.types.VersionParams version = 4; + tendermint.types.EvidenceParams evidence = 2; + tendermint.types.ValidatorParams validator = 3; + tendermint.types.VersionParams version = 4; } // BlockParams contains limits on the block size. diff --git a/proto/ostracon/consensus/types.pb.go b/proto/ostracon/consensus/types.pb.go index 7da044756..8b7d3cc1d 100644 --- a/proto/ostracon/consensus/types.pb.go +++ b/proto/ostracon/consensus/types.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - types "github.com/line/ostracon/proto/ostracon/types" bits "github.com/tendermint/tendermint/proto/tendermint/libs/bits" + types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" math "math" math_bits "math/bits" @@ -398,7 +398,7 @@ func (m *Vote) GetVote() *types.Vote { type HasVote struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=ostracon.types.SignedMsgType" json:"type,omitempty"` + Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` Index int32 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"` } @@ -467,7 +467,7 @@ func (m *HasVote) GetIndex() int32 { type VoteSetMaj23 struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=ostracon.types.SignedMsgType" json:"type,omitempty"` + Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` } @@ -536,7 +536,7 @@ func (m *VoteSetMaj23) GetBlockID() types.BlockID { type VoteSetBits struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=ostracon.types.SignedMsgType" json:"type,omitempty"` + Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` Votes bits.BitArray `protobuf:"bytes,5,opt,name=votes,proto3" json:"votes"` } @@ -801,61 +801,61 @@ func init() { func init() { proto.RegisterFile("ostracon/consensus/types.proto", fileDescriptor_0ef76b376cac7abc) } var fileDescriptor_0ef76b376cac7abc = []byte{ - // 858 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcd, 0x92, 0xdb, 0x44, - 0x10, 0x96, 0x58, 0x79, 0xed, 0x6d, 0xed, 0x0f, 0x4c, 0x6d, 0x40, 0xe5, 0x10, 0xad, 0xd1, 0xc9, - 0x45, 0x51, 0x32, 0x71, 0x0e, 0x50, 0x39, 0x40, 0xa1, 0x04, 0x50, 0x2a, 0xd9, 0xc4, 0x25, 0xa7, - 0xf6, 0xc0, 0x45, 0x25, 0x5b, 0x53, 0xf6, 0x80, 0xa4, 0x51, 0x69, 0xc6, 0x5e, 0xf6, 0xc6, 0x23, - 0xf0, 0x00, 0x3c, 0x06, 0xbc, 0x43, 0x8e, 0x39, 0x72, 0x4a, 0x51, 0x5e, 0xee, 0x1c, 0x78, 0x01, - 0x6a, 0x46, 0x63, 0x59, 0x5e, 0xdb, 0xc0, 0x1e, 0x38, 0x70, 0x93, 0xdc, 0xdd, 0xdf, 0xf4, 0x7c, - 0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f6, 0xe9, - 0xb6, 0x31, 0xaa, 0x13, 0x65, 0x9e, 0xf3, 0x31, 0x18, 0x17, 0x94, 0x63, 0xd4, 0x05, 0x63, 0x4e, - 0x39, 0x56, 0x4c, 0x6e, 0xd4, 0x89, 0x9c, 0x40, 0x66, 0x38, 0x3f, 0xe8, 0xd0, 0xf4, 0x23, 0x26, - 0xab, 0x6e, 0xd7, 0xdb, 0x7d, 0x30, 0x04, 0x9a, 0xec, 0xed, 0x78, 0x73, 0xc5, 0x86, 0x64, 0x92, - 0xe1, 0xf8, 0x9c, 0x4d, 0x5e, 0x5e, 0xe5, 0x38, 0x90, 0xa9, 0x02, 0x88, 0x64, 0x31, 0xfe, 0x5e, - 0x2e, 0x52, 0x23, 0x28, 0x5f, 0x9c, 0x9f, 0x75, 0x38, 0x14, 0xe7, 0x0f, 0x31, 0x3f, 0x8f, 0xbe, - 0xed, 0x3f, 0xf8, 0xef, 0xfb, 0x78, 0x04, 0xad, 0x72, 0xad, 0x49, 0xac, 0x76, 0xfa, 0xbd, 0x9b, - 0x65, 0x72, 0x62, 0x4f, 0x1e, 0x7b, 0x27, 0x82, 0xdd, 0xc5, 0x9b, 0xb3, 0xa6, 0xfa, 0x21, 0x68, - 0xca, 0xca, 0x27, 0xb1, 0xf3, 0x87, 0x0e, 0xa6, 0x6a, 0xdb, 0x23, 0x9c, 0xfd, 0x3f, 0xba, 0x46, - 0x0f, 0xa1, 0x21, 0xe6, 0xce, 0xa4, 0x18, 0xff, 0xed, 0x3a, 0x97, 0x25, 0xce, 0xef, 0x06, 0x34, - 0xcf, 0x31, 0x63, 0xd1, 0x04, 0x23, 0x1f, 0x8e, 0x33, 0x7c, 0x59, 0x4a, 0x28, 0x94, 0xa6, 0x59, - 0xee, 0x5a, 0xc7, 0xdd, 0xb4, 0x7a, 0xb7, 0x6e, 0xc9, 0xbe, 0x16, 0x1c, 0x66, 0x75, 0x8b, 0x7e, - 0x0a, 0x27, 0x02, 0x69, 0x2e, 0xbc, 0x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, 0x42, 0x32, 0xdc, 0xab, - 0x3e, 0x16, 0xca, 0xef, 0x88, 0xcd, 0xaf, 0x90, 0xd1, 0xbe, 0x8c, 0x3c, 0xf8, 0x2b, 0x00, 0x00, - 0xff, 0xff, 0x72, 0x53, 0xad, 0xb2, 0xa2, 0x08, 0x00, 0x00, + // 859 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x41, 0x8f, 0xdb, 0x44, + 0x14, 0xb6, 0x59, 0x67, 0x93, 0x7d, 0x4e, 0x76, 0x61, 0xd4, 0x56, 0x26, 0x2d, 0xde, 0xe0, 0xd3, + 0x0a, 0x21, 0x07, 0xb2, 0x07, 0x50, 0x85, 0x40, 0x98, 0x56, 0xb8, 0x6a, 0xb7, 0x8d, 0x9c, 0xaa, + 0x42, 0x5c, 0x2c, 0x27, 0x1e, 0x25, 0x43, 0x6d, 0x8f, 0xe5, 0x99, 0x64, 0xd9, 0x2b, 0xbf, 0x80, + 0x1f, 0xc0, 0xdf, 0x40, 0xe2, 0x27, 0xf4, 0xd8, 0x23, 0xa7, 0x15, 0xca, 0xf2, 0x0f, 0x10, 0x77, + 0x34, 0xe3, 0x49, 0xe2, 0xb0, 0x0e, 0xb0, 0x17, 0xa4, 0xde, 0x62, 0xbf, 0xf7, 0x7d, 0xf3, 0xe6, + 0x7b, 0xef, 0x7d, 0x31, 0xd8, 0x94, 0xf1, 0x22, 0x9a, 0xd0, 0xac, 0x3f, 0xa1, 0x19, 0xc3, 0x19, + 0x9b, 0xb3, 0x3e, 0xbf, 0xc8, 0x31, 0x73, 0xf3, 0x82, 0x72, 0x8a, 0xd0, 0x2a, 0xee, 0xae, 0xe3, + 0xdd, 0x5b, 0x53, 0x3a, 0xa5, 0x32, 0xdc, 0x17, 0xbf, 0xca, 0xcc, 0x6e, 0x8f, 0xe3, 0x2c, 0xc6, + 0x45, 0x4a, 0x32, 0xde, 0x4f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4, 0x39, 0xc0, 0xc6, 0x42, 0x95, 0xca, 0xef, 0xd5, + 0x71, 0xac, 0x1d, 0xc2, 0xd7, 0x82, 0x83, 0xb5, 0x85, 0x22, 0x57, 0xad, 0xf1, 0xbe, 0x44, 0x5a, + 0x75, 0x48, 0x31, 0x79, 0xbe, 0x56, 0xae, 0x32, 0xfa, 0x14, 0x5a, 0xb3, 0x88, 0x85, 0x12, 0xd3, + 0x94, 0x98, 0xbb, 0x75, 0x18, 0xb5, 0xed, 0xbe, 0x16, 0x34, 0x67, 0x6a, 0xf1, 0x7d, 0x38, 0x14, + 0x28, 0xf9, 0x07, 0x92, 0x8a, 0x05, 0xb4, 0x5a, 0xbb, 0x5b, 0x58, 0x5d, 0x54, 0xd1, 0xc2, 0x45, + 0x75, 0x71, 0x1f, 0x42, 0x67, 0xcd, 0x24, 0xe6, 0xc7, 0x3a, 0xd8, 0x2d, 0x5d, 0x65, 0x6d, 0x84, + 0x74, 0x8b, 0xcd, 0xa3, 0xd7, 0x80, 0x3d, 0x36, 0x4f, 0xbd, 0xc7, 0xaf, 0x96, 0xb6, 0xfe, 0x7a, + 0x69, 0xeb, 0xbf, 0x2d, 0x6d, 0xfd, 0xc7, 0x2b, 0x5b, 0x7b, 0x7d, 0x65, 0x6b, 0xbf, 0x5e, 0xd9, + 0xda, 0xb7, 0x1f, 0x4f, 0x09, 0x9f, 0xcd, 0xc7, 0xee, 0x84, 0xa6, 0xfd, 0x84, 0x64, 0xb8, 0xbf, + 0xfe, 0x14, 0x29, 0xbf, 0x2d, 0xae, 0x7f, 0x99, 0x8c, 0xf7, 0x65, 0xe4, 0xf4, 0xaf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xd3, 0x7f, 0xca, 0x8d, 0xb6, 0x08, 0x00, 0x00, } func (m *NewRoundStep) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/consensus/types.proto b/proto/ostracon/consensus/types.proto index c4a0c846f..0d51ec310 100644 --- a/proto/ostracon/consensus/types.proto +++ b/proto/ostracon/consensus/types.proto @@ -4,8 +4,8 @@ package ostracon.consensus; option go_package = "github.com/line/ostracon/proto/ostracon/consensus"; import "gogoproto/gogo.proto"; -import "ostracon/types/types.proto"; import "tendermint/libs/bits/types.proto"; +import "tendermint/types/types.proto"; // NewRoundStep is sent for every step taken in the ConsensusState. // For every height/round/step transition @@ -23,14 +23,14 @@ message NewRoundStep { message NewValidBlock { int64 height = 1; int32 round = 2; - ostracon.types.PartSetHeader block_part_set_header = 3 [(gogoproto.nullable) = false]; + tendermint.types.PartSetHeader block_part_set_header = 3 [(gogoproto.nullable) = false]; tendermint.libs.bits.BitArray block_parts = 4; bool is_commit = 5; } // Proposal is sent when a new block is proposed. message Proposal { - ostracon.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; + tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; } // ProposalPOL is sent when a previous proposal is re-proposed. @@ -44,19 +44,19 @@ message ProposalPOL { message BlockPart { int64 height = 1; int32 round = 2; - ostracon.types.Part part = 3 [(gogoproto.nullable) = false]; + tendermint.types.Part part = 3 [(gogoproto.nullable) = false]; } // Vote is sent when voting for a proposal (or lack thereof). message Vote { - ostracon.types.Vote vote = 1; + tendermint.types.Vote vote = 1; } // HasVote is sent to indicate that a particular vote has been received. message HasVote { int64 height = 1; int32 round = 2; - ostracon.types.SignedMsgType type = 3; + tendermint.types.SignedMsgType type = 3; int32 index = 4; } @@ -64,16 +64,16 @@ message HasVote { message VoteSetMaj23 { int64 height = 1; int32 round = 2; - ostracon.types.SignedMsgType type = 3; - ostracon.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + tendermint.types.SignedMsgType type = 3; + tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; } // VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID. message VoteSetBits { int64 height = 1; int32 round = 2; - ostracon.types.SignedMsgType type = 3; - ostracon.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + tendermint.types.SignedMsgType type = 3; + tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; tendermint.libs.bits.BitArray votes = 5 [(gogoproto.nullable) = false]; } diff --git a/proto/ostracon/consensus/wal.pb.go b/proto/ostracon/consensus/wal.pb.go index c6a2b2ead..ba82b701e 100644 --- a/proto/ostracon/consensus/wal.pb.go +++ b/proto/ostracon/consensus/wal.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/golang/protobuf/ptypes/duration" - types "github.com/line/ostracon/proto/ostracon/types" + types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" math "math" math_bits "math/bits" @@ -372,41 +372,42 @@ func init() { func init() { proto.RegisterFile("ostracon/consensus/wal.proto", fileDescriptor_4c737e612f9cf5e0) } var fileDescriptor_4c737e612f9cf5e0 = []byte{ - // 537 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x8e, 0xd3, 0x30, - 0x10, 0x8e, 0xb7, 0xff, 0x53, 0x10, 0x92, 0x59, 0xad, 0x4a, 0x17, 0xd2, 0xaa, 0xbd, 0xf4, 0x94, - 0x00, 0x7b, 0xd9, 0x13, 0x88, 0xaa, 0x2b, 0xb5, 0x82, 0x95, 0x90, 0x59, 0x09, 0x69, 0x2f, 0x51, - 0xda, 0xb8, 0x69, 0xa4, 0xc6, 0xae, 0x62, 0x07, 0xc4, 0x81, 0x77, 0xe8, 0x91, 0xb7, 0xe0, 0x35, - 0xf6, 0xb8, 0x47, 0x4e, 0x0b, 0x6a, 0x5f, 0x04, 0xc5, 0x76, 0xd2, 0x8a, 0x96, 0x9b, 0xc7, 0xdf, - 0xcc, 0x7c, 0x33, 0xdf, 0x67, 0xc3, 0x73, 0x2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, 0x81, 0xd1, 0x37, 0xf9, 0x8b, 0xd4, 0x4e, 0xaf, 0x33, 0xa7, 0x55, 0x05, 0x7e, - 0xa9, 0x1f, 0xa4, 0x96, 0xc3, 0x3e, 0x36, 0xcc, 0x8e, 0x46, 0xbd, 0xc6, 0xe1, 0xfb, 0xbb, 0x8d, - 0x8d, 0xee, 0x37, 0x36, 0xfa, 0xb3, 0xb1, 0xd1, 0x7a, 0x6b, 0x5b, 0xf7, 0x5b, 0xdb, 0xfa, 0xb5, - 0xb5, 0xad, 0xdb, 0x57, 0x61, 0x24, 0x17, 0xe9, 0xd4, 0x99, 0xf1, 0xd8, 0x5d, 0x46, 0x8c, 0xba, - 0xc5, 0xaf, 0xd2, 0x1f, 0xf2, 0xf0, 0x13, 0x4e, 0xab, 0x0a, 0xb9, 0xf8, 0x1b, 0x00, 0x00, 0xff, - 0xff, 0x7a, 0x8c, 0x2a, 0x13, 0xe9, 0x03, 0x00, 0x00, + // 548 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcf, 0x8a, 0x13, 0x4f, + 0x10, 0x9e, 0xde, 0x64, 0xf3, 0xa7, 0xf2, 0xfb, 0x21, 0xb4, 0xcb, 0x12, 0xa3, 0x3b, 0x09, 0x59, + 0x84, 0x9c, 0x66, 0xd4, 0xbd, 0xec, 0x49, 0x31, 0x64, 0x21, 0x41, 0x17, 0xa4, 0x5d, 0x10, 0x44, + 0x18, 0x26, 0x99, 0xca, 0x64, 0x20, 0xd3, 0x1d, 0xa6, 0x7b, 0x14, 0x0f, 0xbe, 0x43, 0x8e, 0xbe, + 0x86, 0x6f, 0xb1, 0xc7, 0x3d, 0x7a, 0x5a, 0x25, 0x79, 0x11, 0x99, 0xee, 0x99, 0x24, 0x98, 0x78, + 0xeb, 0xea, 0xaf, 0xaa, 0xbe, 0xaa, 0xef, 0xeb, 0x86, 0x27, 0x42, 0xaa, 0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 0x67, 0x44, 0xb9, 0x4a, 0xad, 0x3d, 0xab, 0x6f, + 0x8a, 0x37, 0x69, 0xbc, 0x5e, 0x66, 0x5e, 0xeb, 0x0a, 0xfa, 0xcc, 0x3c, 0x49, 0x23, 0x87, 0x7d, + 0x68, 0x98, 0x2d, 0x8d, 0x7e, 0x8f, 0xfd, 0x37, 0xb7, 0x2b, 0x9b, 0xdc, 0xad, 0x6c, 0xf2, 0x7b, + 0x65, 0x93, 0xe5, 0xda, 0xb6, 0xee, 0xd6, 0xb6, 0xf5, 0x73, 0x6d, 0x5b, 0x1f, 0x9f, 0x87, 0x91, + 0x9a, 0xa5, 0x63, 0x67, 0x22, 0x62, 0x77, 0x1e, 0x71, 0x74, 0x37, 0x3f, 0xcf, 0x7c, 0xca, 0xfd, + 0x8f, 0x38, 0xae, 0x68, 0xe4, 0xe2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x85, 0x7e, 0x3b, 0xd4, + 0xed, 0x03, 0x00, 0x00, } func (m *MsgInfo) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/consensus/wal.proto b/proto/ostracon/consensus/wal.proto index 36c91a2ae..e915658ce 100644 --- a/proto/ostracon/consensus/wal.proto +++ b/proto/ostracon/consensus/wal.proto @@ -5,7 +5,7 @@ option go_package = "github.com/line/ostracon/proto/ostracon/consensus"; import "gogoproto/gogo.proto"; import "ostracon/consensus/types.proto"; -import "ostracon/types/events.proto"; +import "tendermint/types/events.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; @@ -32,7 +32,7 @@ message EndHeight { message WALMessage { oneof sum { - ostracon.types.EventDataRoundState event_data_round_state = 1; + tendermint.types.EventDataRoundState event_data_round_state = 1; MsgInfo msg_info = 2; TimeoutInfo timeout_info = 3; EndHeight end_height = 4; diff --git a/proto/ostracon/privval/types.pb.go b/proto/ostracon/privval/types.pb.go index 39e23ce31..ca3038c70 100644 --- a/proto/ostracon/privval/types.pb.go +++ b/proto/ostracon/privval/types.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" crypto "github.com/line/ostracon/proto/ostracon/crypto" - types "github.com/line/ostracon/proto/ostracon/types" + types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" math "math" math_bits "math/bits" @@ -804,60 +804,60 @@ func init() { func init() { proto.RegisterFile("ostracon/privval/types.proto", fileDescriptor_abbbbe5131a55005) } var fileDescriptor_abbbbe5131a55005 = []byte{ - // 834 bytes of a gzipped FileDescriptorProto + // 845 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcb, 0x6e, 0xdb, 0x46, - 0x14, 0x86, 0x49, 0x5b, 0x17, 0xe7, 0xc8, 0x17, 0x79, 0xac, 0xa6, 0x8a, 0xd0, 0x28, 0xae, 0xda, - 0x02, 0x46, 0x0a, 0x50, 0x40, 0xda, 0x4d, 0xba, 0xab, 0x1d, 0x16, 0x12, 0xdc, 0x90, 0xc4, 0x48, - 0x71, 0x82, 0x76, 0x41, 0x48, 0xd4, 0x98, 0x21, 0x62, 0x73, 0xa6, 0x1c, 0x4a, 0x80, 0x56, 0xdd, - 0x75, 0xdb, 0x3e, 0x46, 0x1f, 0x25, 0xdd, 0x65, 0xd9, 0x55, 0x51, 0xd8, 0x9b, 0xf6, 0x2d, 0x0a, - 0xce, 0x0c, 0x2f, 0xa2, 0xe5, 0x34, 0x80, 0x77, 0x9c, 0x73, 0x8e, 0xbe, 0xf3, 0xff, 0x24, 0x7f, - 0x88, 0xf0, 0x09, 0xe5, 0x71, 0x34, 0xf1, 0x68, 0xd8, 0x67, 0x51, 0xb0, 0x58, 0x4c, 0x2e, 0xfa, - 0xf1, 0x92, 0x11, 0x6e, 0xb0, 0x88, 0xc6, 0x14, 0x35, 0xd3, 0xae, 0xa1, 0xba, 0x9d, 0x4e, 0x36, - 0xef, 0x45, 0x4b, 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0xf3, 0xdb, 0xe7, 0xd9, + 0x46, 0x61, 0x86, 0xf8, 0x1a, 0x77, 0x7a, 0x66, 0xb6, 0x53, 0x3c, 0xeb, 0xbc, 0xbd, 0x6d, 0xe8, + 0xef, 0x6e, 0x1b, 0xfa, 0xdf, 0xb7, 0x0d, 0xfd, 0xd7, 0xbb, 0x86, 0xf6, 0xee, 0xae, 0xa1, 0xfd, + 0x79, 0xd7, 0xd0, 0x7e, 0x68, 0xf9, 0x41, 0x7c, 0x3d, 0x1e, 0x18, 0x1e, 0x1d, 0xb5, 0x6e, 0x82, + 0x90, 0xb4, 0x66, 0xbe, 0x16, 0x92, 0xbf, 0xf9, 0xc5, 0x8f, 0x87, 0x41, 0x49, 0xd4, 0xbf, 0xfa, + 0x2f, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x37, 0x44, 0x89, 0x57, 0x08, 0x00, 0x00, } func (m *RemoteSignerError) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/privval/types.proto b/proto/ostracon/privval/types.proto index 1fbe380f0..b24434d37 100644 --- a/proto/ostracon/privval/types.proto +++ b/proto/ostracon/privval/types.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package ostracon.privval; import "ostracon/crypto/keys.proto"; -import "ostracon/types/types.proto"; import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; option go_package = "github.com/line/ostracon/proto/ostracon/privval"; @@ -34,25 +34,25 @@ message PubKeyResponse { // SignVoteRequest is a request to sign a vote message SignVoteRequest { - ostracon.types.Vote vote = 1; + tendermint.types.Vote vote = 1; string chain_id = 2; } // SignedVoteResponse is a response containing a signed vote or an error message SignedVoteResponse { - ostracon.types.Vote vote = 1 [(gogoproto.nullable) = false]; + tendermint.types.Vote vote = 1 [(gogoproto.nullable) = false]; RemoteSignerError error = 2; } // SignProposalRequest is a request to sign a proposal message SignProposalRequest { - ostracon.types.Proposal proposal = 1; + tendermint.types.Proposal proposal = 1; string chain_id = 2; } // SignedProposalResponse is response containing a signed proposal or an error message SignedProposalResponse { - ostracon.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; + tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; RemoteSignerError error = 2; } diff --git a/proto/ostracon/state/types.pb.go b/proto/ostracon/state/types.pb.go index f5b262366..160d3cc65 100644 --- a/proto/ostracon/state/types.pb.go +++ b/proto/ostracon/state/types.pb.go @@ -11,6 +11,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/line/ostracon/abci/types" types1 "github.com/line/ostracon/proto/ostracon/types" + types2 "github.com/tendermint/tendermint/proto/tendermint/types" version "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" @@ -148,7 +149,7 @@ func (m *ValidatorsInfo) GetLastHeightChanged() int64 { // ConsensusParamsInfo represents the latest consensus params, or the last height it changed type ConsensusParamsInfo struct { - ConsensusParams types1.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` + ConsensusParams types2.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"` } @@ -185,11 +186,11 @@ func (m *ConsensusParamsInfo) XXX_DiscardUnknown() { var xxx_messageInfo_ConsensusParamsInfo proto.InternalMessageInfo -func (m *ConsensusParamsInfo) GetConsensusParams() types1.ConsensusParams { +func (m *ConsensusParamsInfo) GetConsensusParams() types2.ConsensusParams { if m != nil { return m.ConsensusParams } - return types1.ConsensusParams{} + return types2.ConsensusParams{} } func (m *ConsensusParamsInfo) GetLastHeightChanged() int64 { @@ -258,7 +259,7 @@ type State struct { InitialHeight int64 `protobuf:"varint,14,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockID types1.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` + LastBlockID types2.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` // LastValidators is used to validate block.LastCommit. // Validators are persisted to the database separately every time they change, @@ -272,7 +273,7 @@ type State struct { LastHeightValidatorsChanged int64 `protobuf:"varint,9,opt,name=last_height_validators_changed,json=lastHeightValidatorsChanged,proto3" json:"last_height_validators_changed,omitempty"` // Consensus parameters used for validating blocks. // Changes returned by EndBlock and updated after Commit. - ConsensusParams types1.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` + ConsensusParams types2.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` LastHeightConsensusParamsChanged int64 `protobuf:"varint,11,opt,name=last_height_consensus_params_changed,json=lastHeightConsensusParamsChanged,proto3" json:"last_height_consensus_params_changed,omitempty"` // Merkle root of the results from executing prev block LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` @@ -343,11 +344,11 @@ func (m *State) GetLastBlockHeight() int64 { return 0 } -func (m *State) GetLastBlockID() types1.BlockID { +func (m *State) GetLastBlockID() types2.BlockID { if m != nil { return m.LastBlockID } - return types1.BlockID{} + return types2.BlockID{} } func (m *State) GetLastBlockTime() time.Time { @@ -385,11 +386,11 @@ func (m *State) GetLastHeightValidatorsChanged() int64 { return 0 } -func (m *State) GetConsensusParams() types1.ConsensusParams { +func (m *State) GetConsensusParams() types2.ConsensusParams { if m != nil { return m.ConsensusParams } - return types1.ConsensusParams{} + return types2.ConsensusParams{} } func (m *State) GetLastHeightConsensusParamsChanged() int64 { @@ -431,57 +432,57 @@ func init() { func init() { proto.RegisterFile("ostracon/state/types.proto", fileDescriptor_898987a4421067cd) } var fileDescriptor_898987a4421067cd = []byte{ - // 791 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x8e, 0xe3, 0x44, - 0x14, 0x8d, 0xc9, 0x4c, 0x27, 0x29, 0x77, 0x12, 0xa8, 0x46, 0xc2, 0x93, 0x01, 0x27, 0x44, 0x3c, - 0x5a, 0x48, 0xd8, 0xd2, 0xb0, 0x60, 0x33, 0x9b, 0x38, 0x19, 0x31, 0x91, 0x46, 0x28, 0xf2, 0x8c, - 0x66, 0xc1, 0xc6, 0xaa, 0xd8, 0x15, 0xbb, 0x84, 0xe3, 0xb2, 0x5c, 0x95, 0xd0, 0xac, 0xf9, 0x81, - 0xd9, 0xf1, 0x4b, 0xbd, 0xec, 0x05, 0x0b, 0x56, 0x0d, 0x4a, 0x6f, 0xf8, 0x0a, 0x84, 0xea, 0xe1, - 0x47, 0x22, 0x5a, 0x6a, 0xc4, 0xce, 0xbe, 0xe7, 0xdc, 0xe3, 0x53, 0xb7, 0xce, 0x95, 0xc1, 0x88, - 0x32, 0x5e, 0xa0, 0x90, 0x66, 0x2e, 0xe3, 0x88, 0x63, 0x97, 0xff, 0x9c, 0x63, 0xe6, 0xe4, 0x05, - 0xe5, 0x14, 0x0e, 0x4a, 0xcc, 0x91, 0xd8, 0xe8, 0xc3, 0x98, 0xc6, 0x54, 0x42, 0xae, 0x78, 0x52, - 0xac, 0xd1, 0x93, 0x4a, 0x01, 0xad, 0x43, 0xd2, 0x14, 0x18, 0xd5, 0xe2, 0xb2, 0x7a, 0x84, 0xd9, - 0x27, 0xd8, 0x1e, 0xa5, 0x24, 0x42, 0x9c, 0x16, 0x1a, 0x7f, 0x7a, 0x82, 0xe7, 0xa8, 0x40, 0xdb, - 0xaa, 0x99, 0xe3, 0x2c, 0xc2, 0xc5, 0x96, 0x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xf4, 0xbc, 0xa0, 0x74, 0xa3, 0x18, 0x7f, 0x75, 0x24, - 0x45, 0x46, 0x64, 0x25, 0xca, 0x82, 0xe8, 0x7d, 0x77, 0x7d, 0xb0, 0x8d, 0x9b, 0x83, 0x6d, 0xfc, - 0x79, 0xb0, 0x8d, 0x77, 0x77, 0x76, 0xeb, 0xe6, 0xce, 0x6e, 0xfd, 0x7e, 0x67, 0xb7, 0x7e, 0xf8, - 0x3a, 0x26, 0x3c, 0xd9, 0xad, 0x9d, 0x90, 0x6e, 0xdd, 0x94, 0x64, 0xd8, 0xad, 0xfe, 0x34, 0xea, - 0xdf, 0x76, 0xfc, 0x47, 0x5c, 0x9f, 0xc9, 0xea, 0x37, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x38, - 0xf8, 0xf4, 0x33, 0x2a, 0x07, 0x00, 0x00, + // 800 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x6e, 0xe3, 0x36, + 0x14, 0xb5, 0xea, 0x99, 0x91, 0x4d, 0xc5, 0x76, 0xcb, 0x14, 0xa8, 0xe2, 0xce, 0xc8, 0x1e, 0xa3, + 0x8f, 0xa0, 0x40, 0x65, 0x60, 0xba, 0xe8, 0x66, 0x36, 0x96, 0x3d, 0xe8, 0x18, 0x18, 0x14, 0x03, + 0xcd, 0x20, 0x8b, 0x6e, 0x04, 0x5a, 0xa2, 0x25, 0xa2, 0xb2, 0x28, 0x88, 0xb4, 0x9b, 0x6e, 0xdb, + 0x1f, 0xc8, 0xb6, 0x7f, 0x94, 0x65, 0x16, 0x5d, 0x74, 0x95, 0x16, 0xce, 0xa6, 0x9f, 0x51, 0xf0, + 0xa1, 0x87, 0x93, 0x06, 0x48, 0xd1, 0x1d, 0x79, 0xcf, 0xb9, 0x87, 0x87, 0x97, 0xf7, 0x82, 0x60, + 0x48, 0x19, 0x2f, 0x50, 0x48, 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0x1b, 0xba, 0xce, 0xd6, 0xad, 0xfd, 0xaf, + 0xe3, 0x05, 0xfe, 0xe7, 0x78, 0x7d, 0x0f, 0x3e, 0x3b, 0x18, 0xaf, 0x5b, 0xfa, 0x95, 0x3d, 0x4b, + 0xda, 0x1b, 0x37, 0xe6, 0xed, 0x50, 0xa8, 0xf4, 0x58, 0xb6, 0x60, 0x81, 0xd9, 0x36, 0xe5, 0x2c, + 0x48, 0x10, 0x4b, 0xec, 0xa3, 0xb1, 0x71, 0x7a, 0xa4, 0x5a, 0xd0, 0x57, 0xf1, 0xd7, 0x88, 0x25, + 0xf0, 0x04, 0x74, 0x50, 0x9e, 0x2b, 0x4a, 0x4f, 0x52, 0x4c, 0x94, 0xe7, 0x12, 0xfa, 0x52, 0x97, + 0x3d, 0x2f, 0x28, 0x5d, 0x2b, 0xc6, 0xdf, 0xa6, 0xa4, 0xc8, 0x26, 0x79, 0x2b, 0xc2, 0x82, 0xe8, + 0x7d, 0x77, 0xb9, 0x77, 0x8c, 0xab, 0xbd, 0x63, 0xfc, 0xb5, 0x77, 0x8c, 0x8b, 0x1b, 0xa7, 0x75, + 0x75, 0xe3, 0xb4, 0xfe, 0xb8, 0x71, 0x5a, 0x3f, 0x7c, 0x1d, 0x13, 0x9e, 0x6c, 0x57, 0x6e, 0x48, + 0x37, 0xd3, 0x94, 0x64, 0x78, 0x5a, 0xfd, 0x57, 0xea, 0x07, 0x3c, 0xfc, 0x37, 0x57, 0x4f, 0x64, + 0xf4, 0x9b, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x45, 0x74, 0xf7, 0xf8, 0x50, 0x07, 0x00, 0x00, } func (m *ABCIResponses) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index 70137238b..e4b9bbfb5 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -7,7 +7,8 @@ import "gogoproto/gogo.proto"; import "ostracon/abci/types.proto"; import "ostracon/types/types.proto"; import "ostracon/types/validator.proto"; -import "ostracon/types/params.proto"; +import "tendermint/types/params.proto"; +import "tendermint/types/types.proto"; import "tendermint/version/types.proto"; import "google/protobuf/timestamp.proto"; @@ -28,7 +29,7 @@ message ValidatorsInfo { // ConsensusParamsInfo represents the latest consensus params, or the last height it changed message ConsensusParamsInfo { - ostracon.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false]; + tendermint.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false]; int64 last_height_changed = 2; } @@ -46,7 +47,7 @@ message State { // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) int64 last_block_height = 3; - ostracon.types.BlockID last_block_id = 4 + tendermint.types.BlockID last_block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"]; google.protobuf.Timestamp last_block_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; @@ -64,7 +65,7 @@ message State { // Consensus parameters used for validating blocks. // Changes returned by EndBlock and updated after Commit. - ostracon.types.ConsensusParams consensus_params = 10 [(gogoproto.nullable) = false]; + tendermint.types.ConsensusParams consensus_params = 10 [(gogoproto.nullable) = false]; int64 last_height_consensus_params_changed = 11; // Merkle root of the results from executing prev block diff --git a/proto/ostracon/types/block.pb.go b/proto/ostracon/types/block.pb.go index be452de43..83a7ee556 100644 --- a/proto/ostracon/types/block.pb.go +++ b/proto/ostracon/types/block.pb.go @@ -7,6 +7,7 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" math "math" math_bits "math/bits" @@ -25,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Block struct { Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` - Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` + Data types.Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` Evidence EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` LastCommit *Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` } @@ -70,11 +71,11 @@ func (m *Block) GetHeader() Header { return Header{} } -func (m *Block) GetData() Data { +func (m *Block) GetData() types.Data { if m != nil { return m.Data } - return Data{} + return types.Data{} } func (m *Block) GetEvidence() EvidenceList { @@ -98,24 +99,25 @@ func init() { func init() { proto.RegisterFile("ostracon/types/block.proto", fileDescriptor_69510200dee501a6) } var fileDescriptor_69510200dee501a6 = []byte{ - // 267 bytes of a gzipped FileDescriptorProto + // 281 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x2f, 0x2e, 0x29, 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xc9, 0xe9, 0x81, 0xe5, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x14, 0xba, 0x09, 0x60, 0x12, 0x2a, - 0x27, 0x8b, 0x26, 0x97, 0x5a, 0x96, 0x99, 0x92, 0x9a, 0x97, 0x9c, 0x0a, 0x91, 0x56, 0x7a, 0xc6, - 0xc8, 0xc5, 0xea, 0x04, 0xb2, 0x50, 0xc8, 0x84, 0x8b, 0x2d, 0x23, 0x35, 0x31, 0x25, 0xb5, 0x48, - 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4c, 0x0f, 0xd5, 0x6e, 0x3d, 0x0f, 0xb0, 0xac, 0x13, - 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0xb5, 0x42, 0x7a, 0x5c, 0x2c, 0x29, 0x89, 0x25, 0x89, - 0x12, 0x4c, 0x60, 0x3d, 0x22, 0xe8, 0x7a, 0x5c, 0x12, 0x4b, 0x12, 0xa1, 0x3a, 0xc0, 0xea, 0x84, - 0xec, 0xb8, 0x38, 0x60, 0x2e, 0x90, 0x60, 0x06, 0xeb, 0x91, 0x41, 0xd7, 0xe3, 0x0a, 0x95, 0xf7, - 0xc9, 0x2c, 0x2e, 0x81, 0xea, 0x85, 0xeb, 0x11, 0x32, 0xe7, 0xe2, 0xce, 0x49, 0x2c, 0x2e, 0x89, - 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0x2c, 0x91, 0x60, 0xc1, 0xee, 0x54, 0x67, 0xb0, 0x6c, 0x10, 0x17, - 0x48, 0x29, 0x84, 0xed, 0xe4, 0x7e, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, - 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, - 0xba, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x39, 0x99, 0x79, 0xa9, - 0xfa, 0xf0, 0x10, 0x83, 0x04, 0x34, 0x6a, 0x00, 0x26, 0xb1, 0x81, 0x45, 0x8d, 0x01, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x42, 0x79, 0x19, 0x39, 0xb7, 0x01, 0x00, 0x00, + 0x27, 0x8b, 0x26, 0x97, 0x5a, 0x96, 0x99, 0x92, 0x9a, 0x97, 0x9c, 0x0a, 0x95, 0x96, 0x29, 0x49, + 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xc1, 0xd4, 0xac, 0xf4, 0x82, 0x91, 0x8b, 0xd5, + 0x09, 0xe4, 0x1c, 0x21, 0x13, 0x2e, 0xb6, 0x8c, 0xd4, 0xc4, 0x94, 0xd4, 0x22, 0x09, 0x46, 0x05, + 0x46, 0x0d, 0x6e, 0x23, 0x31, 0x3d, 0x54, 0x97, 0xe9, 0x79, 0x80, 0x65, 0x9d, 0x58, 0x4e, 0xdc, + 0x93, 0x67, 0x08, 0x82, 0xaa, 0x15, 0x32, 0xe0, 0x62, 0x49, 0x49, 0x2c, 0x49, 0x94, 0x60, 0x82, + 0xea, 0x41, 0x58, 0x06, 0xd5, 0xe5, 0x92, 0x58, 0x92, 0x08, 0xd5, 0x03, 0x56, 0x29, 0x64, 0xc7, + 0xc5, 0x01, 0x73, 0xa1, 0x04, 0x33, 0x58, 0x97, 0x0c, 0xba, 0x4d, 0xae, 0x50, 0x79, 0x9f, 0xcc, + 0xe2, 0x12, 0xa8, 0x5e, 0xb8, 0x1e, 0x21, 0x73, 0x2e, 0xee, 0x9c, 0xc4, 0xe2, 0x92, 0xf8, 0xe4, + 0xfc, 0xdc, 0xdc, 0xcc, 0x12, 0x09, 0x16, 0xec, 0x8e, 0x75, 0x06, 0xcb, 0x06, 0x71, 0x81, 0x94, + 0x42, 0xd8, 0x4e, 0xee, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, + 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9b, + 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x93, 0x99, 0x97, 0xaa, 0x0f, + 0x0f, 0x51, 0x48, 0x44, 0xa0, 0x06, 0x70, 0x12, 0x1b, 0x58, 0xd4, 0x18, 0x10, 0x00, 0x00, 0xff, + 0xff, 0x37, 0xee, 0xad, 0xe0, 0xd7, 0x01, 0x00, 0x00, } func (m *Block) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/types/block.proto b/proto/ostracon/types/block.proto index 96c19fd8b..107c3213c 100644 --- a/proto/ostracon/types/block.proto +++ b/proto/ostracon/types/block.proto @@ -6,10 +6,11 @@ option go_package = "github.com/line/ostracon/proto/ostracon/types"; import "gogoproto/gogo.proto"; import "ostracon/types/types.proto"; import "ostracon/types/evidence.proto"; +import "tendermint/types/types.proto"; message Block { Header header = 1 [(gogoproto.nullable) = false]; - Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.Data data = 2 [(gogoproto.nullable) = false]; ostracon.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; Commit last_commit = 4; } diff --git a/proto/ostracon/types/canonical.pb.go b/proto/ostracon/types/canonical.pb.go deleted file mode 100644 index 6f68c9c7a..000000000 --- a/proto/ostracon/types/canonical.pb.go +++ /dev/null @@ -1,1378 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/types/canonical.proto - -package types - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type CanonicalBlockID struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - PartSetHeader CanonicalPartSetHeader `protobuf:"bytes,2,opt,name=part_set_header,json=partSetHeader,proto3" json:"part_set_header"` -} - -func (m *CanonicalBlockID) Reset() { *m = CanonicalBlockID{} } -func (m *CanonicalBlockID) String() string { return proto.CompactTextString(m) } -func (*CanonicalBlockID) ProtoMessage() {} -func (*CanonicalBlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_ca4a1fbbc6b35f34, []int{0} -} -func (m *CanonicalBlockID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CanonicalBlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalBlockID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CanonicalBlockID) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalBlockID.Merge(m, src) -} -func (m *CanonicalBlockID) XXX_Size() int { - return m.Size() -} -func (m *CanonicalBlockID) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalBlockID.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalBlockID proto.InternalMessageInfo - -func (m *CanonicalBlockID) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *CanonicalBlockID) GetPartSetHeader() CanonicalPartSetHeader { - if m != nil { - return m.PartSetHeader - } - return CanonicalPartSetHeader{} -} - -type CanonicalPartSetHeader struct { - Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *CanonicalPartSetHeader) Reset() { *m = CanonicalPartSetHeader{} } -func (m *CanonicalPartSetHeader) String() string { return proto.CompactTextString(m) } -func (*CanonicalPartSetHeader) ProtoMessage() {} -func (*CanonicalPartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_ca4a1fbbc6b35f34, []int{1} -} -func (m *CanonicalPartSetHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CanonicalPartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalPartSetHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CanonicalPartSetHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalPartSetHeader.Merge(m, src) -} -func (m *CanonicalPartSetHeader) XXX_Size() int { - return m.Size() -} -func (m *CanonicalPartSetHeader) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalPartSetHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalPartSetHeader proto.InternalMessageInfo - -func (m *CanonicalPartSetHeader) GetTotal() uint32 { - if m != nil { - return m.Total - } - return 0 -} - -func (m *CanonicalPartSetHeader) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -type CanonicalProposal struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=ostracon.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"fixed64,2,opt,name=height,proto3" json:"height,omitempty"` - Round int64 `protobuf:"fixed64,3,opt,name=round,proto3" json:"round,omitempty"` - POLRound int64 `protobuf:"varint,4,opt,name=pol_round,json=polRound,proto3" json:"pol_round,omitempty"` - BlockID *CanonicalBlockID `protobuf:"bytes,5,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` - Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - ChainID string `protobuf:"bytes,7,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *CanonicalProposal) Reset() { *m = CanonicalProposal{} } -func (m *CanonicalProposal) String() string { return proto.CompactTextString(m) } -func (*CanonicalProposal) ProtoMessage() {} -func (*CanonicalProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_ca4a1fbbc6b35f34, []int{2} -} -func (m *CanonicalProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CanonicalProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CanonicalProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalProposal.Merge(m, src) -} -func (m *CanonicalProposal) XXX_Size() int { - return m.Size() -} -func (m *CanonicalProposal) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalProposal proto.InternalMessageInfo - -func (m *CanonicalProposal) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *CanonicalProposal) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *CanonicalProposal) GetRound() int64 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *CanonicalProposal) GetPOLRound() int64 { - if m != nil { - return m.POLRound - } - return 0 -} - -func (m *CanonicalProposal) GetBlockID() *CanonicalBlockID { - if m != nil { - return m.BlockID - } - return nil -} - -func (m *CanonicalProposal) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *CanonicalProposal) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -type CanonicalVote struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=ostracon.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"fixed64,2,opt,name=height,proto3" json:"height,omitempty"` - Round int64 `protobuf:"fixed64,3,opt,name=round,proto3" json:"round,omitempty"` - BlockID *CanonicalBlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - ChainID string `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *CanonicalVote) Reset() { *m = CanonicalVote{} } -func (m *CanonicalVote) String() string { return proto.CompactTextString(m) } -func (*CanonicalVote) ProtoMessage() {} -func (*CanonicalVote) Descriptor() ([]byte, []int) { - return fileDescriptor_ca4a1fbbc6b35f34, []int{3} -} -func (m *CanonicalVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CanonicalVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalVote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CanonicalVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalVote.Merge(m, src) -} -func (m *CanonicalVote) XXX_Size() int { - return m.Size() -} -func (m *CanonicalVote) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalVote.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalVote proto.InternalMessageInfo - -func (m *CanonicalVote) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *CanonicalVote) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *CanonicalVote) GetRound() int64 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *CanonicalVote) GetBlockID() *CanonicalBlockID { - if m != nil { - return m.BlockID - } - return nil -} - -func (m *CanonicalVote) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *CanonicalVote) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -func init() { - proto.RegisterType((*CanonicalBlockID)(nil), "ostracon.types.CanonicalBlockID") - proto.RegisterType((*CanonicalPartSetHeader)(nil), "ostracon.types.CanonicalPartSetHeader") - proto.RegisterType((*CanonicalProposal)(nil), "ostracon.types.CanonicalProposal") - proto.RegisterType((*CanonicalVote)(nil), "ostracon.types.CanonicalVote") -} - -func init() { proto.RegisterFile("ostracon/types/canonical.proto", fileDescriptor_ca4a1fbbc6b35f34) } - -var fileDescriptor_ca4a1fbbc6b35f34 = []byte{ - // 489 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00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, 0xf9, 0xcd, 0x0f, 0x07, 0xd1, 0x5d, 0x19, 0x39, 0xc5, 0x66, - 0x98, 0xb0, 0x34, 0x57, 0x6a, 0x7a, 0x2e, 0x1a, 0xf7, 0xeb, 0x59, 0xe7, 0x2a, 0xa7, 0x66, 0x69, - 0x70, 0x12, 0x8d, 0xbe, 0xb6, 0xf1, 0xa0, 0x91, 0xf5, 0x01, 0x24, 0xff, 0xf7, 0x9e, 0xde, 0x37, - 0xca, 0xf8, 0x7b, 0x46, 0x75, 0xfe, 0xdc, 0xa8, 0xee, 0xd3, 0x46, 0x05, 0x6f, 0x6e, 0x2b, 0x1b, - 0xdd, 0x55, 0x36, 0xfa, 0x59, 0xd9, 0xe8, 0x66, 0x6d, 0xb7, 0xee, 0xd6, 0x76, 0xeb, 0xfb, 0xda, - 0x6e, 0x7d, 0x7c, 0x11, 0xa7, 0x32, 0x59, 0xce, 0xbd, 0x10, 0x16, 0x7e, 0x96, 0xe6, 0xdc, 0x6f, - 0x2e, 0xb5, 0x3e, 0xe2, 0x87, 0x87, 0x3b, 0xef, 0xea, 0xec, 0xab, 0x5f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x83, 0x0f, 0xca, 0x3d, 0x17, 0x04, 0x00, 0x00, -} - -func (m *CanonicalBlockID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalBlockID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalBlockID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PartSetHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCanonical(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CanonicalPartSetHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalPartSetHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalPartSetHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if m.Total != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CanonicalProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x3a - } - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintCanonical(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x32 - if m.BlockID != nil { - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCanonical(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.POLRound != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.POLRound)) - i-- - dAtA[i] = 0x20 - } - if m.Round != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Round)) - i-- - dAtA[i] = 0x19 - } - if m.Height != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Height)) - i-- - dAtA[i] = 0x11 - } - if m.Type != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CanonicalVote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x32 - } - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintCanonical(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x2a - if m.BlockID != nil { - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCanonical(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Round != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Round)) - i-- - dAtA[i] = 0x19 - } - if m.Height != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Height)) - i-- - dAtA[i] = 0x11 - } - if m.Type != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintCanonical(dAtA []byte, offset int, v uint64) int { - offset -= sovCanonical(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CanonicalBlockID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - l = m.PartSetHeader.Size() - n += 1 + l + sovCanonical(uint64(l)) - return n -} - -func (m *CanonicalPartSetHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovCanonical(uint64(m.Total)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - return n -} - -func (m *CanonicalProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovCanonical(uint64(m.Type)) - } - if m.Height != 0 { - n += 9 - } - if m.Round != 0 { - n += 9 - } - if m.POLRound != 0 { - n += 1 + sovCanonical(uint64(m.POLRound)) - } - if m.BlockID != nil { - l = m.BlockID.Size() - n += 1 + l + sovCanonical(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovCanonical(uint64(l)) - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - return n -} - -func (m *CanonicalVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovCanonical(uint64(m.Type)) - } - if m.Height != 0 { - n += 9 - } - if m.Round != 0 { - n += 9 - } - if m.BlockID != nil { - l = m.BlockID.Size() - n += 1 + l + sovCanonical(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovCanonical(uint64(l)) - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - return n -} - -func sovCanonical(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCanonical(x uint64) (n int) { - return sovCanonical(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *CanonicalBlockID) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalBlockID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalBlockID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PartSetHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PartSetHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CanonicalPartSetHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalPartSetHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalPartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CanonicalProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Height = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Round = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field POLRound", wireType) - } - m.POLRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.POLRound |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockID == nil { - m.BlockID = &CanonicalBlockID{} - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CanonicalVote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Height = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Round = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockID == nil { - m.BlockID = &CanonicalBlockID{} - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCanonical(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCanonical - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCanonical - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCanonical - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCanonical - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCanonical - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCanonical - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCanonical = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCanonical = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCanonical = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/types/events.pb.go b/proto/ostracon/types/events.pb.go deleted file mode 100644 index 71274ff0b..000000000 --- a/proto/ostracon/types/events.pb.go +++ /dev/null @@ -1,386 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/types/events.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EventDataRoundState struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Step string `protobuf:"bytes,3,opt,name=step,proto3" json:"step,omitempty"` -} - -func (m *EventDataRoundState) Reset() { *m = EventDataRoundState{} } -func (m *EventDataRoundState) String() string { return proto.CompactTextString(m) } -func (*EventDataRoundState) ProtoMessage() {} -func (*EventDataRoundState) Descriptor() ([]byte, []int) { - return fileDescriptor_67f647461b1e70c9, []int{0} -} -func (m *EventDataRoundState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventDataRoundState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventDataRoundState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EventDataRoundState) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataRoundState.Merge(m, src) -} -func (m *EventDataRoundState) XXX_Size() int { - return m.Size() -} -func (m *EventDataRoundState) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataRoundState.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataRoundState proto.InternalMessageInfo - -func (m *EventDataRoundState) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *EventDataRoundState) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *EventDataRoundState) GetStep() string { - if m != nil { - return m.Step - } - return "" -} - -func init() { - proto.RegisterType((*EventDataRoundState)(nil), "ostracon.types.EventDataRoundState") -} - -func init() { proto.RegisterFile("ostracon/types/events.proto", fileDescriptor_67f647461b1e70c9) } - -var fileDescriptor_67f647461b1e70c9 = []byte{ - // 190 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xce, 0x2f, 0x2e, 0x29, - 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, - 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x49, 0xea, 0x81, 0x25, 0x95, 0xc2, - 0xb9, 0x84, 0x5d, 0x41, 0xf2, 0x2e, 0x89, 0x25, 0x89, 0x41, 0xf9, 0xa5, 0x79, 0x29, 0xc1, 0x25, - 0x89, 0x25, 0xa9, 0x42, 0x62, 0x5c, 0x6c, 0x19, 0xa9, 0x99, 0xe9, 0x19, 0x25, 0x12, 0x8c, 0x0a, - 0x8c, 0x1a, 0xcc, 0x41, 0x50, 0x9e, 0x90, 0x08, 0x17, 0x6b, 0x11, 0x48, 0x95, 0x04, 0x93, 0x02, - 0xa3, 0x06, 0x6b, 0x10, 0x84, 0x23, 0x24, 0xc4, 0xc5, 0x52, 0x5c, 0x92, 0x5a, 0x20, 0xc1, 0xac, - 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0x66, 0x3b, 0xb9, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, - 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, - 0x1c, 0x43, 0x94, 0x6e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x4e, - 0x66, 0x5e, 0xaa, 0x3e, 0xdc, 0xbd, 0x60, 0x27, 0xea, 0xa3, 0x3a, 0x3f, 0x89, 0x0d, 0x2c, 0x6a, - 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xda, 0xaa, 0x5c, 0xd7, 0x00, 0x00, 0x00, -} - -func (m *EventDataRoundState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventDataRoundState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventDataRoundState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Step) > 0 { - i -= len(m.Step) - copy(dAtA[i:], m.Step) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Step))) - i-- - dAtA[i] = 0x1a - } - if m.Round != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventDataRoundState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovEvents(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovEvents(uint64(m.Round)) - } - l = len(m.Step) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventDataRoundState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventDataRoundState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventDataRoundState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Step = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/types/evidence.pb.go b/proto/ostracon/types/evidence.pb.go index 57231f9e0..09812a3b7 100644 --- a/proto/ostracon/types/evidence.pb.go +++ b/proto/ostracon/types/evidence.pb.go @@ -9,6 +9,7 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" math "math" math_bits "math/bits" @@ -114,11 +115,11 @@ func (*Evidence) XXX_OneofWrappers() []interface{} { // DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. type DuplicateVoteEvidence struct { - VoteA *Vote `protobuf:"bytes,1,opt,name=vote_a,json=voteA,proto3" json:"vote_a,omitempty"` - VoteB *Vote `protobuf:"bytes,2,opt,name=vote_b,json=voteB,proto3" json:"vote_b,omitempty"` - TotalVotingPower int64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` - ValidatorPower int64 `protobuf:"varint,4,opt,name=validator_power,json=validatorPower,proto3" json:"validator_power,omitempty"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` + VoteA *types.Vote `protobuf:"bytes,1,opt,name=vote_a,json=voteA,proto3" json:"vote_a,omitempty"` + VoteB *types.Vote `protobuf:"bytes,2,opt,name=vote_b,json=voteB,proto3" json:"vote_b,omitempty"` + TotalVotingPower int64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` + ValidatorPower int64 `protobuf:"varint,4,opt,name=validator_power,json=validatorPower,proto3" json:"validator_power,omitempty"` + Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` } func (m *DuplicateVoteEvidence) Reset() { *m = DuplicateVoteEvidence{} } @@ -154,14 +155,14 @@ func (m *DuplicateVoteEvidence) XXX_DiscardUnknown() { var xxx_messageInfo_DuplicateVoteEvidence proto.InternalMessageInfo -func (m *DuplicateVoteEvidence) GetVoteA() *Vote { +func (m *DuplicateVoteEvidence) GetVoteA() *types.Vote { if m != nil { return m.VoteA } return nil } -func (m *DuplicateVoteEvidence) GetVoteB() *Vote { +func (m *DuplicateVoteEvidence) GetVoteB() *types.Vote { if m != nil { return m.VoteB } @@ -320,41 +321,41 @@ func init() { func init() { proto.RegisterFile("ostracon/types/evidence.proto", fileDescriptor_97062afbc223b6b9) } var fileDescriptor_97062afbc223b6b9 = []byte{ - // 530 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0x9b, 0xa6, 0x9d, 0x8a, 0x37, 0xc6, 0x30, 0x9d, 0x68, 0x23, 0x48, 0xab, 0x22, 0x44, - 0x11, 0x90, 0x48, 0xe3, 0xc6, 0x6d, 0x01, 0xb4, 0x09, 0xf5, 0x80, 0x22, 0xb4, 0x03, 0x97, 0xc8, - 0x71, 0xbd, 0xd4, 0x9a, 0x13, 0x47, 0x8d, 0x5b, 0x34, 0x3e, 0x03, 0x87, 0x7d, 0xac, 0x71, 0xdb, - 0x91, 0x13, 0x4c, 0xed, 0x17, 0x41, 0x76, 0x12, 0xaf, 0x0b, 0x2d, 0xa7, 0x5d, 0xa2, 0xe4, 0xfd, - 0x7f, 0xcf, 0xef, 0xbd, 0xbf, 0xed, 0x80, 0xa7, 0x3c, 0x13, 0x53, 0x84, 0x79, 0xe2, 0x8a, 0xf3, - 0x94, 0x64, 0x2e, 0x99, 0xd3, 0x31, 0x49, 0x30, 0x71, 0xd2, 0x29, 0x17, 0x1c, 0xee, 0x96, 0xb2, - 0xa3, 0x64, 0xab, 0x1d, 0xf1, 0x88, 0x2b, 0xc9, 0x95, 0x6f, 0x39, 0x65, 0xf5, 0x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, 0x7d, 0x13, 0x51, 0x31, 0x99, - 0x85, 0x0e, 0xe6, 0xb1, 0xcb, 0x68, 0x42, 0x5c, 0x7d, 0xa7, 0xf3, 0x7f, 0xc5, 0xed, 0x2b, 0x1e, - 0x6e, 0xa9, 0xe8, 0xdb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98, 0xd4, 0x86, 0x84, 0x7d, 0x04, - 0x00, 0x00, + // 543 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xe3, 0x38, 0xa9, 0xc2, 0xb6, 0x94, 0xb2, 0xb4, 0x90, 0x44, 0xc5, 0x89, 0x82, 0x10, + 0x41, 0xa2, 0xb6, 0x54, 0x6e, 0xdc, 0x6a, 0x40, 0xad, 0x50, 0x0e, 0xc8, 0x42, 0x39, 0x70, 0xb1, + 0x6c, 0x67, 0xeb, 0xac, 0xba, 0xde, 0x8d, 0xe2, 0x49, 0x50, 0x79, 0x8a, 0x3c, 0x56, 0xb9, 0xf5, + 0xc8, 0x09, 0xaa, 0xe4, 0x45, 0xd0, 0x6e, 0xec, 0x4d, 0x6a, 0x12, 0x4e, 0x5c, 0xa2, 0x78, 0xfe, + 0x6f, 0x3c, 0x33, 0xbf, 0x67, 0x17, 0x3d, 0x17, 0x29, 0x8c, 0x83, 0x48, 0x70, 0x07, 0xae, 0x47, + 0x24, 0x75, 0xc8, 0x94, 0x0e, 0x08, 0x8f, 0x88, 0x3d, 0x1a, 0x0b, 0x10, 0x78, 0x3f, 0x97, 0x6d, + 0x25, 0x37, 0x0f, 0x63, 0x11, 0x0b, 0x25, 0x39, 0xf2, 0xdf, 0x92, 0x6a, 0xb6, 0x62, 0x21, 0x62, + 0x46, 0x1c, 0xf5, 0x14, 0x4e, 0x2e, 0x1d, 0xa0, 0x09, 0x49, 0x21, 0x48, 0x46, 0x19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 0x53, 0x18, 0x4e, 0x42, 0x3b, 0x12, + 0x89, 0xc3, 0x28, 0x27, 0x8e, 0x3e, 0xf5, 0xcb, 0xdb, 0xe4, 0xfe, 0x25, 0x10, 0xee, 0xa8, 0xe8, + 0xdb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x16, 0x5c, 0xa4, 0x67, 0x9f, 0x04, 0x00, 0x00, } func (m *Evidence) Marshal() (dAtA []byte, err error) { @@ -899,7 +900,7 @@ func (m *DuplicateVoteEvidence) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.VoteA == nil { - m.VoteA = &Vote{} + m.VoteA = &types.Vote{} } if err := m.VoteA.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -935,7 +936,7 @@ func (m *DuplicateVoteEvidence) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.VoteB == nil { - m.VoteB = &Vote{} + m.VoteB = &types.Vote{} } if err := m.VoteB.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/proto/ostracon/types/evidence.proto b/proto/ostracon/types/evidence.proto index 38506732a..be39092f3 100644 --- a/proto/ostracon/types/evidence.proto +++ b/proto/ostracon/types/evidence.proto @@ -7,6 +7,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "ostracon/types/types.proto"; import "ostracon/types/validator.proto"; +import "tendermint/types/types.proto"; message Evidence { oneof sum { @@ -17,8 +18,8 @@ message Evidence { // DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. message DuplicateVoteEvidence { - ostracon.types.Vote vote_a = 1; - ostracon.types.Vote vote_b = 2; + tendermint.types.Vote vote_a = 1; + tendermint.types.Vote vote_b = 2; int64 total_voting_power = 3; // total voting power int64 validator_power = 4; // voting power google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; diff --git a/proto/ostracon/types/params.pb.go b/proto/ostracon/types/params.pb.go deleted file mode 100644 index efe602ccb..000000000 --- a/proto/ostracon/types/params.pb.go +++ /dev/null @@ -1,1780 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/types/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// ConsensusParams contains consensus critical parameters that determine the -// validity of blocks. -type ConsensusParams struct { - Block BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block"` - Evidence EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence"` - Validator ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator"` - Version VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version"` -} - -func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } -func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } -func (*ConsensusParams) ProtoMessage() {} -func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_93f70d04c868d295, []int{0} -} -func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConsensusParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusParams.Merge(m, src) -} -func (m *ConsensusParams) XXX_Size() int { - return m.Size() -} -func (m *ConsensusParams) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo - -func (m *ConsensusParams) GetBlock() BlockParams { - if m != nil { - return m.Block - } - return BlockParams{} -} - -func (m *ConsensusParams) GetEvidence() EvidenceParams { - if m != nil { - return m.Evidence - } - return EvidenceParams{} -} - -func (m *ConsensusParams) GetValidator() ValidatorParams { - if m != nil { - return m.Validator - } - return ValidatorParams{} -} - -func (m *ConsensusParams) GetVersion() VersionParams { - if m != nil { - return m.Version - } - return VersionParams{} -} - -// BlockParams contains limits on the block size. -type BlockParams struct { - // Max block size, in bytes. - // Note: must be greater than 0 - MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - // Max gas per block. - // Note: must be greater or equal to -1 - MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` - // Minimum time increment between consecutive blocks (in milliseconds) If the - // block header timestamp is ahead of the system clock, decrease this value. - // - // Not exposed to the application. - TimeIotaMs int64 `protobuf:"varint,3,opt,name=time_iota_ms,json=timeIotaMs,proto3" json:"time_iota_ms,omitempty"` -} - -func (m *BlockParams) Reset() { *m = BlockParams{} } -func (m *BlockParams) String() string { return proto.CompactTextString(m) } -func (*BlockParams) ProtoMessage() {} -func (*BlockParams) Descriptor() ([]byte, []int) { - return fileDescriptor_93f70d04c868d295, []int{1} -} -func (m *BlockParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BlockParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockParams.Merge(m, src) -} -func (m *BlockParams) XXX_Size() int { - return m.Size() -} -func (m *BlockParams) XXX_DiscardUnknown() { - xxx_messageInfo_BlockParams.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockParams proto.InternalMessageInfo - -func (m *BlockParams) GetMaxBytes() int64 { - if m != nil { - return m.MaxBytes - } - return 0 -} - -func (m *BlockParams) GetMaxGas() int64 { - if m != nil { - return m.MaxGas - } - return 0 -} - -func (m *BlockParams) GetTimeIotaMs() int64 { - if m != nil { - return m.TimeIotaMs - } - return 0 -} - -// EvidenceParams determine how we handle evidence of malfeasance. -type EvidenceParams struct { - // Max age of evidence, in blocks. - // - // The basic formula for calculating this is: MaxAgeDuration / {average block - // time}. - MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"` - // Max age of evidence, in time. - // - // It should correspond with an app's "unbonding period" or other similar - // mechanism for handling [Nothing-At-Stake - // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"` - // This sets the maximum size of total evidence in bytes that can be committed in a single block. - // and should fall comfortably under the max block bytes. - // Default is 1048576 or 1MB - MaxBytes int64 `protobuf:"varint,3,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` -} - -func (m *EvidenceParams) Reset() { *m = EvidenceParams{} } -func (m *EvidenceParams) String() string { return proto.CompactTextString(m) } -func (*EvidenceParams) ProtoMessage() {} -func (*EvidenceParams) Descriptor() ([]byte, []int) { - return fileDescriptor_93f70d04c868d295, []int{2} -} -func (m *EvidenceParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EvidenceParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvidenceParams.Merge(m, src) -} -func (m *EvidenceParams) XXX_Size() int { - return m.Size() -} -func (m *EvidenceParams) XXX_DiscardUnknown() { - xxx_messageInfo_EvidenceParams.DiscardUnknown(m) -} - -var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo - -func (m *EvidenceParams) GetMaxAgeNumBlocks() int64 { - if m != nil { - return m.MaxAgeNumBlocks - } - return 0 -} - -func (m *EvidenceParams) GetMaxAgeDuration() time.Duration { - if m != nil { - return m.MaxAgeDuration - } - return 0 -} - -func (m *EvidenceParams) GetMaxBytes() int64 { - if m != nil { - return m.MaxBytes - } - return 0 -} - -// ValidatorParams restrict the public key types validators can use. -// NOTE: uses ABCI pubkey naming, not Amino names. -type ValidatorParams struct { - PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"` -} - -func (m *ValidatorParams) Reset() { *m = ValidatorParams{} } -func (m *ValidatorParams) String() string { return proto.CompactTextString(m) } -func (*ValidatorParams) ProtoMessage() {} -func (*ValidatorParams) Descriptor() ([]byte, []int) { - return fileDescriptor_93f70d04c868d295, []int{3} -} -func (m *ValidatorParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorParams.Merge(m, src) -} -func (m *ValidatorParams) XXX_Size() int { - return m.Size() -} -func (m *ValidatorParams) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorParams proto.InternalMessageInfo - -func (m *ValidatorParams) GetPubKeyTypes() []string { - if m != nil { - return m.PubKeyTypes - } - return nil -} - -// VersionParams contains the ABCI application version. -type VersionParams struct { - AppVersion uint64 `protobuf:"varint,1,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` -} - -func (m *VersionParams) Reset() { *m = VersionParams{} } -func (m *VersionParams) String() string { return proto.CompactTextString(m) } -func (*VersionParams) ProtoMessage() {} -func (*VersionParams) Descriptor() ([]byte, []int) { - return fileDescriptor_93f70d04c868d295, []int{4} -} -func (m *VersionParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VersionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VersionParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VersionParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionParams.Merge(m, src) -} -func (m *VersionParams) XXX_Size() int { - return m.Size() -} -func (m *VersionParams) XXX_DiscardUnknown() { - xxx_messageInfo_VersionParams.DiscardUnknown(m) -} - -var xxx_messageInfo_VersionParams proto.InternalMessageInfo - -func (m *VersionParams) GetAppVersion() uint64 { - if m != nil { - return m.AppVersion - } - return 0 -} - -// HashedParams is a subset of ConsensusParams. -// -// It is hashed into the Header.ConsensusHash. -type HashedParams struct { - BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"` - BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` -} - -func (m *HashedParams) Reset() { *m = HashedParams{} } -func (m *HashedParams) String() string { return proto.CompactTextString(m) } -func (*HashedParams) ProtoMessage() {} -func (*HashedParams) Descriptor() ([]byte, []int) { - return fileDescriptor_93f70d04c868d295, []int{5} -} -func (m *HashedParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HashedParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HashedParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HashedParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashedParams.Merge(m, src) -} -func (m *HashedParams) XXX_Size() int { - return m.Size() -} -func (m *HashedParams) XXX_DiscardUnknown() { - xxx_messageInfo_HashedParams.DiscardUnknown(m) -} - -var xxx_messageInfo_HashedParams proto.InternalMessageInfo - -func (m *HashedParams) GetBlockMaxBytes() int64 { - if m != nil { - return m.BlockMaxBytes - } - return 0 -} - -func (m *HashedParams) GetBlockMaxGas() int64 { - if m != nil { - return m.BlockMaxGas - } - return 0 -} - -func init() { - proto.RegisterType((*ConsensusParams)(nil), "ostracon.types.ConsensusParams") - proto.RegisterType((*BlockParams)(nil), "ostracon.types.BlockParams") - proto.RegisterType((*EvidenceParams)(nil), "ostracon.types.EvidenceParams") - proto.RegisterType((*ValidatorParams)(nil), "ostracon.types.ValidatorParams") - proto.RegisterType((*VersionParams)(nil), "ostracon.types.VersionParams") - proto.RegisterType((*HashedParams)(nil), "ostracon.types.HashedParams") -} - -func init() { proto.RegisterFile("ostracon/types/params.proto", fileDescriptor_93f70d04c868d295) } - -var fileDescriptor_93f70d04c868d295 = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x53, 0xcf, 0x6e, 0xd3, 0x30, - 0x18, 0xaf, 0x97, 0xb1, 0xb5, 0x5f, 0xd7, 0x16, 0x59, 0x48, 0x94, 0x55, 0x24, 0x55, 0x0e, 0x68, - 0x12, 0x22, 0x91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3, - 0xf0, 0x84, 0x2e, 0x3e, 0x15, 0xa3, 0xc3, 0xe6, 0x8f, 0x4b, 0x0b, 0xfd, 0xbd, 0xb4, 0x90, 0x7d, - 0x08, 0x9d, 0x5a, 0xe6, 0xd8, 0x82, 0x36, 0x49, 0xd3, 0x40, 0xf7, 0x54, 0xec, 0xb8, 0xed, 0x03, - 0x49, 0xd3, 0x8a, 0x76, 0x4b, 0x7b, 0x0a, 0x7b, 0xef, 0x88, 0x38, 0xa3, 0x93, 0x4a, 0xfa, 0x08, - 0x7a, 0x2a, 0x99, 0x60, 0xb3, 0x96, 0x8e, 0x1a, 0x8f, 0x74, 0x37, 0x36, 0x74, 0xd6, 0xbc, 0x75, - 0x43, 0x6d, 0xcd, 0x3a, 0x26, 0xc2, 0x3b, 0xf9, 0xb6, 0x34, 0xd1, 0xd5, 0xd2, 0x44, 0xd7, 0x4b, - 0x13, 0xfd, 0x59, 0x9a, 0xe8, 0x62, 0x65, 0x36, 0xae, 0x57, 0x66, 0xe3, 0xe7, 0xca, 0x6c, 0x9c, - 0x3e, 0x89, 0x62, 0x79, 0x96, 0x87, 0xce, 0x98, 0x33, 0x77, 0x1a, 0x27, 0xd4, 0xbd, 0x79, 0x8f, - 0xe5, 0x3b, 0xab, 0x3f, 0xcf, 0x70, 0x47, 0x4d, 0x9f, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x3c, - 0x58, 0x77, 0x3c, 0xb7, 0x03, 0x00, 0x00, -} - -func (this *ConsensusParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ConsensusParams) - if !ok { - that2, ok := that.(ConsensusParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Block.Equal(&that1.Block) { - return false - } - if !this.Evidence.Equal(&that1.Evidence) { - return false - } - if !this.Validator.Equal(&that1.Validator) { - return false - } - if !this.Version.Equal(&that1.Version) { - return false - } - return true -} -func (this *BlockParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*BlockParams) - if !ok { - that2, ok := that.(BlockParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MaxBytes != that1.MaxBytes { - return false - } - if this.MaxGas != that1.MaxGas { - return false - } - if this.TimeIotaMs != that1.TimeIotaMs { - return false - } - return true -} -func (this *EvidenceParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*EvidenceParams) - if !ok { - that2, ok := that.(EvidenceParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MaxAgeNumBlocks != that1.MaxAgeNumBlocks { - return false - } - if this.MaxAgeDuration != that1.MaxAgeDuration { - return false - } - if this.MaxBytes != that1.MaxBytes { - return false - } - return true -} -func (this *ValidatorParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorParams) - if !ok { - that2, ok := that.(ValidatorParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.PubKeyTypes) != len(that1.PubKeyTypes) { - return false - } - for i := range this.PubKeyTypes { - if this.PubKeyTypes[i] != that1.PubKeyTypes[i] { - return false - } - } - return true -} -func (this *VersionParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VersionParams) - if !ok { - that2, ok := that.(VersionParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.AppVersion != that1.AppVersion { - return false - } - return true -} -func (this *HashedParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*HashedParams) - if !ok { - that2, ok := that.(HashedParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.BlockMaxBytes != that1.BlockMaxBytes { - return false - } - if this.BlockMaxGas != that1.BlockMaxGas { - return false - } - return true -} -func (m *ConsensusParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsensusParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *BlockParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TimeIotaMs != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.TimeIotaMs)) - i-- - dAtA[i] = 0x18 - } - if m.MaxGas != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxGas)) - i-- - dAtA[i] = 0x10 - } - if m.MaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EvidenceParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EvidenceParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EvidenceParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) - i-- - dAtA[i] = 0x18 - } - n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxAgeDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintParams(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x12 - if m.MaxAgeNumBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxAgeNumBlocks)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ValidatorParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PubKeyTypes) > 0 { - for iNdEx := len(m.PubKeyTypes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PubKeyTypes[iNdEx]) - copy(dAtA[i:], m.PubKeyTypes[iNdEx]) - i = encodeVarintParams(dAtA, i, uint64(len(m.PubKeyTypes[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *VersionParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VersionParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VersionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppVersion != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.AppVersion)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *HashedParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashedParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HashedParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BlockMaxGas != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxGas)) - i-- - dAtA[i] = 0x10 - } - if m.BlockMaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedValidatorParams(r randyParams, easy bool) *ValidatorParams { - this := &ValidatorParams{} - v1 := r.Intn(10) - this.PubKeyTypes = make([]string, v1) - for i := 0; i < v1; i++ { - this.PubKeyTypes[i] = string(randStringParams(r)) - } - if !easy && r.Intn(10) != 0 { - } - return this -} - -func NewPopulatedVersionParams(r randyParams, easy bool) *VersionParams { - this := &VersionParams{} - this.AppVersion = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - } - return this -} - -type randyParams interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneParams(r randyParams) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringParams(r randyParams) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneParams(r) - } - return string(tmps) -} -func randUnrecognizedParams(r randyParams, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldParams(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldParams(dAtA []byte, r randyParams, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateParams(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateParams(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateParams(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *ConsensusParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Block.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.Evidence.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.Validator.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.Version.Size() - n += 1 + l + sovParams(uint64(l)) - return n -} - -func (m *BlockParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxBytes != 0 { - n += 1 + sovParams(uint64(m.MaxBytes)) - } - if m.MaxGas != 0 { - n += 1 + sovParams(uint64(m.MaxGas)) - } - if m.TimeIotaMs != 0 { - n += 1 + sovParams(uint64(m.TimeIotaMs)) - } - return n -} - -func (m *EvidenceParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxAgeNumBlocks != 0 { - n += 1 + sovParams(uint64(m.MaxAgeNumBlocks)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration) - n += 1 + l + sovParams(uint64(l)) - if m.MaxBytes != 0 { - n += 1 + sovParams(uint64(m.MaxBytes)) - } - return n -} - -func (m *ValidatorParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PubKeyTypes) > 0 { - for _, s := range m.PubKeyTypes { - l = len(s) - n += 1 + l + sovParams(uint64(l)) - } - } - return n -} - -func (m *VersionParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppVersion != 0 { - n += 1 + sovParams(uint64(m.AppVersion)) - } - return n -} - -func (m *HashedParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockMaxBytes != 0 { - n += 1 + sovParams(uint64(m.BlockMaxBytes)) - } - if m.BlockMaxGas != 0 { - n += 1 + sovParams(uint64(m.BlockMaxGas)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ConsensusParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsensusParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - m.MaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) - } - m.MaxGas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeIotaMs", wireType) - } - m.TimeIotaMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeIotaMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EvidenceParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvidenceParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvidenceParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeNumBlocks", wireType) - } - m.MaxAgeNumBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxAgeNumBlocks |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxAgeDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - m.MaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKeyTypes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PubKeyTypes = append(m.PubKeyTypes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VersionParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VersionParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VersionParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) - } - m.AppVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppVersion |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashedParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashedParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashedParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxBytes", wireType) - } - m.BlockMaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockMaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) - } - m.BlockMaxGas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockMaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/types/types.pb.go b/proto/ostracon/types/types.pb.go index 11251c6a2..08f5e112b 100644 --- a/proto/ostracon/types/types.pb.go +++ b/proto/ostracon/types/types.pb.go @@ -9,7 +9,8 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + _ "github.com/tendermint/tendermint/proto/tendermint/crypto" + types1 "github.com/tendermint/tendermint/proto/tendermint/types" version "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" @@ -29,238 +30,6 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// BlockIdFlag indicates which BlcokID the signature is for -type BlockIDFlag int32 - -const ( - BlockIDFlagUnknown BlockIDFlag = 0 - BlockIDFlagAbsent BlockIDFlag = 1 - BlockIDFlagCommit BlockIDFlag = 2 - BlockIDFlagNil BlockIDFlag = 3 -) - -var BlockIDFlag_name = map[int32]string{ - 0: "BLOCK_ID_FLAG_UNKNOWN", - 1: "BLOCK_ID_FLAG_ABSENT", - 2: "BLOCK_ID_FLAG_COMMIT", - 3: "BLOCK_ID_FLAG_NIL", -} - -var BlockIDFlag_value = map[string]int32{ - "BLOCK_ID_FLAG_UNKNOWN": 0, - "BLOCK_ID_FLAG_ABSENT": 1, - "BLOCK_ID_FLAG_COMMIT": 2, - "BLOCK_ID_FLAG_NIL": 3, -} - -func (x BlockIDFlag) String() string { - return proto.EnumName(BlockIDFlag_name, int32(x)) -} - -func (BlockIDFlag) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{0} -} - -// SignedMsgType is a type of signed message in the consensus. -type SignedMsgType int32 - -const ( - UnknownType SignedMsgType = 0 - // Votes - PrevoteType SignedMsgType = 1 - PrecommitType SignedMsgType = 2 - // Proposals - ProposalType SignedMsgType = 32 -) - -var SignedMsgType_name = map[int32]string{ - 0: "SIGNED_MSG_TYPE_UNKNOWN", - 1: "SIGNED_MSG_TYPE_PREVOTE", - 2: "SIGNED_MSG_TYPE_PRECOMMIT", - 32: "SIGNED_MSG_TYPE_PROPOSAL", -} - -var SignedMsgType_value = map[string]int32{ - "SIGNED_MSG_TYPE_UNKNOWN": 0, - "SIGNED_MSG_TYPE_PREVOTE": 1, - "SIGNED_MSG_TYPE_PRECOMMIT": 2, - "SIGNED_MSG_TYPE_PROPOSAL": 32, -} - -func (x SignedMsgType) String() string { - return proto.EnumName(SignedMsgType_name, int32(x)) -} - -func (SignedMsgType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{1} -} - -// PartsetHeader -type PartSetHeader struct { - Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } -func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } -func (*PartSetHeader) ProtoMessage() {} -func (*PartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{0} -} -func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PartSetHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartSetHeader.Merge(m, src) -} -func (m *PartSetHeader) XXX_Size() int { - return m.Size() -} -func (m *PartSetHeader) XXX_DiscardUnknown() { - xxx_messageInfo_PartSetHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo - -func (m *PartSetHeader) GetTotal() uint32 { - if m != nil { - return m.Total - } - return 0 -} - -func (m *PartSetHeader) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -type Part struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"` - Proof crypto.Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof"` -} - -func (m *Part) Reset() { *m = Part{} } -func (m *Part) String() string { return proto.CompactTextString(m) } -func (*Part) ProtoMessage() {} -func (*Part) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{1} -} -func (m *Part) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Part) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Part.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Part) XXX_Merge(src proto.Message) { - xxx_messageInfo_Part.Merge(m, src) -} -func (m *Part) XXX_Size() int { - return m.Size() -} -func (m *Part) XXX_DiscardUnknown() { - xxx_messageInfo_Part.DiscardUnknown(m) -} - -var xxx_messageInfo_Part proto.InternalMessageInfo - -func (m *Part) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *Part) GetBytes() []byte { - if m != nil { - return m.Bytes - } - return nil -} - -func (m *Part) GetProof() crypto.Proof { - if m != nil { - return m.Proof - } - return crypto.Proof{} -} - -// BlockID -type BlockID struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - PartSetHeader PartSetHeader `protobuf:"bytes,2,opt,name=part_set_header,json=partSetHeader,proto3" json:"part_set_header"` -} - -func (m *BlockID) Reset() { *m = BlockID{} } -func (m *BlockID) String() string { return proto.CompactTextString(m) } -func (*BlockID) ProtoMessage() {} -func (*BlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{2} -} -func (m *BlockID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BlockID) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockID.Merge(m, src) -} -func (m *BlockID) XXX_Size() int { - return m.Size() -} -func (m *BlockID) XXX_DiscardUnknown() { - xxx_messageInfo_BlockID.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockID proto.InternalMessageInfo - -func (m *BlockID) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *BlockID) GetPartSetHeader() PartSetHeader { - if m != nil { - return m.PartSetHeader - } - return PartSetHeader{} -} - // Header defines the structure of an Ostracon block header. type Header struct { // basic block info @@ -269,7 +38,7 @@ type Header struct { Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` // prev block info - LastBlockId BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` + LastBlockId types1.BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` // hashes of block data LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` @@ -291,7 +60,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{3} + return fileDescriptor_0e52e849a4baef8c, []int{0} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -348,11 +117,11 @@ func (m *Header) GetTime() time.Time { return time.Time{} } -func (m *Header) GetLastBlockId() BlockID { +func (m *Header) GetLastBlockId() types1.BlockID { if m != nil { return m.LastBlockId } - return BlockID{} + return types1.BlockID{} } func (m *Header) GetLastCommitHash() []byte { @@ -432,169 +201,19 @@ func (m *Header) GetProof() []byte { return nil } -// Data contains the set of transactions included in the block -type Data struct { - // Txs that will be applied by state @ block.Height+1. - // NOTE: not all txs here are valid. We're just agreeing on the order first. - // This means that block.AppHash does not include these txs. - Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` -} - -func (m *Data) Reset() { *m = Data{} } -func (m *Data) String() string { return proto.CompactTextString(m) } -func (*Data) ProtoMessage() {} -func (*Data) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{4} -} -func (m *Data) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Data.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Data) XXX_Merge(src proto.Message) { - xxx_messageInfo_Data.Merge(m, src) -} -func (m *Data) XXX_Size() int { - return m.Size() -} -func (m *Data) XXX_DiscardUnknown() { - xxx_messageInfo_Data.DiscardUnknown(m) -} - -var xxx_messageInfo_Data proto.InternalMessageInfo - -func (m *Data) GetTxs() [][]byte { - if m != nil { - return m.Txs - } - return nil -} - -// Vote represents a prevote, precommit, or commit vote from validators for -// consensus. -type Vote struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=ostracon.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"` - BlockID BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - ValidatorAddress []byte `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - ValidatorIndex int32 `protobuf:"varint,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"` - Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (m *Vote) String() string { return proto.CompactTextString(m) } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{5} -} -func (m *Vote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(m, src) -} -func (m *Vote) XXX_Size() int { - return m.Size() -} -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) -} - -var xxx_messageInfo_Vote proto.InternalMessageInfo - -func (m *Vote) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *Vote) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Vote) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *Vote) GetBlockID() BlockID { - if m != nil { - return m.BlockID - } - return BlockID{} -} - -func (m *Vote) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *Vote) GetValidatorAddress() []byte { - if m != nil { - return m.ValidatorAddress - } - return nil -} - -func (m *Vote) GetValidatorIndex() int32 { - if m != nil { - return m.ValidatorIndex - } - return 0 -} - -func (m *Vote) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - // Commit contains the evidence that a block was committed by a set of validators. type Commit struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - BlockID BlockID `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Signatures []CommitSig `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures"` + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` + BlockID types1.BlockID `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id"` + Signatures []types1.CommitSig `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures"` } func (m *Commit) Reset() { *m = Commit{} } func (m *Commit) String() string { return proto.CompactTextString(m) } func (*Commit) ProtoMessage() {} func (*Commit) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{6} + return fileDescriptor_0e52e849a4baef8c, []int{1} } func (m *Commit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -637,40 +256,37 @@ func (m *Commit) GetRound() int32 { return 0 } -func (m *Commit) GetBlockID() BlockID { +func (m *Commit) GetBlockID() types1.BlockID { if m != nil { return m.BlockID } - return BlockID{} + return types1.BlockID{} } -func (m *Commit) GetSignatures() []CommitSig { +func (m *Commit) GetSignatures() []types1.CommitSig { if m != nil { return m.Signatures } return nil } -// CommitSig is a part of the Vote included in a Commit. -type CommitSig struct { - BlockIdFlag BlockIDFlag `protobuf:"varint,1,opt,name=block_id_flag,json=blockIdFlag,proto3,enum=ostracon.types.BlockIDFlag" json:"block_id_flag,omitempty"` - ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` +type SignedHeader struct { + Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` } -func (m *CommitSig) Reset() { *m = CommitSig{} } -func (m *CommitSig) String() string { return proto.CompactTextString(m) } -func (*CommitSig) ProtoMessage() {} -func (*CommitSig) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{7} +func (m *SignedHeader) Reset() { *m = SignedHeader{} } +func (m *SignedHeader) String() string { return proto.CompactTextString(m) } +func (*SignedHeader) ProtoMessage() {} +func (*SignedHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_0e52e849a4baef8c, []int{2} } -func (m *CommitSig) XXX_Unmarshal(b []byte) error { +func (m *SignedHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CommitSig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SignedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CommitSig.Marshal(b, m, deterministic) + return xxx_messageInfo_SignedHeader.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -680,205 +296,47 @@ func (m *CommitSig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *CommitSig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitSig.Merge(m, src) +func (m *SignedHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedHeader.Merge(m, src) } -func (m *CommitSig) XXX_Size() int { +func (m *SignedHeader) XXX_Size() int { return m.Size() } -func (m *CommitSig) XXX_DiscardUnknown() { - xxx_messageInfo_CommitSig.DiscardUnknown(m) +func (m *SignedHeader) XXX_DiscardUnknown() { + xxx_messageInfo_SignedHeader.DiscardUnknown(m) } -var xxx_messageInfo_CommitSig proto.InternalMessageInfo - -func (m *CommitSig) GetBlockIdFlag() BlockIDFlag { - if m != nil { - return m.BlockIdFlag - } - return BlockIDFlagUnknown -} +var xxx_messageInfo_SignedHeader proto.InternalMessageInfo -func (m *CommitSig) GetValidatorAddress() []byte { +func (m *SignedHeader) GetHeader() *Header { if m != nil { - return m.ValidatorAddress + return m.Header } return nil } -func (m *CommitSig) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *CommitSig) GetSignature() []byte { +func (m *SignedHeader) GetCommit() *Commit { if m != nil { - return m.Signature + return m.Commit } return nil } -type Proposal struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=ostracon.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"` - PolRound int32 `protobuf:"varint,4,opt,name=pol_round,json=polRound,proto3" json:"pol_round,omitempty"` - BlockID BlockID `protobuf:"bytes,5,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - Signature []byte `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` +type LightBlock struct { + SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` + ValidatorSet *ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` } -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{8} +func (m *LightBlock) Reset() { *m = LightBlock{} } +func (m *LightBlock) String() string { return proto.CompactTextString(m) } +func (*LightBlock) ProtoMessage() {} +func (*LightBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_0e52e849a4baef8c, []int{3} } -func (m *Proposal) XXX_Unmarshal(b []byte) error { +func (m *LightBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} -func (m *Proposal) XXX_Size() int { - return m.Size() -} -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -func (m *Proposal) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *Proposal) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Proposal) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *Proposal) GetPolRound() int32 { - if m != nil { - return m.PolRound - } - return 0 -} - -func (m *Proposal) GetBlockID() BlockID { - if m != nil { - return m.BlockID - } - return BlockID{} -} - -func (m *Proposal) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *Proposal) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type SignedHeader struct { - Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` -} - -func (m *SignedHeader) Reset() { *m = SignedHeader{} } -func (m *SignedHeader) String() string { return proto.CompactTextString(m) } -func (*SignedHeader) ProtoMessage() {} -func (*SignedHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{9} -} -func (m *SignedHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignedHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedHeader.Merge(m, src) -} -func (m *SignedHeader) XXX_Size() int { - return m.Size() -} -func (m *SignedHeader) XXX_DiscardUnknown() { - xxx_messageInfo_SignedHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedHeader proto.InternalMessageInfo - -func (m *SignedHeader) GetHeader() *Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *SignedHeader) GetCommit() *Commit { - if m != nil { - return m.Commit - } - return nil -} - -type LightBlock struct { - SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` - ValidatorSet *ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` -} - -func (m *LightBlock) Reset() { *m = LightBlock{} } -func (m *LightBlock) String() string { return proto.CompactTextString(m) } -func (*LightBlock) ProtoMessage() {} -func (*LightBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{10} -} -func (m *LightBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LightBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *LightBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LightBlock.Marshal(b, m, deterministic) } else { @@ -917,17 +375,17 @@ func (m *LightBlock) GetValidatorSet() *ValidatorSet { } type BlockMeta struct { - BlockID BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id"` - BlockSize int64 `protobuf:"varint,2,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"` - Header Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header"` - NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` + BlockID types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id"` + BlockSize int64 `protobuf:"varint,2,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"` + Header Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header"` + NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` } func (m *BlockMeta) Reset() { *m = BlockMeta{} } func (m *BlockMeta) String() string { return proto.CompactTextString(m) } func (*BlockMeta) ProtoMessage() {} func (*BlockMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{11} + return fileDescriptor_0e52e849a4baef8c, []int{4} } func (m *BlockMeta) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -956,11 +414,11 @@ func (m *BlockMeta) XXX_DiscardUnknown() { var xxx_messageInfo_BlockMeta proto.InternalMessageInfo -func (m *BlockMeta) GetBlockID() BlockID { +func (m *BlockMeta) GetBlockID() types1.BlockID { if m != nil { return m.BlockID } - return BlockID{} + return types1.BlockID{} } func (m *BlockMeta) GetBlockSize() int64 { @@ -984,293 +442,67 @@ func (m *BlockMeta) GetNumTxs() int64 { return 0 } -// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. -type TxProof struct { - RootHash []byte `protobuf:"bytes,1,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Proof *crypto.Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (m *TxProof) Reset() { *m = TxProof{} } -func (m *TxProof) String() string { return proto.CompactTextString(m) } -func (*TxProof) ProtoMessage() {} -func (*TxProof) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{12} -} -func (m *TxProof) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxProof.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TxProof) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxProof.Merge(m, src) -} -func (m *TxProof) XXX_Size() int { - return m.Size() -} -func (m *TxProof) XXX_DiscardUnknown() { - xxx_messageInfo_TxProof.DiscardUnknown(m) -} - -var xxx_messageInfo_TxProof proto.InternalMessageInfo - -func (m *TxProof) GetRootHash() []byte { - if m != nil { - return m.RootHash - } - return nil -} - -func (m *TxProof) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *TxProof) GetProof() *crypto.Proof { - if m != nil { - return m.Proof - } - return nil -} - func init() { - proto.RegisterEnum("ostracon.types.BlockIDFlag", BlockIDFlag_name, BlockIDFlag_value) - proto.RegisterEnum("ostracon.types.SignedMsgType", SignedMsgType_name, SignedMsgType_value) - proto.RegisterType((*PartSetHeader)(nil), "ostracon.types.PartSetHeader") - proto.RegisterType((*Part)(nil), "ostracon.types.Part") - proto.RegisterType((*BlockID)(nil), "ostracon.types.BlockID") proto.RegisterType((*Header)(nil), "ostracon.types.Header") - proto.RegisterType((*Data)(nil), "ostracon.types.Data") - proto.RegisterType((*Vote)(nil), "ostracon.types.Vote") proto.RegisterType((*Commit)(nil), "ostracon.types.Commit") - proto.RegisterType((*CommitSig)(nil), "ostracon.types.CommitSig") - proto.RegisterType((*Proposal)(nil), "ostracon.types.Proposal") proto.RegisterType((*SignedHeader)(nil), "ostracon.types.SignedHeader") proto.RegisterType((*LightBlock)(nil), "ostracon.types.LightBlock") proto.RegisterType((*BlockMeta)(nil), "ostracon.types.BlockMeta") - proto.RegisterType((*TxProof)(nil), "ostracon.types.TxProof") } func init() { proto.RegisterFile("ostracon/types/types.proto", fileDescriptor_0e52e849a4baef8c) } var fileDescriptor_0e52e849a4baef8c = []byte{ - // 1336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0xdb, 0xc6, - 0x12, 0x37, 0x25, 0xca, 0x92, 0x46, 0x92, 0x2d, 0x13, 0x8e, 0xa3, 0x28, 0x89, 0x2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, 0x64, 0xd9, 0x28, 0xd0, 0x56, 0x21, 0x45, 0x31, 0xb5, 0xdc, 0x92, 0x52, - 0x55, 0x36, 0x0a, 0x86, 0x18, 0x68, 0x1a, 0xa8, 0x23, 0x8b, 0x8c, 0x4a, 0x89, 0xaa, 0xb2, 0x91, - 0x37, 0xf8, 0x77, 0x6d, 0x04, 0x2a, 0x0b, 0x65, 0x11, 0x8e, 0x67, 0xa3, 0xc3, 0x30, 0x82, 0x0f, - 0x98, 0xb5, 0x7f, 0x44, 0x11, 0x91, 0x21, 0x62, 0xa0, 0xdd, 0x85, 0x14, 0xcf, 0xbe, 0x94, 0xac, - 0x2a, 0x1b, 0xb9, 0x3b, 0x25, 0x7d, 0x9a, 0xbe, 0x2e, 0x76, 0xa7, 0x77, 0x98, 0xbf, 0xa9, 0xbe, - 0x7c, 0xbd, 0xbe, 0x60, 0x08, 0x70, 0xed, 0x2b, 0x48, 0x37, 0x5d, 0x3c, 0x78, 0xda, 0xda, 0x8a, - 0x12, 0x51, 0xa6, 0x89, 0x68, 0x0f, 0x61, 0xd9, 0xb7, 0x02, 0x6a, 0x12, 0x44, 0xcd, 0x11, 0xdf, - 0x05, 0x5f, 0x34, 0x77, 0xe7, 0xba, 0x3e, 0x5b, 0x03, 0x7d, 0x66, 0xab, 0x72, 0x8d, 0x82, 0x1f, - 0x37, 0xd6, 0x5e, 0xa4, 0x60, 0x51, 0x52, 0xf1, 0x19, 0xa4, 0x25, 0xa5, 0x7c, 0x39, 0x36, 0x5f, - 0x2c, 0x5d, 0xe9, 0xd2, 0x37, 0xb1, 0x47, 0x90, 0x47, 0x26, 0x44, 0xce, 0x17, 0xc6, 0x68, 0xff, - 0x81, 0xcc, 0x60, 0x64, 0x39, 0x9e, 0xe9, 0xd8, 0x3c, 0x9f, 0x6c, 0x33, 0x77, 0xfa, 0x7a, 0x3d, - 0xbd, 0xc9, 0x6c, 0xad, 0x2d, 0x23, 0xcd, 0x9d, 0x2d, 0x5b, 0x5b, 0x83,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, 0x54, 0x8f, 0xfe, 0x25, 0x88, - 0x3f, 0x28, 0xb3, 0x7f, 0x1a, 0xfa, 0x8b, 0xdc, 0xfa, 0xf1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x13, 0x0b, 0x71, 0xbb, 0xef, 0x0c, 0x00, 0x00, -} - -func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PartSetHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PartSetHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if m.Total != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Part) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Part) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Part) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Bytes) > 0 { - i -= len(m.Bytes) - copy(dAtA[i:], m.Bytes) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Bytes))) - i-- - dAtA[i] = 0x12 - } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BlockID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PartSetHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + // 775 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, + 0x18, 0x8d, 0x9b, 0xff, 0xc9, 0x4f, 0x7b, 0xad, 0xde, 0x5e, 0x37, 0x6d, 0x9d, 0x28, 0x57, 0xf7, + 0x12, 0x90, 0x70, 0x50, 0x61, 0xc1, 0x86, 0x45, 0x92, 0x22, 0x5a, 0x09, 0x36, 0x4e, 0xc5, 0x82, + 0x8d, 0x35, 0xb1, 0xa7, 0xce, 0x88, 0xd8, 0x63, 0x79, 0xc6, 0x51, 0xdb, 0xa7, 0xa8, 0x10, 0x0f, + 0xc4, 0xb2, 0xcb, 0x2e, 0x59, 0x15, 0x94, 0x6e, 0xe0, 0x2d, 0xd0, 0xfc, 0x38, 0x75, 0x5a, 0x04, + 0x12, 0x9b, 0x2a, 0x73,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0x68, 0x2c, 0xa7, 0xd3, 0xa1, 0x28, + 0x6d, 0xe4, 0x9e, 0xc5, 0x72, 0x4e, 0xc7, 0x88, 0xd9, 0xf5, 0x79, 0x66, 0xc5, 0xef, 0xb1, 0x2a, + 0xfa, 0x79, 0x83, 0x18, 0x5c, 0xb9, 0x1c, 0xed, 0xcf, 0x2f, 0x67, 0x0f, 0x00, 0x69, 0x43, 0xf1, + 0x39, 0x12, 0x4d, 0xe5, 0xed, 0xaa, 0x40, 0xc6, 0xf8, 0x1c, 0xe9, 0xcf, 0x96, 0x41, 0xe7, 0x7f, + 0x15, 0xb4, 0xba, 0xb2, 0x34, 0xee, 0x7f, 0x40, 0x39, 0x4c, 0x02, 0x87, 0x9d, 0x52, 0xf1, 0x02, + 0xe5, 0xed, 0x52, 0x98, 0x04, 0xc7, 0xa7, 0x74, 0xf8, 0xea, 0x72, 0x61, 0x6a, 0x57, 0x0b, 0x53, + 0xfb, 0xba, 0x30, 0xb5, 0x8b, 0x1b, 0x33, 0x77, 0x75, 0x63, 0xe6, 0x3e, 0xdf, 0x98, 0xb9, 0x77, + 0x8f, 0x7d, 0xcc, 0xa6, 0xc9, 0xc4, 0x72, 0x49, 0xd0, 0x9f, 0xe1, 0x10, 0xf5, 0x97, 0x6f, 0xad, + 0xfc, 0x27, 0xb0, 0xfa, 0xf4, 0x4e, 0x4a, 0x02, 0x7d, 0xfa, 0x23, 0x00, 0x00, 0xff, 0xff, 0x26, + 0x47, 0xde, 0x9a, 0x53, 0x06, 0x00, 0x00, } func (m *Header) Marshal() (dAtA []byte, err error) { @@ -1382,12 +614,12 @@ func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x2a - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err4 != nil { - return 0, err4 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err2 != nil { + return 0, err2 } - i -= n4 - i = encodeVarintTypes(dAtA, i, uint64(n4)) + i -= n2 + i = encodeVarintTypes(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x22 if m.Height != 0 { @@ -1415,7 +647,7 @@ func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Data) Marshal() (dAtA []byte, err error) { +func (m *Commit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1425,119 +657,12 @@ func (m *Data) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Data) MarshalTo(dAtA []byte) (int, error) { +func (m *Commit) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Vote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x42 - } - if m.ValidatorIndex != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ValidatorIndex)) - i-- - dAtA[i] = 0x38 - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0x32 - } - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintTypes(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x2a - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x18 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Commit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Commit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1579,124 +704,6 @@ func (m *Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *CommitSig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CommitSig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x22 - } - n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err9 != nil { - return 0, err9 - } - i -= n9 - i = encodeVarintTypes(dAtA, i, uint64(n9)) - i-- - dAtA[i] = 0x1a - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0x12 - } - if m.BlockIdFlag != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.BlockIdFlag)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Proposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x3a - } - n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err10 != nil { - return 0, err10 - } - i -= n10 - i = encodeVarintTypes(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0x32 - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.PolRound != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.PolRound)) - i-- - dAtA[i] = 0x20 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x18 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *SignedHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1844,55 +851,6 @@ func (m *BlockMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *TxProof) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TxProof) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if len(m.RootHash) > 0 { - i -= len(m.RootHash) - copy(dAtA[i:], m.RootHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.RootHash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -1904,55 +862,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *PartSetHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovTypes(uint64(m.Total)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Part) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - l = len(m.Bytes) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Proof.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *BlockID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.PartSetHeader.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - func (m *Header) Size() (n int) { if m == nil { return 0 @@ -2018,30 +927,12 @@ func (m *Header) Size() (n int) { return n } -func (m *Data) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Vote) Size() (n int) { +func (m *Commit) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } @@ -2050,97 +941,16 @@ func (m *Vote) Size() (n int) { } l = m.BlockID.Size() n += 1 + l + sovTypes(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.ValidatorIndex != 0 { - n += 1 + sovTypes(uint64(m.ValidatorIndex)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + if len(m.Signatures) > 0 { + for _, e := range m.Signatures { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } } return n } -func (m *Commit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - if len(m.Signatures) > 0 { - for _, e := range m.Signatures { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *CommitSig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockIdFlag != 0 { - n += 1 + sovTypes(uint64(m.BlockIdFlag)) - } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.PolRound != 0 { - n += 1 + sovTypes(uint64(m.PolRound)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignedHeader) Size() (n int) { +func (m *SignedHeader) Size() (n int) { if m == nil { return 0 } @@ -2193,137 +1003,13 @@ func (m *BlockMeta) Size() (n int) { return n } -func (m *TxProof) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RootHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *PartSetHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PartSetHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Part) Unmarshal(dAtA []byte) error { +func (m *Header) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2346,68 +1032,15 @@ func (m *Part) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Part: wiretype end group for non-group") + return fmt.Errorf("proto: Header: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Part: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bytes = append(m.Bytes[:0], dAtA[iNdEx:postIndex]...) - if m.Bytes == nil { - m.Bytes = []byte{} - } - iNdEx = postIndex - case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2434,842 +1067,15 @@ func (m *Part) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockID) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PartSetHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PartSetHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Header) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Header: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastCommitHash == nil { - m.LastCommitHash = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) - if m.DataHash == nil { - m.DataHash = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorsHash == nil { - m.ValidatorsHash = []byte{} - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.NextValidatorsHash == nil { - m.NextValidatorsHash = []byte{} - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...) - if m.ConsensusHash == nil { - m.ConsensusHash = []byte{} - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastResultsHash == nil { - m.LastResultsHash = []byte{} - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) - if m.EvidenceHash == nil { - m.EvidenceHash = []byte{} - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} - } - iNdEx = postIndex - case 1000: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 1001: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Data) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Data: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Vote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) } - m.Height = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3279,16 +1085,29 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - m.Round = 0 + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3298,14 +1117,14 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Round |= int32(b&0x7F) << shift + m.Height |= int64(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3332,13 +1151,13 @@ func (m *Vote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3365,13 +1184,13 @@ func (m *Vote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3398,16 +1217,16 @@ func (m *Vote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = append(m.ValidatorAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorAddress == nil { - m.ValidatorAddress = []byte{} + m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastCommitHash == nil { + m.LastCommitHash = []byte{} } iNdEx = postIndex case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIndex", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) } - m.ValidatorIndex = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3417,14 +1236,29 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValidatorIndex |= int32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) + if m.DataHash == nil { + m.DataHash = []byte{} + } + iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3451,66 +1285,16 @@ func (m *Vote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} + m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorsHash == nil { + m.ValidatorsHash = []byte{} } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Commit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Commit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Commit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) } - m.Height = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3520,16 +1304,31 @@ func (m *Commit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) + if byteLen < 0 { + return ErrInvalidLengthTypes } - m.Round = 0 + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) + } + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3539,16 +1338,31 @@ func (m *Commit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Round |= int32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...) + if m.ConsensusHash == nil { + m.ConsensusHash = []byte{} + } + iNdEx = postIndex + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3558,30 +1372,31 @@ func (m *Commit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} } iNdEx = postIndex - case 4: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3591,81 +1406,31 @@ func (m *Commit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signatures = append(m.Signatures, CommitSig{}) - if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastResultsHash == nil { + m.LastResultsHash = []byte{} } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CommitSig) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CommitSig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CommitSig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockIdFlag", wireType) + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) } - m.BlockIdFlag = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3675,14 +1440,29 @@ func (m *CommitSig) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.BlockIdFlag |= BlockIDFlag(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 2: + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) + if m.EvidenceHash == nil { + m.EvidenceHash = []byte{} + } + iNdEx = postIndex + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3709,16 +1489,16 @@ func (m *CommitSig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = append(m.ValidatorAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorAddress == nil { - m.ValidatorAddress = []byte{} + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + case 1000: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) } - var msglen int + m.Round = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3728,28 +1508,14 @@ func (m *CommitSig) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Round |= int32(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: + case 1001: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3776,9 +1542,9 @@ func (m *CommitSig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} } iNdEx = postIndex default: @@ -3802,7 +1568,7 @@ func (m *CommitSig) Unmarshal(dAtA []byte) error { } return nil } -func (m *Proposal) Unmarshal(dAtA []byte) error { +func (m *Commit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3825,32 +1591,13 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Proposal: wiretype end group for non-group") + return fmt.Errorf("proto: Commit: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Commit: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } @@ -3869,7 +1616,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { break } } - case 3: + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) } @@ -3888,26 +1635,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { break } } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PolRound", wireType) - } - m.PolRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PolRound |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) } @@ -3940,9 +1668,9 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3969,44 +1697,11 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + m.Signatures = append(m.Signatures, types1.CommitSig{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -4426,160 +2121,6 @@ func (m *BlockMeta) Unmarshal(dAtA []byte) error { } return nil } -func (m *TxProof) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TxProof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxProof: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...) - if m.RootHash == nil { - m.RootHash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proof == nil { - m.Proof = &crypto.Proof{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/proto/ostracon/types/types.proto b/proto/ostracon/types/types.proto index 1639c75c7..534a18551 100644 --- a/proto/ostracon/types/types.proto +++ b/proto/ostracon/types/types.proto @@ -7,50 +7,51 @@ import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "tendermint/crypto/proof.proto"; import "tendermint/version/types.proto"; +import "tendermint/types/types.proto"; import "ostracon/types/validator.proto"; // BlockIdFlag indicates which BlcokID the signature is for -enum BlockIDFlag { - option (gogoproto.goproto_enum_stringer) = true; - option (gogoproto.goproto_enum_prefix) = false; - - BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; - BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; - BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; - BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; -} +//enum BlockIDFlag { +// option (gogoproto.goproto_enum_stringer) = true; +// option (gogoproto.goproto_enum_prefix) = false; +// +// BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; +// BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; +// BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; +// BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; +//} // SignedMsgType is a type of signed message in the consensus. -enum SignedMsgType { - option (gogoproto.goproto_enum_stringer) = true; - option (gogoproto.goproto_enum_prefix) = false; - - SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; - // Votes - SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; - SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; - - // Proposals - SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; -} +//enum SignedMsgType { +// option (gogoproto.goproto_enum_stringer) = true; +// option (gogoproto.goproto_enum_prefix) = false; +// +// SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; +// // Votes +// SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; +// SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; +// +// // Proposals +// SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; +//} // PartsetHeader -message PartSetHeader { - uint32 total = 1; - bytes hash = 2; -} +//message PartSetHeader { +// uint32 total = 1; +// bytes hash = 2; +//} -message Part { - uint32 index = 1; - bytes bytes = 2; - tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; -} +//message Part { +// uint32 index = 1; +// bytes bytes = 2; +// tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; +//} // BlockID -message BlockID { - bytes hash = 1; - PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; -} +//message BlockID { +// bytes hash = 1; +// PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; +//} // -------------------------------- @@ -63,7 +64,7 @@ message Header { google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // prev block info - BlockID last_block_id = 5 [(gogoproto.nullable) = false]; + tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false]; // hashes of block data bytes last_commit_hash = 6; // commit from validators from the last block @@ -89,55 +90,55 @@ message Header { } // Data contains the set of transactions included in the block -message Data { - // Txs that will be applied by state @ block.Height+1. - // NOTE: not all txs here are valid. We're just agreeing on the order first. - // This means that block.AppHash does not include these txs. - repeated bytes txs = 1; -} +//message Data { +// // Txs that will be applied by state @ block.Height+1. +// // NOTE: not all txs here are valid. We're just agreeing on the order first. +// // This means that block.AppHash does not include these txs. +// repeated bytes txs = 1; +//} // Vote represents a prevote, precommit, or commit vote from validators for // consensus. -message Vote { - SignedMsgType type = 1; - int64 height = 2; - int32 round = 3; - BlockID block_id = 4 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. - google.protobuf.Timestamp timestamp = 5 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes validator_address = 6; - int32 validator_index = 7; - bytes signature = 8; -} +//message Vote { +// SignedMsgType type = 1; +// int64 height = 2; +// int32 round = 3; +// BlockID block_id = 4 +// [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. +// google.protobuf.Timestamp timestamp = 5 +// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +// bytes validator_address = 6; +// int32 validator_index = 7; +// bytes signature = 8; +//} // Commit contains the evidence that a block was committed by a set of validators. message Commit { int64 height = 1; int32 round = 2; - BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; - repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; + tendermint.types.BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated tendermint.types.CommitSig signatures = 4 [(gogoproto.nullable) = false]; } // CommitSig is a part of the Vote included in a Commit. -message CommitSig { - BlockIDFlag block_id_flag = 1; - bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; -} - -message Proposal { - SignedMsgType type = 1; - int64 height = 2; - int32 round = 3; - int32 pol_round = 4; - BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 6 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 7; -} +//message CommitSig { +// BlockIDFlag block_id_flag = 1; +// bytes validator_address = 2; +// google.protobuf.Timestamp timestamp = 3 +// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +// bytes signature = 4; +//} + +//message Proposal { +// SignedMsgType type = 1; +// int64 height = 2; +// int32 round = 3; +// int32 pol_round = 4; +// BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; +// google.protobuf.Timestamp timestamp = 6 +// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +// bytes signature = 7; +//} message SignedHeader { Header header = 1; @@ -150,15 +151,15 @@ message LightBlock { } message BlockMeta { - BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + tendermint.types.BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; int64 block_size = 2; Header header = 3 [(gogoproto.nullable) = false]; int64 num_txs = 4; } // TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. -message TxProof { - bytes root_hash = 1; - bytes data = 2; - tendermint.crypto.Proof proof = 3; -} +//message TxProof { +// bytes root_hash = 1; +// bytes data = 2; +// tendermint.crypto.Proof proof = 3; +//} diff --git a/rpc/client/evidence_test.go b/rpc/client/evidence_test.go index 325105464..a6f5b826e 100644 --- a/rpc/client/evidence_test.go +++ b/rpc/client/evidence_test.go @@ -9,6 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/abci/example/kvstore" abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/ed25519" @@ -16,7 +18,6 @@ import ( "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/privval" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/rpc/client" rpctest "github.com/line/ostracon/rpc/test" "github.com/line/ostracon/types" diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 870814a20..e6bedb515 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -4,11 +4,12 @@ import ( "encoding/json" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/p2p" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/state/execution.go b/state/execution.go index c081413e9..4c50cb3d6 100644 --- a/state/execution.go +++ b/state/execution.go @@ -5,6 +5,8 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -13,7 +15,6 @@ import ( "github.com/line/ostracon/libs/log" mempl "github.com/line/ostracon/mempool" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" canonictime "github.com/line/ostracon/types/time" diff --git a/state/execution_test.go b/state/execution_test.go index f7d3031e5..3c0695082 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" abci "github.com/line/ostracon/abci/types" @@ -19,7 +20,6 @@ import ( "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/libs/log" mmock "github.com/line/ostracon/mempool/mock" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/state/mocks" diff --git a/state/export_test.go b/state/export_test.go index 73ceffb72..23660790d 100644 --- a/state/export_test.go +++ b/state/export_test.go @@ -1,11 +1,11 @@ package state import ( + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/state/helpers_test.go b/state/helpers_test.go index 2392fd597..5df9b5632 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -12,7 +13,6 @@ import ( "github.com/line/ostracon/crypto/ed25519" tmrand "github.com/line/ostracon/libs/rand" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" diff --git a/state/mocks/store.go b/state/mocks/store.go index c83c54cb1..469a7f5f4 100644 --- a/state/mocks/store.go +++ b/state/mocks/store.go @@ -3,13 +3,12 @@ package mocks import ( - ostraconstate "github.com/line/ostracon/proto/ostracon/state" - ostracontypes "github.com/line/ostracon/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" mock "github.com/stretchr/testify/mock" + ostraconstate "github.com/line/ostracon/proto/ostracon/state" + ostracontypes "github.com/line/ostracon/types" state "github.com/line/ostracon/state" - - types "github.com/line/ostracon/proto/ostracon/types" ) // Store is an autogenerated mock type for the Store type @@ -90,14 +89,14 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*ostraconstate.ABCIResponses, err } // LoadConsensusParams provides a mock function with given fields: _a0 -func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { +func (_m *Store) LoadConsensusParams(_a0 int64) (tmproto.ConsensusParams, error) { ret := _m.Called(_a0) - var r0 types.ConsensusParams - if rf, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok { + var r0 tmproto.ConsensusParams + if rf, ok := ret.Get(0).(func(int64) tmproto.ConsensusParams); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ConsensusParams) + r0 = ret.Get(0).(tmproto.ConsensusParams) } var r1 error diff --git a/state/state.go b/state/state.go index ab9f1868b..a7a116f5e 100644 --- a/state/state.go +++ b/state/state.go @@ -7,11 +7,11 @@ import ( "os" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/crypto" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" diff --git a/state/state_test.go b/state/state_test.go index 5e483c255..c2c69a94e 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -21,7 +22,6 @@ import ( cryptoenc "github.com/line/ostracon/crypto/encoding" tmrand "github.com/line/ostracon/libs/rand" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" diff --git a/state/store.go b/state/store.go index 0fec0d565..521f5a5dc 100644 --- a/state/store.go +++ b/state/store.go @@ -5,13 +5,13 @@ import ( "fmt" "github.com/gogo/protobuf/proto" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" tmmath "github.com/line/ostracon/libs/math" tmos "github.com/line/ostracon/libs/os" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) diff --git a/state/store_test.go b/state/store_test.go index fe6a9b7ac..a132ac9d0 100644 --- a/state/store_test.go +++ b/state/store_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -17,7 +18,6 @@ import ( "github.com/line/ostracon/crypto/ed25519" tmrand "github.com/line/ostracon/libs/rand" tmstate "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" statemocks "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/types" diff --git a/state/validation_test.go b/state/validation_test.go index 116ca5861..b0fc05a74 100644 --- a/state/validation_test.go +++ b/state/validation_test.go @@ -8,12 +8,13 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/libs/log" memmock "github.com/line/ostracon/mempool/mock" - tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/types" diff --git a/statesync/messages_test.go b/statesync/messages_test.go index 3f7d713ae..221e2c2da 100644 --- a/statesync/messages_test.go +++ b/statesync/messages_test.go @@ -9,7 +9,7 @@ import ( ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) func TestValidateMsg(t *testing.T) { @@ -18,7 +18,7 @@ func TestValidateMsg(t *testing.T) { valid bool }{ "nil": {nil, false}, - "unrelated": {&tmproto.Block{}, false}, + "unrelated": {&ocproto.Block{}, false}, "ChunkRequest valid": {&ssproto.ChunkRequest{Height: 1, Format: 1, Index: 1}, true}, "ChunkRequest 0 height": {&ssproto.ChunkRequest{Height: 0, Format: 1, Index: 1}, false}, diff --git a/statesync/stateprovider_test.go b/statesync/stateprovider_test.go index a1c597002..7d470cd4e 100644 --- a/statesync/stateprovider_test.go +++ b/statesync/stateprovider_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/config" @@ -19,7 +20,6 @@ import ( tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/light" "github.com/line/ostracon/proto/ostracon/state" - tmproto "github.com/line/ostracon/proto/ostracon/types" ctypes "github.com/line/ostracon/rpc/core/types" rpcserver "github.com/line/ostracon/rpc/jsonrpc/server" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" diff --git a/store/store.go b/store/store.go index 3c1bd5c02..3227ea7fe 100644 --- a/store/store.go +++ b/store/store.go @@ -8,9 +8,10 @@ import ( dbm "github.com/tendermint/tm-db" tmstore "github.com/tendermint/tendermint/proto/tendermint/store" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmsync "github.com/line/ostracon/libs/sync" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) @@ -97,7 +98,7 @@ func (bs *BlockStore) LoadBlock(height int64) *types.Block { return nil } - pbb := new(tmproto.Block) + pbb := new(ocproto.Block) buf := []byte{} for i := 0; i < int(blockMeta.BlockID.PartSetHeader.Total); i++ { part := bs.LoadBlockPart(height, i) @@ -173,7 +174,7 @@ func (bs *BlockStore) LoadBlockPart(height int64, index int) *types.Part { // LoadBlockMeta returns the BlockMeta for the given height. // If no block is found for the given height, it returns nil. func (bs *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { - var pbbm = new(tmproto.BlockMeta) + var pbbm = new(ocproto.BlockMeta) bz, err := bs.db.Get(calcBlockMetaKey(height)) if err != nil { @@ -202,7 +203,7 @@ func (bs *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { // and it comes from the block.LastCommit for `height+1`. // If no commit is found for the given height, it returns nil. func (bs *BlockStore) LoadBlockCommit(height int64) *types.Commit { - var pbc = new(tmproto.Commit) + var pbc = new(ocproto.Commit) bz, err := bs.db.Get(calcBlockCommitKey(height)) if err != nil { panic(err) @@ -225,7 +226,7 @@ func (bs *BlockStore) LoadBlockCommit(height int64) *types.Commit { // This is useful when we've seen a commit, but there has not yet been // a new block at `height + 1` that includes this commit in its block.LastCommit. func (bs *BlockStore) LoadSeenCommit(height int64) *types.Commit { - var pbc = new(tmproto.Commit) + var pbc = new(ocproto.Commit) bz, err := bs.db.Get(calcSeenCommitKey(height)) if err != nil { panic(err) diff --git a/test/kms/bench_test.go b/test/kms/bench_test.go index 08237e79e..c899fb5bc 100644 --- a/test/kms/bench_test.go +++ b/test/kms/bench_test.go @@ -12,6 +12,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/config" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -21,9 +25,7 @@ import ( "github.com/line/ostracon/node" "github.com/line/ostracon/privval" privvalproto "github.com/line/ostracon/proto/ostracon/privval" - types2 "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" - "github.com/stretchr/testify/require" ) var logger = log.NewOCLogger(log.NewSyncWriter(os.Stdout)) @@ -99,7 +101,7 @@ func benchmarkSignVote(b *testing.B, pv types.PrivValidator, pubKey crypto.PubKe }, } vote := types.Vote{ - Type: types2.PrevoteType, + Type: tmproto.PrevoteType, Height: 1, Round: 0, BlockID: blockID, @@ -135,7 +137,7 @@ func benchmarkSignProposal(b *testing.B, pv types.PrivValidator, pubKey crypto.P }, } proposal := types.Proposal{ - Type: types2.ProposalType, + Type: tmproto.ProposalType, Height: 2, Round: 0, POLRound: -1, diff --git a/third_party/proto/tendermint/consensus/types.proto b/third_party/proto/tendermint/consensus/types.proto new file mode 100644 index 000000000..6e1f41371 --- /dev/null +++ b/third_party/proto/tendermint/consensus/types.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; +package tendermint.consensus; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/consensus"; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/libs/bits/types.proto"; + +// NewRoundStep is sent for every step taken in the ConsensusState. +// For every height/round/step transition +message NewRoundStep { + int64 height = 1; + int32 round = 2; + uint32 step = 3; + int64 seconds_since_start_time = 4; + int32 last_commit_round = 5; +} + +// NewValidBlock is sent when a validator observes a valid block B in some round r, +//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. +// In case the block is also committed, then IsCommit flag is set to true. +message NewValidBlock { + int64 height = 1; + int32 round = 2; + tendermint.types.PartSetHeader block_part_set_header = 3 [(gogoproto.nullable) = false]; + tendermint.libs.bits.BitArray block_parts = 4; + bool is_commit = 5; +} + +// Proposal is sent when a new block is proposed. +message Proposal { + tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; +} + +// ProposalPOL is sent when a previous proposal is re-proposed. +message ProposalPOL { + int64 height = 1; + int32 proposal_pol_round = 2; + tendermint.libs.bits.BitArray proposal_pol = 3 [(gogoproto.nullable) = false]; +} + +// BlockPart is sent when gossipping a piece of the proposed block. +message BlockPart { + int64 height = 1; + int32 round = 2; + tendermint.types.Part part = 3 [(gogoproto.nullable) = false]; +} + +// Vote is sent when voting for a proposal (or lack thereof). +message Vote { + tendermint.types.Vote vote = 1; +} + +// HasVote is sent to indicate that a particular vote has been received. +message HasVote { + int64 height = 1; + int32 round = 2; + tendermint.types.SignedMsgType type = 3; + int32 index = 4; +} + +// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes. +message VoteSetMaj23 { + int64 height = 1; + int32 round = 2; + tendermint.types.SignedMsgType type = 3; + tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; +} + +// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID. +message VoteSetBits { + int64 height = 1; + int32 round = 2; + tendermint.types.SignedMsgType type = 3; + tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + tendermint.libs.bits.BitArray votes = 5 [(gogoproto.nullable) = false]; +} + +message Message { + oneof sum { + NewRoundStep new_round_step = 1; + NewValidBlock new_valid_block = 2; + Proposal proposal = 3; + ProposalPOL proposal_pol = 4; + BlockPart block_part = 5; + Vote vote = 6; + HasVote has_vote = 7; + VoteSetMaj23 vote_set_maj23 = 8; + VoteSetBits vote_set_bits = 9; + } +} diff --git a/third_party/proto/tendermint/consensus/wal.proto b/third_party/proto/tendermint/consensus/wal.proto new file mode 100644 index 000000000..44afa2c0c --- /dev/null +++ b/third_party/proto/tendermint/consensus/wal.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package tendermint.consensus; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/consensus"; + +import "gogoproto/gogo.proto"; +import "tendermint/consensus/types.proto"; +import "tendermint/types/events.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +// MsgInfo are msgs from the reactor which may update the state +message MsgInfo { + Message msg = 1 [(gogoproto.nullable) = false]; + string peer_id = 2 [(gogoproto.customname) = "PeerID"]; +} + +// TimeoutInfo internally generated messages which may update the state +message TimeoutInfo { + google.protobuf.Duration duration = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + int64 height = 2; + int32 round = 3; + uint32 step = 4; +} + +// EndHeight marks the end of the given height inside WAL. +// @internal used by scripts/wal2json util. +message EndHeight { + int64 height = 1; +} + +message WALMessage { + oneof sum { + tendermint.types.EventDataRoundState event_data_round_state = 1; + MsgInfo msg_info = 2; + TimeoutInfo timeout_info = 3; + EndHeight end_height = 4; + } +} + +// TimedWALMessage wraps WALMessage and adds Time for debugging purposes. +message TimedWALMessage { + google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + WALMessage msg = 2; +} diff --git a/third_party/proto/tendermint/types/block.proto b/third_party/proto/tendermint/types/block.proto new file mode 100644 index 000000000..84e9bb15d --- /dev/null +++ b/third_party/proto/tendermint/types/block.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; + +message Block { + Header header = 1 [(gogoproto.nullable) = false]; + Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + Commit last_commit = 4; +} diff --git a/proto/ostracon/types/canonical.proto b/third_party/proto/tendermint/types/canonical.proto similarity index 91% rename from proto/ostracon/types/canonical.proto rename to third_party/proto/tendermint/types/canonical.proto index 47348dfbf..e88fd6ffe 100644 --- a/proto/ostracon/types/canonical.proto +++ b/third_party/proto/tendermint/types/canonical.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package ostracon.types; +package tendermint.types; -option go_package = "github.com/line/ostracon/proto/ostracon/types"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; -import "ostracon/types/types.proto"; +import "tendermint/types/types.proto"; import "google/protobuf/timestamp.proto"; message CanonicalBlockID { diff --git a/proto/ostracon/types/events.proto b/third_party/proto/tendermint/types/events.proto similarity index 52% rename from proto/ostracon/types/events.proto rename to third_party/proto/tendermint/types/events.proto index 82e83593c..a1e5cc498 100644 --- a/proto/ostracon/types/events.proto +++ b/third_party/proto/tendermint/types/events.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package ostracon.types; +package tendermint.types; -option go_package = "github.com/line/ostracon/proto/ostracon/types"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; message EventDataRoundState { int64 height = 1; diff --git a/third_party/proto/tendermint/types/evidence.proto b/third_party/proto/tendermint/types/evidence.proto new file mode 100644 index 000000000..3b234571b --- /dev/null +++ b/third_party/proto/tendermint/types/evidence.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/validator.proto"; + +message Evidence { + oneof sum { + DuplicateVoteEvidence duplicate_vote_evidence = 1; + LightClientAttackEvidence light_client_attack_evidence = 2; + } +} + +// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. +message DuplicateVoteEvidence { + tendermint.types.Vote vote_a = 1; + tendermint.types.Vote vote_b = 2; + int64 total_voting_power = 3; + int64 validator_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. +message LightClientAttackEvidence { + tendermint.types.LightBlock conflicting_block = 1; + int64 common_height = 2; + repeated tendermint.types.Validator byzantine_validators = 3; + int64 total_voting_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +message EvidenceList { + repeated Evidence evidence = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/ostracon/types/params.proto b/third_party/proto/tendermint/types/params.proto similarity index 95% rename from proto/ostracon/types/params.proto rename to third_party/proto/tendermint/types/params.proto index 37f39b47b..0de7d846f 100644 --- a/proto/ostracon/types/params.proto +++ b/third_party/proto/tendermint/types/params.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package ostracon.types; +package tendermint.types; -option go_package = "github.com/line/ostracon/proto/ostracon/types"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; diff --git a/third_party/proto/tendermint/types/types.proto b/third_party/proto/tendermint/types/types.proto new file mode 100644 index 000000000..7f7ea74ca --- /dev/null +++ b/third_party/proto/tendermint/types/types.proto @@ -0,0 +1,157 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/crypto/proof.proto"; +import "tendermint/version/types.proto"; +import "tendermint/types/validator.proto"; + +// BlockIdFlag indicates which BlcokID the signature is for +enum BlockIDFlag { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; + BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; + BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; + BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; +} + +// SignedMsgType is a type of signed message in the consensus. +enum SignedMsgType { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; + // Votes + SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; + SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; + + // Proposals + SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; +} + +// PartsetHeader +message PartSetHeader { + uint32 total = 1; + bytes hash = 2; +} + +message Part { + uint32 index = 1; + bytes bytes = 2; + tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; +} + +// BlockID +message BlockID { + bytes hash = 1; + PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; +} + +// -------------------------------- + +// Header defines the structure of a Tendermint block header. +message Header { + // basic block info + tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // prev block info + BlockID last_block_id = 5 [(gogoproto.nullable) = false]; + + // hashes of block data + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block +} + +// Data contains the set of transactions included in the block +message Data { + // Txs that will be applied by state @ block.Height+1. + // NOTE: not all txs here are valid. We're just agreeing on the order first. + // This means that block.AppHash does not include these txs. + repeated bytes txs = 1; +} + +// Vote represents a prevote, precommit, or commit vote from validators for +// consensus. +message Vote { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + BlockID block_id = 4 + [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; + bytes signature = 8; +} + +// Commit contains the evidence that a block was committed by a set of validators. +message Commit { + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; +} + +// CommitSig is a part of the Vote included in a Commit. +message CommitSig { + BlockIDFlag block_id_flag = 1; + bytes validator_address = 2; + google.protobuf.Timestamp timestamp = 3 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; +} + +message Proposal { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + int32 pol_round = 4; + BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + google.protobuf.Timestamp timestamp = 6 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; +} + +message SignedHeader { + Header header = 1; + Commit commit = 2; +} + +message LightBlock { + SignedHeader signed_header = 1; + tendermint.types.ValidatorSet validator_set = 2; +} + +message BlockMeta { + BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + int64 block_size = 2; + Header header = 3 [(gogoproto.nullable) = false]; + int64 num_txs = 4; +} + +// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. +message TxProof { + bytes root_hash = 1; + bytes data = 2; + tendermint.crypto.Proof proof = 3; +} diff --git a/third_party/proto/tendermint/types/validator.proto b/third_party/proto/tendermint/types/validator.proto new file mode 100644 index 000000000..49860b96d --- /dev/null +++ b/third_party/proto/tendermint/types/validator.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/crypto/keys.proto"; + +message ValidatorSet { + repeated Validator validators = 1; + Validator proposer = 2; + int64 total_voting_power = 3; +} + +message Validator { + bytes address = 1; + tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +message SimpleValidator { + tendermint.crypto.PublicKey pub_key = 1; + int64 voting_power = 2; +} diff --git a/tools/tm-signer-harness/internal/test_harness.go b/tools/tm-signer-harness/internal/test_harness.go index 521fecbdb..02b02710f 100644 --- a/tools/tm-signer-harness/internal/test_harness.go +++ b/tools/tm-signer-harness/internal/test_harness.go @@ -8,16 +8,15 @@ import ( "os/signal" "time" - "github.com/line/ostracon/crypto/tmhash" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto/ed25519" - "github.com/line/ostracon/privval" - "github.com/line/ostracon/state" - + "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" tmos "github.com/line/ostracon/libs/os" - tmproto "github.com/line/ostracon/proto/ostracon/types" + "github.com/line/ostracon/privval" + "github.com/line/ostracon/state" "github.com/line/ostracon/types" ) diff --git a/types/block.go b/types/block.go index 0871f2596..b5d42acd8 100644 --- a/types/block.go +++ b/types/block.go @@ -7,14 +7,14 @@ import ( "strings" "time" - "github.com/line/ostracon/crypto/ed25519" - "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/crypto" + "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/crypto/vrf" @@ -22,7 +22,7 @@ import ( tmbytes "github.com/line/ostracon/libs/bytes" tmmath "github.com/line/ostracon/libs/math" tmsync "github.com/line/ostracon/libs/sync" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/version" ) @@ -244,12 +244,12 @@ func (b *Block) StringShort() string { } // ToProto converts Block to protobuf -func (b *Block) ToProto() (*tmproto.Block, error) { +func (b *Block) ToProto() (*ocproto.Block, error) { if b == nil { return nil, errors.New("nil Block") } - pb := new(tmproto.Block) + pb := new(ocproto.Block) pb.Header = *b.Header.ToProto() pb.LastCommit = b.LastCommit.ToProto() @@ -266,7 +266,7 @@ func (b *Block) ToProto() (*tmproto.Block, error) { // FromProto sets a protobuf Block to the given pointer. // It returns an error if the block is invalid. -func BlockFromProto(bp *tmproto.Block) (*Block, error) { +func BlockFromProto(bp *ocproto.Block) (*Block, error) { if bp == nil { return nil, errors.New("nil block") } @@ -564,12 +564,12 @@ func (h *Header) StringIndented(indent string) string { } // ToProto converts Header to protobuf -func (h *Header) ToProto() *tmproto.Header { +func (h *Header) ToProto() *ocproto.Header { if h == nil { return nil } - return &tmproto.Header{ + return &ocproto.Header{ Version: h.Version, ChainID: h.ChainID, Height: h.Height, @@ -591,7 +591,7 @@ func (h *Header) ToProto() *tmproto.Header { // FromProto sets a protobuf Header to the given pointer. // It returns an error if the header is invalid. -func HeaderFromProto(ph *tmproto.Header) (Header, error) { +func HeaderFromProto(ph *ocproto.Header) (Header, error) { if ph == nil { return Header{}, errors.New("nil Header") } @@ -1000,12 +1000,12 @@ func (commit *Commit) StringIndented(indent string) string { } // ToProto converts Commit to protobuf -func (commit *Commit) ToProto() *tmproto.Commit { +func (commit *Commit) ToProto() *ocproto.Commit { if commit == nil { return nil } - c := new(tmproto.Commit) + c := new(ocproto.Commit) sigs := make([]tmproto.CommitSig, len(commit.Signatures)) for i := range commit.Signatures { sigs[i] = *commit.Signatures[i].ToProto() @@ -1021,7 +1021,7 @@ func (commit *Commit) ToProto() *tmproto.Commit { // FromProto sets a protobuf Commit to the given pointer. // It returns an error if the commit is invalid. -func CommitFromProto(cp *tmproto.Commit) (*Commit, error) { +func CommitFromProto(cp *ocproto.Commit) (*Commit, error) { if cp == nil { return nil, errors.New("nil Commit") } @@ -1183,13 +1183,13 @@ func (data *EvidenceData) StringIndented(indent string) string { } // ToProto converts EvidenceData to protobuf -func (data *EvidenceData) ToProto() (*tmproto.EvidenceList, error) { +func (data *EvidenceData) ToProto() (*ocproto.EvidenceList, error) { if data == nil { return nil, errors.New("nil evidence data") } - evi := new(tmproto.EvidenceList) - eviBzs := make([]tmproto.Evidence, len(data.Evidence)) + evi := new(ocproto.EvidenceList) + eviBzs := make([]ocproto.Evidence, len(data.Evidence)) for i := range data.Evidence { protoEvi, err := EvidenceToProto(data.Evidence[i]) if err != nil { @@ -1203,7 +1203,7 @@ func (data *EvidenceData) ToProto() (*tmproto.EvidenceList, error) { } // FromProto sets a protobuf EvidenceData to the given pointer. -func (data *EvidenceData) FromProto(eviData *tmproto.EvidenceList) error { +func (data *EvidenceData) FromProto(eviData *ocproto.EvidenceList) error { if eviData == nil { return errors.New("nil evidenceData") } diff --git a/types/block_meta.go b/types/block_meta.go index 709803187..6aeb136a0 100644 --- a/types/block_meta.go +++ b/types/block_meta.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) // BlockMeta contains meta information. @@ -26,12 +26,12 @@ func NewBlockMeta(block *Block, blockParts *PartSet) *BlockMeta { } } -func (bm *BlockMeta) ToProto() *tmproto.BlockMeta { +func (bm *BlockMeta) ToProto() *ocproto.BlockMeta { if bm == nil { return nil } - pb := &tmproto.BlockMeta{ + pb := &ocproto.BlockMeta{ BlockID: bm.BlockID.ToProto(), BlockSize: int64(bm.BlockSize), Header: *bm.Header.ToProto(), @@ -40,7 +40,7 @@ func (bm *BlockMeta) ToProto() *tmproto.BlockMeta { return pb } -func BlockMetaFromProto(pb *tmproto.BlockMeta) (*BlockMeta, error) { +func BlockMetaFromProto(pb *ocproto.BlockMeta) (*BlockMeta, error) { if pb == nil { return nil, errors.New("blockmeta is empty") } diff --git a/types/block_test.go b/types/block_test.go index 2c04960ee..aecbd18bb 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -17,6 +17,7 @@ import ( gogotypes "github.com/gogo/protobuf/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/crypto" @@ -26,7 +27,6 @@ import ( "github.com/line/ostracon/libs/bits" "github.com/line/ostracon/libs/bytes" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" ) diff --git a/types/canonical.go b/types/canonical.go index c554ef18e..3b170c0d8 100644 --- a/types/canonical.go +++ b/types/canonical.go @@ -3,7 +3,8 @@ package types import ( "time" - tmproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtime "github.com/line/ostracon/types/time" ) diff --git a/types/canonical_test.go b/types/canonical_test.go index 5c3622af3..66517c9d7 100644 --- a/types/canonical_test.go +++ b/types/canonical_test.go @@ -4,9 +4,10 @@ import ( "reflect" "testing" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) func TestCanonicalizeBlockID(t *testing.T) { diff --git a/types/evidence.go b/types/evidence.go index 3ac0e94cd..7f3779d16 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -9,12 +9,14 @@ import ( "strings" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" tmjson "github.com/line/ostracon/libs/json" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) func MaxEvidenceBytes(ev Evidence) int64 { @@ -156,10 +158,10 @@ func (dve *DuplicateVoteEvidence) ValidateBasic() error { } // ToProto encodes DuplicateVoteEvidence to protobuf -func (dve *DuplicateVoteEvidence) ToProto() *tmproto.DuplicateVoteEvidence { +func (dve *DuplicateVoteEvidence) ToProto() *ocproto.DuplicateVoteEvidence { voteB := dve.VoteB.ToProto() voteA := dve.VoteA.ToProto() - tp := tmproto.DuplicateVoteEvidence{ + tp := ocproto.DuplicateVoteEvidence{ VoteA: voteA, VoteB: voteB, TotalVotingPower: dve.TotalVotingPower, @@ -170,7 +172,7 @@ func (dve *DuplicateVoteEvidence) ToProto() *tmproto.DuplicateVoteEvidence { } // DuplicateVoteEvidenceFromProto decodes protobuf into DuplicateVoteEvidence -func DuplicateVoteEvidenceFromProto(pb *tmproto.DuplicateVoteEvidence) (*DuplicateVoteEvidence, error) { +func DuplicateVoteEvidenceFromProto(pb *ocproto.DuplicateVoteEvidence) (*DuplicateVoteEvidence, error) { if pb == nil { return nil, errors.New("nil duplicate vote evidence") } @@ -382,13 +384,13 @@ func (l *LightClientAttackEvidence) ValidateBasic() error { } // ToProto encodes LightClientAttackEvidence to protobuf -func (l *LightClientAttackEvidence) ToProto() (*tmproto.LightClientAttackEvidence, error) { +func (l *LightClientAttackEvidence) ToProto() (*ocproto.LightClientAttackEvidence, error) { conflictingBlock, err := l.ConflictingBlock.ToProto() if err != nil { return nil, err } - byzVals := make([]*tmproto.Validator, len(l.ByzantineValidators)) + byzVals := make([]*ocproto.Validator, len(l.ByzantineValidators)) for idx, val := range l.ByzantineValidators { valpb, err := val.ToProto() if err != nil { @@ -397,7 +399,7 @@ func (l *LightClientAttackEvidence) ToProto() (*tmproto.LightClientAttackEvidenc byzVals[idx] = valpb } - return &tmproto.LightClientAttackEvidence{ + return &ocproto.LightClientAttackEvidence{ ConflictingBlock: conflictingBlock, CommonHeight: l.CommonHeight, ByzantineValidators: byzVals, @@ -407,7 +409,7 @@ func (l *LightClientAttackEvidence) ToProto() (*tmproto.LightClientAttackEvidenc } // LightClientAttackEvidenceFromProto decodes protobuf -func LightClientAttackEvidenceFromProto(lpb *tmproto.LightClientAttackEvidence) (*LightClientAttackEvidence, error) { +func LightClientAttackEvidenceFromProto(lpb *ocproto.LightClientAttackEvidence) (*LightClientAttackEvidence, error) { if lpb == nil { return nil, errors.New("empty light client attack evidence") } @@ -478,7 +480,7 @@ func (evl EvidenceList) Has(evidence Evidence) bool { // EvidenceToProto is a generalized function for encoding evidence that conforms to the // evidence interface to protobuf -func EvidenceToProto(evidence Evidence) (*tmproto.Evidence, error) { +func EvidenceToProto(evidence Evidence) (*ocproto.Evidence, error) { if evidence == nil { return nil, errors.New("nil evidence") } @@ -486,8 +488,8 @@ func EvidenceToProto(evidence Evidence) (*tmproto.Evidence, error) { switch evi := evidence.(type) { case *DuplicateVoteEvidence: pbev := evi.ToProto() - return &tmproto.Evidence{ - Sum: &tmproto.Evidence_DuplicateVoteEvidence{ + return &ocproto.Evidence{ + Sum: &ocproto.Evidence_DuplicateVoteEvidence{ DuplicateVoteEvidence: pbev, }, }, nil @@ -497,8 +499,8 @@ func EvidenceToProto(evidence Evidence) (*tmproto.Evidence, error) { if err != nil { return nil, err } - return &tmproto.Evidence{ - Sum: &tmproto.Evidence_LightClientAttackEvidence{ + return &ocproto.Evidence{ + Sum: &ocproto.Evidence_LightClientAttackEvidence{ LightClientAttackEvidence: pbev, }, }, nil @@ -510,15 +512,15 @@ func EvidenceToProto(evidence Evidence) (*tmproto.Evidence, error) { // EvidenceFromProto is a generalized function for decoding protobuf into the // evidence interface -func EvidenceFromProto(evidence *tmproto.Evidence) (Evidence, error) { +func EvidenceFromProto(evidence *ocproto.Evidence) (Evidence, error) { if evidence == nil { return nil, errors.New("nil evidence") } switch evi := evidence.Sum.(type) { - case *tmproto.Evidence_DuplicateVoteEvidence: + case *ocproto.Evidence_DuplicateVoteEvidence: return DuplicateVoteEvidenceFromProto(evi.DuplicateVoteEvidence) - case *tmproto.Evidence_LightClientAttackEvidence: + case *ocproto.Evidence_LightClientAttackEvidence: return LightClientAttackEvidenceFromProto(evi.LightClientAttackEvidence) default: return nil, errors.New("evidence is not recognized") diff --git a/types/evidence_test.go b/types/evidence_test.go index 9ceff4ff8..c4ab9a358 100644 --- a/types/evidence_test.go +++ b/types/evidence_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/version" ) diff --git a/types/genesis.go b/types/genesis.go index d316a4bc6..255ce0402 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -8,11 +8,12 @@ import ( "os" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" tmbytes "github.com/line/ostracon/libs/bytes" tmjson "github.com/line/ostracon/libs/json" tmos "github.com/line/ostracon/libs/os" - tmproto "github.com/line/ostracon/proto/ostracon/types" tmtime "github.com/line/ostracon/types/time" ) diff --git a/types/light.go b/types/light.go index a30c636f1..2e67ef82c 100644 --- a/types/light.go +++ b/types/light.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) // LightBlock is a SignedHeader and a ValidatorSet. @@ -63,12 +63,12 @@ func (lb LightBlock) StringIndented(indent string) string { } // ToProto converts the LightBlock to protobuf -func (lb *LightBlock) ToProto() (*tmproto.LightBlock, error) { +func (lb *LightBlock) ToProto() (*ocproto.LightBlock, error) { if lb == nil { return nil, nil } - lbp := new(tmproto.LightBlock) + lbp := new(ocproto.LightBlock) var err error if lb.SignedHeader != nil { lbp.SignedHeader = lb.SignedHeader.ToProto() @@ -85,7 +85,7 @@ func (lb *LightBlock) ToProto() (*tmproto.LightBlock, error) { // LightBlockFromProto converts from protobuf back into the Lightblock. // An error is returned if either the validator set or signed header are invalid -func LightBlockFromProto(pb *tmproto.LightBlock) (*LightBlock, error) { +func LightBlockFromProto(pb *ocproto.LightBlock) (*LightBlock, error) { if pb == nil { return nil, errors.New("nil light block") } @@ -176,12 +176,12 @@ func (sh SignedHeader) StringIndented(indent string) string { } // ToProto converts SignedHeader to protobuf -func (sh *SignedHeader) ToProto() *tmproto.SignedHeader { +func (sh *SignedHeader) ToProto() *ocproto.SignedHeader { if sh == nil { return nil } - psh := new(tmproto.SignedHeader) + psh := new(ocproto.SignedHeader) if sh.Header != nil { psh.Header = sh.Header.ToProto() } @@ -194,7 +194,7 @@ func (sh *SignedHeader) ToProto() *tmproto.SignedHeader { // FromProto sets a protobuf SignedHeader to the given pointer. // It returns an error if the header or the commit is invalid. -func SignedHeaderFromProto(shp *tmproto.SignedHeader) (*SignedHeader, error) { +func SignedHeaderFromProto(shp *ocproto.SignedHeader) (*SignedHeader, error) { if shp == nil { return nil, errors.New("nil SignedHeader") } diff --git a/types/params.go b/types/params.go index 428ee3b87..62826c5f9 100644 --- a/types/params.go +++ b/types/params.go @@ -5,9 +5,10 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/tmhash" - tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/version" ) diff --git a/types/params_test.go b/types/params_test.go index 7e68cf665..a343baf25 100644 --- a/types/params_test.go +++ b/types/params_test.go @@ -6,10 +6,11 @@ import ( "testing" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/stretchr/testify/assert" abci "github.com/line/ostracon/abci/types" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) var ( diff --git a/types/part_set.go b/types/part_set.go index 7485592e6..3932cd0c6 100644 --- a/types/part_set.go +++ b/types/part_set.go @@ -6,13 +6,14 @@ import ( "fmt" "io" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/libs/bits" tmbytes "github.com/line/ostracon/libs/bytes" tmjson "github.com/line/ostracon/libs/json" tmmath "github.com/line/ostracon/libs/math" tmsync "github.com/line/ostracon/libs/sync" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) var ( diff --git a/types/priv_validator.go b/types/priv_validator.go index 56c021491..2fd34f6e9 100644 --- a/types/priv_validator.go +++ b/types/priv_validator.go @@ -5,9 +5,10 @@ import ( "errors" "fmt" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) // PrivValidator defines the functionality of a local Ostracon validator diff --git a/types/proposal.go b/types/proposal.go index 978cf2e1f..450f85493 100644 --- a/types/proposal.go +++ b/types/proposal.go @@ -5,9 +5,10 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmbytes "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/libs/protoio" - tmproto "github.com/line/ostracon/proto/ostracon/types" tmtime "github.com/line/ostracon/types/time" ) diff --git a/types/proposal_test.go b/types/proposal_test.go index e6d55e193..c8e5c8b1f 100644 --- a/types/proposal_test.go +++ b/types/proposal_test.go @@ -9,10 +9,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/libs/protoio" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) var ( diff --git a/types/protobuf.go b/types/protobuf.go index 3b5c4b7f7..156ef8b90 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -1,12 +1,14 @@ package types import ( + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/secp256k1" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) //------------------------------------------------------- @@ -32,8 +34,8 @@ var OC2PB = oc2pb{} type oc2pb struct{} -func (oc2pb) Header(header *Header) tmproto.Header { - return tmproto.Header{ +func (oc2pb) Header(header *Header) ocproto.Header { + return ocproto.Header{ Version: header.Version, ChainID: header.ChainID, Height: header.Height, diff --git a/types/signed_msg_type.go b/types/signed_msg_type.go index f75bf8ab7..4ab5685a7 100644 --- a/types/signed_msg_type.go +++ b/types/signed_msg_type.go @@ -1,6 +1,6 @@ package types -import tmproto "github.com/line/ostracon/proto/ostracon/types" +import tmproto "github.com/tendermint/tendermint/proto/tendermint/types" // IsVoteTypeValid returns true if t is a valid vote type. func IsVoteTypeValid(t tmproto.SignedMsgType) bool { diff --git a/types/test_util.go b/types/test_util.go index 0b1af754c..367fd0631 100644 --- a/types/test_util.go +++ b/types/test_util.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - tmproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) func MakeCommit(blockID BlockID, height int64, round int32, diff --git a/types/tx.go b/types/tx.go index 41f3120e6..debff8f59 100644 --- a/types/tx.go +++ b/types/tx.go @@ -5,10 +5,11 @@ import ( "errors" "fmt" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" tmbytes "github.com/line/ostracon/libs/bytes" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) // Tx is an arbitrary byte array. diff --git a/types/tx_test.go b/types/tx_test.go index c8e239834..8308eaac0 100644 --- a/types/tx_test.go +++ b/types/tx_test.go @@ -7,9 +7,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmrand "github.com/line/ostracon/libs/rand" ctest "github.com/line/ostracon/libs/test" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) func makeTxs(cnt, size int) Txs { diff --git a/types/validator.go b/types/validator.go index e868e6c39..93612f447 100644 --- a/types/validator.go +++ b/types/validator.go @@ -9,7 +9,7 @@ import ( "github.com/line/ostracon/crypto" ce "github.com/line/ostracon/crypto/encoding" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) // Volatile state for each Validator @@ -120,7 +120,7 @@ func (v *Validator) Bytes() []byte { panic(err) } - pbv := tmproto.SimpleValidator{ + pbv := ocproto.SimpleValidator{ PubKey: &pk, VotingPower: v.VotingPower, } @@ -133,7 +133,7 @@ func (v *Validator) Bytes() []byte { } // ToProto converts Valiator to protobuf -func (v *Validator) ToProto() (*tmproto.Validator, error) { +func (v *Validator) ToProto() (*ocproto.Validator, error) { if v == nil { return nil, errors.New("nil validator") } @@ -143,7 +143,7 @@ func (v *Validator) ToProto() (*tmproto.Validator, error) { return nil, err } - vp := tmproto.Validator{ + vp := ocproto.Validator{ Address: v.Address, PubKey: pk, VotingPower: v.VotingPower, @@ -155,7 +155,7 @@ func (v *Validator) ToProto() (*tmproto.Validator, error) { // FromProto sets a protobuf Validator to the given pointer. // It returns an error if the public key is invalid. -func ValidatorFromProto(vp *tmproto.Validator) (*Validator, error) { +func ValidatorFromProto(vp *ocproto.Validator) (*Validator, error) { if vp == nil { return nil, errors.New("nil validator") } diff --git a/types/validator_set.go b/types/validator_set.go index 209cfb2b8..2ca26ceef 100644 --- a/types/validator_set.go +++ b/types/validator_set.go @@ -14,7 +14,7 @@ import ( "github.com/line/ostracon/crypto/tmhash" tmmath "github.com/line/ostracon/libs/math" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) const ( @@ -909,13 +909,13 @@ func (valz ValidatorsByAddress) Swap(i, j int) { } // ToProto converts ValidatorSet to protobuf -func (vals *ValidatorSet) ToProto() (*tmproto.ValidatorSet, error) { +func (vals *ValidatorSet) ToProto() (*ocproto.ValidatorSet, error) { if vals.IsNilOrEmpty() { - return &tmproto.ValidatorSet{}, nil // validator set should never be nil + return &ocproto.ValidatorSet{}, nil // validator set should never be nil } - vp := new(tmproto.ValidatorSet) - valsProto := make([]*tmproto.Validator, len(vals.Validators)) + vp := new(ocproto.ValidatorSet) + valsProto := make([]*ocproto.Validator, len(vals.Validators)) for i := 0; i < len(vals.Validators); i++ { valp, err := vals.Validators[i].ToProto() if err != nil { @@ -933,7 +933,7 @@ func (vals *ValidatorSet) ToProto() (*tmproto.ValidatorSet, error) { // ValidatorSetFromProto sets a protobuf ValidatorSet to the given pointer. // It returns an error if any of the validators from the set or the proposer // is invalid -func ValidatorSetFromProto(vp *tmproto.ValidatorSet) (*ValidatorSet, error) { +func ValidatorSetFromProto(vp *ocproto.ValidatorSet) (*ValidatorSet, error) { if vp == nil { return nil, errors.New("nil validator set") // validator set should never be nil, bigger issues are at play if empty } diff --git a/types/validator_set_test.go b/types/validator_set_test.go index d4490cb18..a408a5be9 100644 --- a/types/validator_set_test.go +++ b/types/validator_set_test.go @@ -13,12 +13,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" tmmath "github.com/line/ostracon/libs/math" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) func TestValidatorSetBasic(t *testing.T) { @@ -413,7 +414,7 @@ func (vals *ValidatorSet) toBytes() []byte { } func (vals *ValidatorSet) fromBytes(b []byte) *ValidatorSet { - pbvs := new(tmproto.ValidatorSet) + pbvs := new(ocproto.ValidatorSet) err := pbvs.Unmarshal(b) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED @@ -1641,7 +1642,7 @@ func TestValidatorSetProtoBuf(t *testing.T) { } } -//--------------------- +// --------------------- // Sort validators by priority and address type validatorsByPriority []*Validator @@ -1682,9 +1683,8 @@ func (tvals testValsByVotingPower) Swap(i, j int) { tvals[i], tvals[j] = tvals[j], tvals[i] } -//------------------------------------- +// ------------------------------------- // Benchmark tests -// func BenchmarkUpdates(b *testing.B) { const ( n = 100 diff --git a/types/vote.go b/types/vote.go index 52defe9cc..4c0e6b9ac 100644 --- a/types/vote.go +++ b/types/vote.go @@ -6,11 +6,12 @@ import ( "fmt" "time" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" tmbytes "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/libs/protoio" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) const ( diff --git a/types/vote_set.go b/types/vote_set.go index 49808311e..e6733c521 100644 --- a/types/vote_set.go +++ b/types/vote_set.go @@ -5,11 +5,12 @@ import ( "fmt" "strings" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/libs/bits" tmjson "github.com/line/ostracon/libs/json" tmsync "github.com/line/ostracon/libs/sync" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) const ( diff --git a/types/vote_set_test.go b/types/vote_set_test.go index 9884d718a..fb9f921bb 100644 --- a/types/vote_set_test.go +++ b/types/vote_set_test.go @@ -6,10 +6,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" tmrand "github.com/line/ostracon/libs/rand" - tmproto "github.com/line/ostracon/proto/ostracon/types" tmtime "github.com/line/ostracon/types/time" ) diff --git a/types/vote_test.go b/types/vote_test.go index 277a3f3a7..c80becbe2 100644 --- a/types/vote_test.go +++ b/types/vote_test.go @@ -9,11 +9,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/libs/protoio" - tmproto "github.com/line/ostracon/proto/ostracon/types" ) func examplePrevote() *Vote { From db4a266a5cb0005cb7fd3aaf36f4e872d8089ff8 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 7 Jan 2023 01:42:56 +0900 Subject: [PATCH 08/25] feat: clean up `proto/ostracon/state` proto directory --- consensus/replay_stubs.go | 6 +- consensus/replay_test.go | 8 +- proto/ostracon/state/types.pb.go | 551 ++---------------- proto/ostracon/state/types.proto | 20 +- rpc/core/blocks_test.go | 4 +- state/execution.go | 10 +- state/export_test.go | 4 +- state/helpers_test.go | 14 +- state/mocks/store.go | 16 +- state/rollback.go | 2 +- state/rollback_test.go | 2 +- state/state.go | 9 +- state/state_test.go | 30 +- state/store.go | 23 +- state/store_test.go | 9 +- statesync/reactor_test.go | 2 +- statesync/stateprovider.go | 2 +- statesync/stateprovider_test.go | 4 +- statesync/syncer_test.go | 2 +- third_party/proto/tendermint/abci/types.proto | 407 +++++++++++++ .../proto/tendermint/state/types.proto | 75 +++ 21 files changed, 627 insertions(+), 573 deletions(-) create mode 100644 third_party/proto/tendermint/abci/types.proto create mode 100644 third_party/proto/tendermint/state/types.proto diff --git a/consensus/replay_stubs.go b/consensus/replay_stubs.go index 50f700fec..0956992fc 100644 --- a/consensus/replay_stubs.go +++ b/consensus/replay_stubs.go @@ -4,7 +4,7 @@ import ( abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/clist" mempl "github.com/line/ostracon/mempool" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" ) @@ -52,7 +52,7 @@ func (emptyMempool) CloseWAL() {} // Useful because we don't want to call Commit() twice for the same block on // the real app. -func newMockProxyApp(appHash []byte, abciResponses *tmstate.ABCIResponses) proxy.AppConnConsensus { +func newMockProxyApp(appHash []byte, abciResponses *ocstate.ABCIResponses) proxy.AppConnConsensus { clientCreator := proxy.NewLocalClientCreator(&mockProxyApp{ appHash: appHash, abciResponses: abciResponses, @@ -70,7 +70,7 @@ type mockProxyApp struct { appHash []byte txCount int - abciResponses *tmstate.ABCIResponses + abciResponses *ocstate.ABCIResponses } func (mock *mockProxyApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { diff --git a/consensus/replay_test.go b/consensus/replay_test.go index dc27322a2..1cdb3c1fc 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -29,7 +29,7 @@ import ( tmrand "github.com/line/ostracon/libs/rand" mempl "github.com/line/ostracon/mempool" "github.com/line/ostracon/privval" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" @@ -608,14 +608,14 @@ func TestMockProxyApp(t *testing.T) { txIndex := 0 assert.NotPanics(t, func() { - abciResWithEmptyDeliverTx := new(tmstate.ABCIResponses) + abciResWithEmptyDeliverTx := new(ocstate.ABCIResponses) abciResWithEmptyDeliverTx.DeliverTxs = make([]*abci.ResponseDeliverTx, 0) abciResWithEmptyDeliverTx.DeliverTxs = append(abciResWithEmptyDeliverTx.DeliverTxs, &abci.ResponseDeliverTx{}) // called when saveABCIResponses: bytes, err := proto.Marshal(abciResWithEmptyDeliverTx) require.NoError(t, err) - loadedAbciRes := new(tmstate.ABCIResponses) + loadedAbciRes := new(ocstate.ABCIResponses) // this also happens sm.LoadABCIResponses err = proto.Unmarshal(bytes, loadedAbciRes) @@ -623,7 +623,7 @@ func TestMockProxyApp(t *testing.T) { mock := newMockProxyApp([]byte("mock_hash"), loadedAbciRes) - abciRes := new(tmstate.ABCIResponses) + abciRes := new(ocstate.ABCIResponses) abciRes.DeliverTxs = make([]*abci.ResponseDeliverTx, len(loadedAbciRes.DeliverTxs)) // Execute transactions and get hash. proxyCb := func(req *abci.Request, res *abci.Response) { diff --git a/proto/ostracon/state/types.pb.go b/proto/ostracon/state/types.pb.go index 160d3cc65..740541cf3 100644 --- a/proto/ostracon/state/types.pb.go +++ b/proto/ostracon/state/types.pb.go @@ -11,8 +11,9 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/line/ostracon/abci/types" types1 "github.com/line/ostracon/proto/ostracon/types" + state "github.com/tendermint/tendermint/proto/tendermint/state" types2 "github.com/tendermint/tendermint/proto/tendermint/types" - version "github.com/tendermint/tendermint/proto/tendermint/version" + _ "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" math_bits "math/bits" @@ -147,113 +148,8 @@ func (m *ValidatorsInfo) GetLastHeightChanged() int64 { return 0 } -// ConsensusParamsInfo represents the latest consensus params, or the last height it changed -type ConsensusParamsInfo struct { - ConsensusParams types2.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` - LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"` -} - -func (m *ConsensusParamsInfo) Reset() { *m = ConsensusParamsInfo{} } -func (m *ConsensusParamsInfo) String() string { return proto.CompactTextString(m) } -func (*ConsensusParamsInfo) ProtoMessage() {} -func (*ConsensusParamsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_898987a4421067cd, []int{2} -} -func (m *ConsensusParamsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsensusParamsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusParamsInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConsensusParamsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusParamsInfo.Merge(m, src) -} -func (m *ConsensusParamsInfo) XXX_Size() int { - return m.Size() -} -func (m *ConsensusParamsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusParamsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusParamsInfo proto.InternalMessageInfo - -func (m *ConsensusParamsInfo) GetConsensusParams() types2.ConsensusParams { - if m != nil { - return m.ConsensusParams - } - return types2.ConsensusParams{} -} - -func (m *ConsensusParamsInfo) GetLastHeightChanged() int64 { - if m != nil { - return m.LastHeightChanged - } - return 0 -} - -type Version struct { - Consensus version.Consensus `protobuf:"bytes,1,opt,name=consensus,proto3" json:"consensus"` - Software string `protobuf:"bytes,2,opt,name=software,proto3" json:"software,omitempty"` -} - -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_898987a4421067cd, []int{3} -} -func (m *Version) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) -} -func (m *Version) XXX_Size() int { - return m.Size() -} -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) -} - -var xxx_messageInfo_Version proto.InternalMessageInfo - -func (m *Version) GetConsensus() version.Consensus { - if m != nil { - return m.Consensus - } - return version.Consensus{} -} - -func (m *Version) GetSoftware() string { - if m != nil { - return m.Software - } - return "" -} - type State struct { - Version Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` + Version state.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` // immutable ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` InitialHeight int64 `protobuf:"varint,14,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` @@ -287,7 +183,7 @@ func (m *State) Reset() { *m = State{} } func (m *State) String() string { return proto.CompactTextString(m) } func (*State) ProtoMessage() {} func (*State) Descriptor() ([]byte, []int) { - return fileDescriptor_898987a4421067cd, []int{4} + return fileDescriptor_898987a4421067cd, []int{2} } func (m *State) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -316,11 +212,11 @@ func (m *State) XXX_DiscardUnknown() { var xxx_messageInfo_State proto.InternalMessageInfo -func (m *State) GetVersion() Version { +func (m *State) GetVersion() state.Version { if m != nil { return m.Version } - return Version{} + return state.Version{} } func (m *State) GetChainID() string { @@ -424,65 +320,60 @@ func (m *State) GetLastProofHash() []byte { func init() { proto.RegisterType((*ABCIResponses)(nil), "ostracon.state.ABCIResponses") proto.RegisterType((*ValidatorsInfo)(nil), "ostracon.state.ValidatorsInfo") - proto.RegisterType((*ConsensusParamsInfo)(nil), "ostracon.state.ConsensusParamsInfo") - proto.RegisterType((*Version)(nil), "ostracon.state.Version") proto.RegisterType((*State)(nil), "ostracon.state.State") } func init() { proto.RegisterFile("ostracon/state/types.proto", fileDescriptor_898987a4421067cd) } var fileDescriptor_898987a4421067cd = []byte{ - // 800 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x6e, 0xe3, 0x36, - 0x14, 0xb5, 0xea, 0x99, 0x91, 0x4d, 0xc5, 0x76, 0xcb, 0x14, 0xa8, 0xe2, 0xce, 0xc8, 0x1e, 0xa3, - 0x8f, 0xa0, 0x40, 0x65, 0x60, 0xba, 0xe8, 0x66, 0x36, 0x96, 0x3d, 0xe8, 0x18, 0x18, 0x14, 0x03, - 0xcd, 0x20, 0x8b, 0x6e, 0x04, 0x5a, 0xa2, 0x25, 0xa2, 0xb2, 0x28, 0x88, 0xb4, 0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ff, 0x45, 0x74, 0xf7, 0xf8, 0x50, 0x07, 0x00, 0x00, + // 744 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x4f, 0xdb, 0x4a, + 0x14, 0x8d, 0x5f, 0x80, 0x84, 0x31, 0x49, 0xde, 0x1b, 0xde, 0xc2, 0xa4, 0xd4, 0x49, 0x51, 0x3f, + 0x50, 0xa5, 0x3a, 0x12, 0x5d, 0x55, 0x62, 0x83, 0x13, 0x54, 0x22, 0xa1, 0x0a, 0x19, 0xc4, 0xa2, + 0x1b, 0x6b, 0x62, 0x0f, 0xf6, 0xa8, 0x8e, 0xc7, 0xf2, 0x4c, 0x22, 0xba, 0x6e, 0x7f, 0x00, 0x3f, + 0x8b, 0x25, 0x8b, 0x2e, 0xba, 0xa2, 0x55, 0xd8, 0xf4, 0x67, 0x54, 0x33, 0x63, 0x3b, 0x0e, 0x11, + 0x52, 0x76, 0xe3, 0x7b, 0xce, 0x3d, 0x3e, 0xbe, 0xf7, 0xd8, 0x06, 0x6d, 0xca, 0x78, 0x8a, 0x3c, + 0x1a, 0xf7, 0x18, 0x47, 0x1c, 0xf7, 0xf8, 0xd7, 0x04, 0x33, 0x2b, 0x49, 0x29, 0xa7, 0xb0, 0x99, + 0x63, 0x96, 0xc4, 0xda, 0xff, 0x07, 0x34, 0xa0, 0x12, 0xea, 0x89, 0x93, 0x62, 0xb5, 0x77, 0x0a, + 0x05, 0x34, 0xf2, 0x48, 0x59, 0xa0, 0x3d, 0x17, 0x97, 0xd5, 0x05, 0xcc, 0x7c, 0x84, 0x4d, 0x51, + 0x44, 0x7c, 0xc4, 0x69, 0x9a, 0xe1, 0xcf, 0x39, 0x8e, 0x7d, 0x9c, 0x8e, 0x49, 0xcc, 0x33, 0x46, + 0x82, 0x52, 0x34, 0xce, 0xdb, 0x77, 0x97, 0xe0, 0x05, 0xf1, 0x12, 0x3a, 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c0, 0x43, 0x00, 0x4a, 0x0a, 0xb5, 0x15, 0x14, 0x4a, + 0x7c, 0x61, 0x42, 0x3e, 0x52, 0x49, 0xa2, 0xbe, 0x8a, 0x09, 0xd1, 0x54, 0x32, 0xd1, 0x07, 0x66, + 0x39, 0x5d, 0x73, 0xb5, 0x22, 0x68, 0x9b, 0x72, 0x4d, 0xcf, 0xe6, 0x41, 0x9b, 0x77, 0x67, 0x91, + 0x83, 0x0e, 0xf8, 0xd7, 0x13, 0xef, 0x45, 0xcc, 0x26, 0xcc, 0x55, 0x1f, 0x21, 0x03, 0x64, 0x6f, + 0xd0, 0xd2, 0xd6, 0xfa, 0x39, 0xf3, 0x4c, 0x12, 0xb3, 0xe4, 0xb5, 0xbc, 0xc5, 0x32, 0xfc, 0x04, + 0x5e, 0x2e, 0xc4, 0xfe, 0x91, 0x7e, 0x61, 0x4f, 0x97, 0xf6, 0xba, 0xa5, 0xf7, 0x60, 0x51, 0x28, + 0xf7, 0x98, 0x47, 0x30, 0xc5, 0x6c, 0x12, 0x71, 0xe6, 0x86, 0x88, 0x85, 0xc6, 0x56, 0x57, 0xdb, + 0xdf, 0x52, 0x11, 0x74, 0x54, 0xfd, 0x04, 0xb1, 0x10, 0xee, 0x80, 0x3a, 0x4a, 0x12, 0x45, 0x69, + 0x48, 0x4a, 0x0d, 0x25, 0x89, 0x84, 0xde, 0x64, 0x63, 0x4f, 0x52, 0x4a, 0xaf, 0x14, 0xe3, 0x4f, + 0x4d, 0x52, 0x64, 0x48, 0xce, 0x44, 0x59, 0x10, 0xed, 0x8f, 0xb7, 0x33, 0x53, 0xbb, 0x9b, 0x99, + 0xda, 0xef, 0x99, 0xa9, 0xdd, 0x3c, 0x98, 0x95, 0xbb, 0x07, 0xb3, 0xf2, 0xf3, 0xc1, 0xac, 0x7c, + 0x7e, 0x17, 0x10, 0x1e, 0x4e, 0x46, 0x96, 0x47, 0xc7, 0xbd, 0x88, 0xc4, 0xb8, 0x57, 0x7c, 0xe7, + 0xd5, 0x9f, 0x63, 0xf1, 0x7f, 0x33, 0xda, 0x90, 0xd5, 0xf7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x8d, 0xa7, 0x16, 0x58, 0x88, 0x06, 0x00, 0x00, } func (m *ABCIResponses) Marshal() (dAtA []byte, err error) { @@ -586,84 +477,6 @@ func (m *ValidatorsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ConsensusParamsInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConsensusParamsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsensusParamsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastHeightChanged != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastHeightChanged)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Version) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Version) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Software) > 0 { - i -= len(m.Software) - copy(dAtA[i:], m.Software) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Software))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Consensus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *State) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -768,12 +581,12 @@ func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):]) - if err10 != nil { - return 0, err10 + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):]) + if err8 != nil { + return 0, err8 } - i -= n10 - i = encodeVarintTypes(dAtA, i, uint64(n10)) + i -= n8 + i = encodeVarintTypes(dAtA, i, uint64(n8)) i-- dAtA[i] = 0x2a { @@ -861,35 +674,6 @@ func (m *ValidatorsInfo) Size() (n int) { return n } -func (m *ConsensusParamsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ConsensusParams.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.LastHeightChanged != 0 { - n += 1 + sovTypes(uint64(m.LastHeightChanged)) - } - return n -} - -func (m *Version) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Consensus.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Software) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func (m *State) Size() (n int) { if m == nil { return 0 @@ -1214,223 +998,6 @@ func (m *ValidatorsInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConsensusParamsInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsensusParamsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusParamsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastHeightChanged", wireType) - } - m.LastHeightChanged = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastHeightChanged |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Version) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Version: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consensus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Consensus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Software", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Software = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *State) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index e4b9bbfb5..314a08840 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -11,6 +11,8 @@ import "tendermint/types/params.proto"; import "tendermint/types/types.proto"; import "tendermint/version/types.proto"; import "google/protobuf/timestamp.proto"; +import "tendermint/types/types.proto"; +import "tendermint/state/types.proto"; // ABCIResponses retains the responses // of the various ABCI calls during block processing. @@ -28,18 +30,18 @@ message ValidatorsInfo { } // ConsensusParamsInfo represents the latest consensus params, or the last height it changed -message ConsensusParamsInfo { - tendermint.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false]; - int64 last_height_changed = 2; -} +//message ConsensusParamsInfo { +// tendermint.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false]; +// int64 last_height_changed = 2; +//} -message Version { - tendermint.version.Consensus consensus = 1 [(gogoproto.nullable) = false]; - string software = 2; -} +//message Version { +// tendermint.version.Consensus consensus = 1 [(gogoproto.nullable) = false]; +// string software = 2; +//} message State { - Version version = 1 [(gogoproto.nullable) = false]; + tendermint.state.Version version = 1 [(gogoproto.nullable) = false]; // immutable string chain_id = 2 [(gogoproto.customname) = "ChainID"]; diff --git a/rpc/core/blocks_test.go b/rpc/core/blocks_test.go index 744498398..49c333513 100644 --- a/rpc/core/blocks_test.go +++ b/rpc/core/blocks_test.go @@ -22,7 +22,7 @@ import ( dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" ctypes "github.com/line/ostracon/rpc/core/types" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" sm "github.com/line/ostracon/state" @@ -82,7 +82,7 @@ func TestBlockchainInfo(t *testing.T) { } func TestBlockResults(t *testing.T) { - results := &tmstate.ABCIResponses{ + results := &ocstate.ABCIResponses{ DeliverTxs: []*abci.ResponseDeliverTx{ {Code: 0, Data: []byte{0x01}, Log: "ok"}, {Code: 0, Data: []byte{0x02}, Log: "ok"}, diff --git a/state/execution.go b/state/execution.go index 4c50cb3d6..09ead4024 100644 --- a/state/execution.go +++ b/state/execution.go @@ -14,7 +14,7 @@ import ( "github.com/line/ostracon/libs/fail" "github.com/line/ostracon/libs/log" mempl "github.com/line/ostracon/mempool" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" canonictime "github.com/line/ostracon/types/time" @@ -342,11 +342,11 @@ func execBlockOnProxyApp( block *types.Block, store Store, initialHeight int64, -) (*tmstate.ABCIResponses, error) { +) (*ocstate.ABCIResponses, error) { var validTxs, invalidTxs = 0, 0 txIndex := 0 - abciResponses := new(tmstate.ABCIResponses) + abciResponses := new(ocstate.ABCIResponses) dtxs := make([]*abci.ResponseDeliverTx, len(block.Txs)) abciResponses.DeliverTxs = dtxs @@ -492,7 +492,7 @@ func updateState( state State, blockID types.BlockID, header *types.Header, - abciResponses *tmstate.ABCIResponses, + abciResponses *ocstate.ABCIResponses, validatorUpdates []*types.Validator, ) (State, error) { @@ -567,7 +567,7 @@ func fireEvents( logger log.Logger, eventBus types.BlockEventPublisher, block *types.Block, - abciResponses *tmstate.ABCIResponses, + abciResponses *ocstate.ABCIResponses, validatorUpdates []*types.Validator, ) { if err := eventBus.PublishEventNewBlock(types.EventDataNewBlock{ diff --git a/state/export_test.go b/state/export_test.go index 23660790d..1de36fcfb 100644 --- a/state/export_test.go +++ b/state/export_test.go @@ -5,7 +5,7 @@ import ( dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/types" ) @@ -28,7 +28,7 @@ func UpdateState( state State, blockID types.BlockID, header *types.Header, - abciResponses *tmstate.ABCIResponses, + abciResponses *ocstate.ABCIResponses, validatorUpdates []*types.Validator, ) (State, error) { return updateState(state, blockID, header, abciResponses, validatorUpdates) diff --git a/state/helpers_test.go b/state/helpers_test.go index 5df9b5632..e2e5d0888 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -12,7 +12,7 @@ import ( "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" tmrand "github.com/line/ostracon/libs/rand" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" @@ -171,10 +171,10 @@ func genValSet(size int) *types.ValidatorSet { func makeHeaderPartsResponsesValPubKeyChange( state sm.State, pubkey crypto.PubKey, -) (types.Header, types.BlockID, *tmstate.ABCIResponses) { +) (types.Header, types.BlockID, *ocstate.ABCIResponses) { block := makeBlock(state, state.LastBlockHeight+1) - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -195,10 +195,10 @@ func makeHeaderPartsResponsesValPubKeyChange( func makeHeaderPartsResponsesValPowerChange( state sm.State, power int64, -) (types.Header, types.BlockID, *tmstate.ABCIResponses) { +) (types.Header, types.BlockID, *ocstate.ABCIResponses) { block := makeBlock(state, state.LastBlockHeight+1) - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -219,10 +219,10 @@ func makeHeaderPartsResponsesValPowerChange( func makeHeaderPartsResponsesParams( state sm.State, params tmproto.ConsensusParams, -) (types.Header, types.BlockID, *tmstate.ABCIResponses) { +) (types.Header, types.BlockID, *ocstate.ABCIResponses) { block := makeBlock(state, state.LastBlockHeight+1) - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ConsensusParamUpdates: types.OC2PB.ConsensusParams(¶ms)}, } diff --git a/state/mocks/store.go b/state/mocks/store.go index 469a7f5f4..cc3282bc8 100644 --- a/state/mocks/store.go +++ b/state/mocks/store.go @@ -6,9 +6,9 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" mock "github.com/stretchr/testify/mock" - ostraconstate "github.com/line/ostracon/proto/ostracon/state" - ostracontypes "github.com/line/ostracon/types" + ocstate "github.com/line/ostracon/proto/ostracon/state" state "github.com/line/ostracon/state" + ostracontypes "github.com/line/ostracon/types" ) // Store is an autogenerated mock type for the Store type @@ -66,15 +66,15 @@ func (_m *Store) Load() (state.State, error) { } // LoadABCIResponses provides a mock function with given fields: _a0 -func (_m *Store) LoadABCIResponses(_a0 int64) (*ostraconstate.ABCIResponses, error) { +func (_m *Store) LoadABCIResponses(_a0 int64) (*ocstate.ABCIResponses, error) { ret := _m.Called(_a0) - var r0 *ostraconstate.ABCIResponses - if rf, ok := ret.Get(0).(func(int64) *ostraconstate.ABCIResponses); ok { + var r0 *ocstate.ABCIResponses + if rf, ok := ret.Get(0).(func(int64) *ocstate.ABCIResponses); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ostraconstate.ABCIResponses) + r0 = ret.Get(0).(*ocstate.ABCIResponses) } } @@ -226,11 +226,11 @@ func (_m *Store) Save(_a0 state.State) error { } // SaveABCIResponses provides a mock function with given fields: _a0, _a1 -func (_m *Store) SaveABCIResponses(_a0 int64, _a1 *ostraconstate.ABCIResponses) error { +func (_m *Store) SaveABCIResponses(_a0 int64, _a1 *ocstate.ABCIResponses) error { ret := _m.Called(_a0, _a1) var r0 error - if rf, ok := ret.Get(0).(func(int64, *ostraconstate.ABCIResponses) error); ok { + if rf, ok := ret.Get(0).(func(int64, *ocstate.ABCIResponses) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) diff --git a/state/rollback.go b/state/rollback.go index 5016183a8..c66507d75 100644 --- a/state/rollback.go +++ b/state/rollback.go @@ -4,9 +4,9 @@ import ( "errors" "fmt" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/version" ) diff --git a/state/rollback_test.go b/state/rollback_test.go index a6fec691b..ebbcbf4a0 100644 --- a/state/rollback_test.go +++ b/state/rollback_test.go @@ -5,12 +5,12 @@ import ( "testing" "github.com/stretchr/testify/require" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/tmhash" - tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/state" "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/types" diff --git a/state/state.go b/state/state.go index a7a116f5e..fc51cfcc1 100644 --- a/state/state.go +++ b/state/state.go @@ -7,11 +7,12 @@ import ( "os" "time" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/crypto" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" "github.com/line/ostracon/version" @@ -141,12 +142,12 @@ func (state State) IsEmpty() bool { } // ToProto takes the local state type and returns the equivalent proto type -func (state *State) ToProto() (*tmstate.State, error) { +func (state *State) ToProto() (*ocstate.State, error) { if state == nil { return nil, errors.New("state is nil") } - sm := new(tmstate.State) + sm := new(ocstate.State) sm.Version = state.Version sm.ChainID = state.ChainID @@ -187,7 +188,7 @@ func (state *State) ToProto() (*tmstate.State, error) { } // FromProto takes a state proto message & returns the local state type -func FromProto(pb *tmstate.State) (*State, error) { //nolint:golint +func FromProto(pb *ocstate.State) (*State, error) { //nolint:golint if pb == nil { return nil, errors.New("nil State") } diff --git a/state/state_test.go b/state/state_test.go index c2c69a94e..6397eb517 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -21,7 +21,7 @@ import ( "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" tmrand "github.com/line/ostracon/libs/rand" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" @@ -106,7 +106,7 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { // Build mock responses. block := makeBlock(state, 2) - abciResponses := new(tmstate.ABCIResponses) + abciResponses := new(ocstate.ABCIResponses) dtxs := make([]*abci.ResponseDeliverTx, 2) abciResponses.DeliverTxs = dtxs @@ -188,7 +188,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { // Add all cases. for i, tc := range cases { h := int64(i + 1) // last block height, one below what we save - responses := &tmstate.ABCIResponses{ + responses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.added, EndBlock: &abci.ResponseEndBlock{}, @@ -203,7 +203,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { res, err := stateStore.LoadABCIResponses(h) if assert.NoError(err, "%d", i) { t.Log(res) - responses := &tmstate.ABCIResponses{ + responses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.expected, EndBlock: &abci.ResponseEndBlock{}, @@ -490,7 +490,7 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { block := makeBlock(state, state.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -607,7 +607,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { block := makeBlock(state, state.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} // no updates: - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -710,7 +710,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { // no changes in voting power and both validators have same voting power // -> proposers should alternate: oldState := updatedState3 - abciResponses = &tmstate.ABCIResponses{ + abciResponses = &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -726,7 +726,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { for i := 0; i < 1000; i++ { // no validator updates: - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -785,7 +785,7 @@ func TestLargeGenesisValidator(t *testing.T) { oldState := state for i := 0; i < 10; i++ { // no updates: - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -818,7 +818,7 @@ func TestLargeGenesisValidator(t *testing.T) { firstAddedVal := abci.ValidatorUpdate{PubKey: fvp, Power: firstAddedValVotingPower} validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{firstAddedVal}) assert.NoError(t, err) - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{firstAddedVal}}, } @@ -830,7 +830,7 @@ func TestLargeGenesisValidator(t *testing.T) { lastState := updatedState for i := 0; i < 200; i++ { // no updates: - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -866,7 +866,7 @@ func TestLargeGenesisValidator(t *testing.T) { validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{addedVal}) assert.NoError(t, err) - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{addedVal}}, } @@ -881,7 +881,7 @@ func TestLargeGenesisValidator(t *testing.T) { gp, err := cryptoenc.PubKeyToProto(genesisPubKey) require.NoError(t, err) removeGenesisVal := abci.ValidatorUpdate{PubKey: gp, Power: 0} - abciResponses = &tmstate.ABCIResponses{ + abciResponses = &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{removeGenesisVal}}, } @@ -900,7 +900,7 @@ func TestLargeGenesisValidator(t *testing.T) { count := 0 isProposerUnchanged := true for isProposerUnchanged { - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -925,7 +925,7 @@ func TestLargeGenesisValidator(t *testing.T) { proposers := make([]*types.Validator, numVals) for i := 0; i < 100; i++ { // no updates: - abciResponses := &tmstate.ABCIResponses{ + abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } diff --git a/state/store.go b/state/store.go index 521f5a5dc..56bc40e54 100644 --- a/state/store.go +++ b/state/store.go @@ -5,13 +5,14 @@ import ( "fmt" "github.com/gogo/protobuf/proto" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" tmmath "github.com/line/ostracon/libs/math" tmos "github.com/line/ostracon/libs/os" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/types" ) @@ -63,13 +64,13 @@ type Store interface { // LoadProofHash loads the proof hash at a given height LoadProofHash(int64) ([]byte, error) // LoadABCIResponses loads the abciResponse for a given height - LoadABCIResponses(int64) (*tmstate.ABCIResponses, error) + LoadABCIResponses(int64) (*ocstate.ABCIResponses, error) // LoadConsensusParams loads the consensus params for a given height LoadConsensusParams(int64) (tmproto.ConsensusParams, error) // Save overwrites the previous state with the updated one Save(State) error // SaveABCIResponses saves ABCIResponses for a given height - SaveABCIResponses(int64, *tmstate.ABCIResponses) error + SaveABCIResponses(int64, *ocstate.ABCIResponses) error // Bootstrap is used for bootstrapping state when not starting from a initial height. Bootstrap(State) error // PruneStates takes the height from which to start prning and which height stop at @@ -141,7 +142,7 @@ func (store dbStore) loadState(key []byte) (state State, err error) { return state, nil } - sp := new(tmstate.State) + sp := new(ocstate.State) err = proto.Unmarshal(buf, sp) if err != nil { @@ -366,7 +367,7 @@ func (store dbStore) PruneStates(from int64, to int64) error { // ResponseDeliverTx responses (see ABCIResults.Hash) // // See merkle.SimpleHashFromByteSlices -func ABCIResponsesResultsHash(ar *tmstate.ABCIResponses) []byte { +func ABCIResponsesResultsHash(ar *ocstate.ABCIResponses) []byte { return types.NewResults(ar.DeliverTxs).Hash() } @@ -376,7 +377,7 @@ func ABCIResponsesResultsHash(ar *tmstate.ABCIResponses) []byte { // This is useful for recovering from crashes where we called app.Commit and // before we called s.Save(). It can also be used to produce Merkle proofs of // the result of txs. -func (store dbStore) LoadABCIResponses(height int64) (*tmstate.ABCIResponses, error) { +func (store dbStore) LoadABCIResponses(height int64) (*ocstate.ABCIResponses, error) { buf, err := store.db.Get(calcABCIResponsesKey(height)) if err != nil { return nil, err @@ -386,7 +387,7 @@ func (store dbStore) LoadABCIResponses(height int64) (*tmstate.ABCIResponses, er return nil, ErrNoABCIResponsesForHeight{height} } - abciResponses := new(tmstate.ABCIResponses) + abciResponses := new(ocstate.ABCIResponses) err = abciResponses.Unmarshal(buf) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED @@ -404,7 +405,7 @@ func (store dbStore) LoadABCIResponses(height int64) (*tmstate.ABCIResponses, er // Merkle proofs. // // Exposed for testing. -func (store dbStore) SaveABCIResponses(height int64, abciResponses *tmstate.ABCIResponses) error { +func (store dbStore) SaveABCIResponses(height int64, abciResponses *ocstate.ABCIResponses) error { var dtxs []*abci.ResponseDeliverTx // strip nil values, for _, tx := range abciResponses.DeliverTxs { @@ -492,7 +493,7 @@ func lastStoredHeightFor(height, lastHeightChanged int64) int64 { } // CONTRACT: Returned ValidatorsInfo can be mutated. -func loadValidatorsInfo(db dbm.DB, height int64) (*tmstate.ValidatorsInfo, error) { +func loadValidatorsInfo(db dbm.DB, height int64) (*ocstate.ValidatorsInfo, error) { buf, err := db.Get(calcValidatorsKey(height)) if err != nil { return nil, err @@ -502,7 +503,7 @@ func loadValidatorsInfo(db dbm.DB, height int64) (*tmstate.ValidatorsInfo, error return nil, errors.New("loadValidatorsInfo: value retrieved from db is empty") } - v := new(tmstate.ValidatorsInfo) + v := new(ocstate.ValidatorsInfo) err = v.Unmarshal(buf) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED @@ -523,7 +524,7 @@ func (store dbStore) saveValidatorsInfo(height, lastHeightChanged int64, valSet if lastHeightChanged > height { return errors.New("lastHeightChanged cannot be greater than ValidatorsInfo height") } - valInfo := &tmstate.ValidatorsInfo{ + valInfo := &ocstate.ValidatorsInfo{ LastHeightChanged: lastHeightChanged, } // Only persist validator set if it was updated or checkpoint height (see diff --git a/state/store_test.go b/state/store_test.go index a132ac9d0..2df61a5fb 100644 --- a/state/store_test.go +++ b/state/store_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -17,7 +18,7 @@ import ( "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" tmrand "github.com/line/ostracon/libs/rand" - tmstate "github.com/line/ostracon/proto/ostracon/state" + ocstate "github.com/line/ostracon/proto/ostracon/state" sm "github.com/line/ostracon/state" statemocks "github.com/line/ostracon/state/mocks" "github.com/line/ostracon/types" @@ -177,7 +178,7 @@ func TestPruneStates(t *testing.T) { require.NoError(t, err) currentHeight := state.LastBlockHeight + int64(1) - err = stateStore.SaveABCIResponses(currentHeight, &tmstate.ABCIResponses{ + err = stateStore.SaveABCIResponses(currentHeight, &ocstate.ABCIResponses{ DeliverTxs: []*abci.ResponseDeliverTx{ {Data: []byte{1}}, {Data: []byte{2}}, @@ -287,7 +288,7 @@ func TestPruneStatesDeleteErrHandle(t *testing.T) { } func TestABCIResponsesResultsHash(t *testing.T) { - responses := &tmstate.ABCIResponses{ + responses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: []*abci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, @@ -317,7 +318,7 @@ func sliceToMap(s []int64) map[int64]bool { } func validatorsInfoToByte(height, lastHeightChanged int64, valSet *types.ValidatorSet) ([]byte, error) { - valInfo := &tmstate.ValidatorsInfo{ + valInfo := &ocstate.ValidatorsInfo{ LastHeightChanged: lastHeightChanged, } if height == lastHeightChanged || height%valSetCheckpointInterval == 0 { diff --git a/statesync/reactor_test.go b/statesync/reactor_test.go index 743a0fd73..db835e4f4 100644 --- a/statesync/reactor_test.go +++ b/statesync/reactor_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" @@ -16,7 +17,6 @@ import ( "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" p2pmocks "github.com/line/ostracon/p2p/mocks" - tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" proxymocks "github.com/line/ostracon/proxy/mocks" sm "github.com/line/ostracon/state" diff --git a/statesync/stateprovider.go b/statesync/stateprovider.go index c76f00a93..74607eb97 100644 --- a/statesync/stateprovider.go +++ b/statesync/stateprovider.go @@ -6,6 +6,7 @@ import ( "strings" "time" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/crypto/vrf" @@ -16,7 +17,6 @@ import ( lighthttp "github.com/line/ostracon/light/provider/http" lightrpc "github.com/line/ostracon/light/rpc" lightdb "github.com/line/ostracon/light/store/db" - tmstate "github.com/line/ostracon/proto/ostracon/state" rpchttp "github.com/line/ostracon/rpc/client/http" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" diff --git a/statesync/stateprovider_test.go b/statesync/stateprovider_test.go index 7d470cd4e..6cfb78c00 100644 --- a/statesync/stateprovider_test.go +++ b/statesync/stateprovider_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" @@ -19,7 +20,6 @@ import ( "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/light" - "github.com/line/ostracon/proto/ostracon/state" ctypes "github.com/line/ostracon/rpc/core/types" rpcserver "github.com/line/ostracon/rpc/jsonrpc/server" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" @@ -38,7 +38,7 @@ func TestNewLightClientStateProvider(t *testing.T) { type args struct { ctx context.Context chainID string - version state.Version + version tmstate.Version initialHeight int64 servers []string trustOptions light.TrustOptions diff --git a/statesync/syncer_test.go b/statesync/syncer_test.go index 71dece7b7..7983b7fc1 100644 --- a/statesync/syncer_test.go +++ b/statesync/syncer_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" @@ -21,7 +22,6 @@ import ( tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" p2pmocks "github.com/line/ostracon/p2p/mocks" - tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" proxymocks "github.com/line/ostracon/proxy/mocks" sm "github.com/line/ostracon/state" diff --git a/third_party/proto/tendermint/abci/types.proto b/third_party/proto/tendermint/abci/types.proto new file mode 100644 index 000000000..8e3a90936 --- /dev/null +++ b/third_party/proto/tendermint/abci/types.proto @@ -0,0 +1,407 @@ +syntax = "proto3"; +package tendermint.abci; + +option go_package = "github.com/tendermint/tendermint/abci/types"; + +// For more information on gogo.proto, see: +// https://github.com/gogo/protobuf/blob/master/extensions.md +import "tendermint/crypto/proof.proto"; +import "tendermint/types/types.proto"; +import "tendermint/crypto/keys.proto"; +import "tendermint/types/params.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +// This file is copied from http://github.com/tendermint/abci +// NOTE: When using custom types, mind the warnings. +// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues + +//---------------------------------------- +// Request types + +message Request { + oneof value { + RequestEcho echo = 1; + RequestFlush flush = 2; + RequestInfo info = 3; + RequestSetOption set_option = 4; + RequestInitChain init_chain = 5; + RequestQuery query = 6; + RequestBeginBlock begin_block = 7; + RequestCheckTx check_tx = 8; + RequestDeliverTx deliver_tx = 9; + RequestEndBlock end_block = 10; + RequestCommit commit = 11; + RequestListSnapshots list_snapshots = 12; + RequestOfferSnapshot offer_snapshot = 13; + RequestLoadSnapshotChunk load_snapshot_chunk = 14; + RequestApplySnapshotChunk apply_snapshot_chunk = 15; + } +} + +message RequestEcho { + string message = 1; +} + +message RequestFlush {} + +message RequestInfo { + string version = 1; + uint64 block_version = 2; + uint64 p2p_version = 3; +} + +// nondeterministic +message RequestSetOption { + string key = 1; + string value = 2; +} + +message RequestInitChain { + google.protobuf.Timestamp time = 1 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2; + ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; +} + +message RequestQuery { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +message RequestBeginBlock { + bytes hash = 1; + tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; + LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; +} + +enum CheckTxType { + NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; + RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; +} + +message RequestCheckTx { + bytes tx = 1; + CheckTxType type = 2; +} + +message RequestDeliverTx { + bytes tx = 1; +} + +message RequestEndBlock { + int64 height = 1; +} + +message RequestCommit {} + +// lists available snapshots +message RequestListSnapshots { +} + +// offers a snapshot to the application +message RequestOfferSnapshot { + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height +} + +// loads a snapshot chunk +message RequestLoadSnapshotChunk { + uint64 height = 1; + uint32 format = 2; + uint32 chunk = 3; +} + +// Applies a snapshot chunk +message RequestApplySnapshotChunk { + uint32 index = 1; + bytes chunk = 2; + string sender = 3; +} + +//---------------------------------------- +// Response types + +message Response { + oneof value { + ResponseException exception = 1; + ResponseEcho echo = 2; + ResponseFlush flush = 3; + ResponseInfo info = 4; + ResponseSetOption set_option = 5; + ResponseInitChain init_chain = 6; + ResponseQuery query = 7; + ResponseBeginBlock begin_block = 8; + ResponseCheckTx check_tx = 9; + ResponseDeliverTx deliver_tx = 10; + ResponseEndBlock end_block = 11; + ResponseCommit commit = 12; + ResponseListSnapshots list_snapshots = 13; + ResponseOfferSnapshot offer_snapshot = 14; + ResponseLoadSnapshotChunk load_snapshot_chunk = 15; + ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + } +} + +// nondeterministic +message ResponseException { + string error = 1; +} + +message ResponseEcho { + string message = 1; +} + +message ResponseFlush {} + +message ResponseInfo { + string data = 1; + + string version = 2; + uint64 app_version = 3; + + int64 last_block_height = 4; + bytes last_block_app_hash = 5; +} + +// nondeterministic +message ResponseSetOption { + uint32 code = 1; + // bytes data = 2; + string log = 3; + string info = 4; +} + +message ResponseInitChain { + ConsensusParams consensus_params = 1; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + bytes app_hash = 3; +} + +message ResponseQuery { + uint32 code = 1; + // bytes data = 2; // use "value" instead. + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + tendermint.crypto.ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +message ResponseBeginBlock { + repeated Event events = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCheckTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; +} + +message ResponseDeliverTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic + string codespace = 8; +} + +message ResponseEndBlock { + repeated ValidatorUpdate validator_updates = 1 + [(gogoproto.nullable) = false]; + ConsensusParams consensus_param_updates = 2; + repeated Event events = 3 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCommit { + // reserve 1 + bytes data = 2; + int64 retain_height = 3; +} + +message ResponseListSnapshots { + repeated Snapshot snapshots = 1; +} + +message ResponseOfferSnapshot { + Result result = 1; + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + } +} + +message ResponseLoadSnapshotChunk { + bytes chunk = 1; +} + +message ResponseApplySnapshotChunk { + Result result = 1; + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + } +} + +//---------------------------------------- +// Misc. + +// ConsensusParams contains all consensus-relevant parameters +// that can be adjusted by the abci app +message ConsensusParams { + BlockParams block = 1; + tendermint.types.EvidenceParams evidence = 2; + tendermint.types.ValidatorParams validator = 3; + tendermint.types.VersionParams version = 4; +} + +// BlockParams contains limits on the block size. +message BlockParams { + // Note: must be greater than 0 + int64 max_bytes = 1; + // Note: must be greater or equal to -1 + int64 max_gas = 2; +} + +message LastCommitInfo { + int32 round = 1; + repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; +} + +// Event allows application developers to attach additional information to +// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. +// Later, transactions may be queried using these events. +message Event { + string type = 1; + repeated EventAttribute attributes = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "attributes,omitempty" + ]; +} + +// EventAttribute is a single key-value pair, associated with an event. +message EventAttribute { + bytes key = 1; + bytes value = 2; + bool index = 3; // nondeterministic +} + +// TxResult contains results of executing the transaction. +// +// One usage is indexing transaction results. +message TxResult { + int64 height = 1; + uint32 index = 2; + bytes tx = 3; + ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; +} + +//---------------------------------------- +// Blockchain Types + +// Validator +message Validator { + bytes address = 1; // The first 20 bytes of SHA256(public key) + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; + int64 power = 3; // The voting power +} + +// ValidatorUpdate +message ValidatorUpdate { + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + int64 power = 2; +} + +// VoteInfo +message VoteInfo { + Validator validator = 1 [(gogoproto.nullable) = false]; + bool signed_last_block = 2; +} + +enum EvidenceType { + UNKNOWN = 0; + DUPLICATE_VOTE = 1; + LIGHT_CLIENT_ATTACK = 2; +} + +message Evidence { + EvidenceType type = 1; + // The offending validator + Validator validator = 2 [(gogoproto.nullable) = false]; + // The height when the offense occurred + int64 height = 3; + // The corresponding time where the offense occurred + google.protobuf.Timestamp time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + // Total voting power of the validator set in case the ABCI application does + // not store historical validators. + // https://github.com/tendermint/tendermint/issues/4581 + int64 total_voting_power = 5; +} + +//---------------------------------------- +// State Sync Types + +message Snapshot { + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata +} + +//---------------------------------------- +// Service Definition + +service ABCIApplication { + rpc Echo(RequestEcho) returns (ResponseEcho); + rpc Flush(RequestFlush) returns (ResponseFlush); + rpc Info(RequestInfo) returns (ResponseInfo); + rpc SetOption(RequestSetOption) returns (ResponseSetOption); + rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); + rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); + rpc Query(RequestQuery) returns (ResponseQuery); + rpc Commit(RequestCommit) returns (ResponseCommit); + rpc InitChain(RequestInitChain) returns (ResponseInitChain); + rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); + rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); + rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); + rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); +} diff --git a/third_party/proto/tendermint/state/types.proto b/third_party/proto/tendermint/state/types.proto new file mode 100644 index 000000000..919da91e5 --- /dev/null +++ b/third_party/proto/tendermint/state/types.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; +package tendermint.state; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/state"; + +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/validator.proto"; +import "tendermint/types/params.proto"; +import "tendermint/version/types.proto"; +import "google/protobuf/timestamp.proto"; + +// ABCIResponses retains the responses +// of the various ABCI calls during block processing. +// It is persisted to disk for each height before calling Commit. +message ABCIResponses { + repeated tendermint.abci.ResponseDeliverTx deliver_txs = 1; + tendermint.abci.ResponseEndBlock end_block = 2; + tendermint.abci.ResponseBeginBlock begin_block = 3; +} + +// ValidatorsInfo represents the latest validator set, or the last height it changed +message ValidatorsInfo { + tendermint.types.ValidatorSet validator_set = 1; + int64 last_height_changed = 2; +} + +// ConsensusParamsInfo represents the latest consensus params, or the last height it changed +message ConsensusParamsInfo { + tendermint.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false]; + int64 last_height_changed = 2; +} + +message Version { + tendermint.version.Consensus consensus = 1 [(gogoproto.nullable) = false]; + string software = 2; +} + +message State { + Version version = 1 [(gogoproto.nullable) = false]; + + // immutable + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 initial_height = 14; + + // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) + int64 last_block_height = 3; + tendermint.types.BlockID last_block_id = 4 + [(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"]; + google.protobuf.Timestamp last_block_time = 5 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // LastValidators is used to validate block.LastCommit. + // Validators are persisted to the database separately every time they change, + // so we can query for historical validator sets. + // Note that if s.LastBlockHeight causes a valset change, + // we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1 + // Extra +1 due to nextValSet delay. + tendermint.types.ValidatorSet next_validators = 6; + tendermint.types.ValidatorSet validators = 7; + tendermint.types.ValidatorSet last_validators = 8; + int64 last_height_validators_changed = 9; + + // Consensus parameters used for validating blocks. + // Changes returned by EndBlock and updated after Commit. + tendermint.types.ConsensusParams consensus_params = 10 [(gogoproto.nullable) = false]; + int64 last_height_consensus_params_changed = 11; + + // Merkle root of the results from executing prev block + bytes last_results_hash = 12; + + // the latest AppHash we've received from calling abci.Commit() + bytes app_hash = 13; +} From 86c84be9184bcf64f71cade108b0c27b4f10af34 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 7 Jan 2023 02:07:01 +0900 Subject: [PATCH 09/25] feat: clean up `proto/ostracon/blockchain` proto directory --- blockchain/msgs.go | 17 +- blockchain/msgs_test.go | 24 +- blockchain/v0/reactor.go | 22 +- blockchain/v1/reactor.go | 24 +- blockchain/v2/io.go | 10 +- blockchain/v2/reactor.go | 10 +- blockchain/v2/reactor_test.go | 15 +- consensus/msgs.go | 2 +- consensus/msgs_test.go | 2 +- consensus/reactor.go | 2 +- consensus/wal.go | 3 +- proto/ostracon/blockchain/types.pb.go | 695 +--- proto/ostracon/blockchain/types.proto | 33 +- proto/ostracon/consensus/types.pb.go | 3425 ----------------- proto/ostracon/consensus/types.proto | 92 - proto/ostracon/consensus/wal.pb.go | 1541 -------- proto/ostracon/consensus/wal.proto | 46 - .../proto/tendermint/blockchain/types.proto | 41 + 18 files changed, 167 insertions(+), 5837 deletions(-) delete mode 100644 proto/ostracon/consensus/types.pb.go delete mode 100644 proto/ostracon/consensus/types.proto delete mode 100644 proto/ostracon/consensus/wal.pb.go delete mode 100644 proto/ostracon/consensus/wal.proto create mode 100644 third_party/proto/tendermint/blockchain/types.proto diff --git a/blockchain/msgs.go b/blockchain/msgs.go index 3b2a7e099..208f90bb3 100644 --- a/blockchain/msgs.go +++ b/blockchain/msgs.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/gogo/protobuf/proto" + tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" bcproto "github.com/line/ostracon/proto/ostracon/blockchain" "github.com/line/ostracon/types" @@ -24,15 +25,15 @@ func EncodeMsg(pb proto.Message) ([]byte, error) { msg := bcproto.Message{} switch pb := pb.(type) { - case *bcproto.BlockRequest: + case *tmbcproto.BlockRequest: msg.Sum = &bcproto.Message_BlockRequest{BlockRequest: pb} case *bcproto.BlockResponse: msg.Sum = &bcproto.Message_BlockResponse{BlockResponse: pb} - case *bcproto.NoBlockResponse: + case *tmbcproto.NoBlockResponse: msg.Sum = &bcproto.Message_NoBlockResponse{NoBlockResponse: pb} - case *bcproto.StatusRequest: + case *tmbcproto.StatusRequest: msg.Sum = &bcproto.Message_StatusRequest{StatusRequest: pb} - case *bcproto.StatusResponse: + case *tmbcproto.StatusResponse: msg.Sum = &bcproto.Message_StatusResponse{StatusResponse: pb} default: return nil, fmt.Errorf("unknown message type %T", pb) @@ -78,7 +79,7 @@ func ValidateMsg(pb proto.Message) error { } switch msg := pb.(type) { - case *bcproto.BlockRequest: + case *tmbcproto.BlockRequest: if msg.Height < 0 { return errors.New("negative Height") } @@ -87,11 +88,11 @@ func ValidateMsg(pb proto.Message) error { if err != nil { return err } - case *bcproto.NoBlockResponse: + case *tmbcproto.NoBlockResponse: if msg.Height < 0 { return errors.New("negative Height") } - case *bcproto.StatusResponse: + case *tmbcproto.StatusResponse: if msg.Base < 0 { return errors.New("negative Base") } @@ -101,7 +102,7 @@ func ValidateMsg(pb proto.Message) error { if msg.Base > msg.Height { return fmt.Errorf("base %v cannot be greater than height %v", msg.Base, msg.Height) } - case *bcproto.StatusRequest: + case *tmbcproto.StatusRequest: return nil default: return fmt.Errorf("unknown message type %T", msg) diff --git a/blockchain/msgs_test.go b/blockchain/msgs_test.go index d10f15a48..b392713d6 100644 --- a/blockchain/msgs_test.go +++ b/blockchain/msgs_test.go @@ -9,6 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bcproto "github.com/line/ostracon/proto/ostracon/blockchain" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" @@ -28,7 +30,7 @@ func TestBcBlockRequestMessageValidateBasic(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.testName, func(t *testing.T) { - request := bcproto.BlockRequest{Height: tc.requestHeight} + request := tmbcproto.BlockRequest{Height: tc.requestHeight} assert.Equal(t, tc.expectErr, ValidateMsg(&request) != nil, "Validate Basic had an unexpected result") }) } @@ -48,14 +50,14 @@ func TestBcNoBlockResponseMessageValidateBasic(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.testName, func(t *testing.T) { - nonResponse := bcproto.NoBlockResponse{Height: tc.nonResponseHeight} + nonResponse := tmbcproto.NoBlockResponse{Height: tc.nonResponseHeight} assert.Equal(t, tc.expectErr, ValidateMsg(&nonResponse) != nil, "Validate Basic had an unexpected result") }) } } func TestBcStatusRequestMessageValidateBasic(t *testing.T) { - request := bcproto.StatusRequest{} + request := tmbcproto.StatusRequest{} assert.NoError(t, ValidateMsg(&request)) } @@ -73,7 +75,7 @@ func TestBcStatusResponseMessageValidateBasic(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.testName, func(t *testing.T) { - response := bcproto.StatusResponse{Height: tc.responseHeight} + response := tmbcproto.StatusResponse{Height: tc.responseHeight} assert.Equal(t, tc.expectErr, ValidateMsg(&response) != nil, "Validate Basic had an unexpected result") }) } @@ -94,25 +96,25 @@ func TestBlockchainMessageVectors(t *testing.T) { expBytes string }{ {"BlockRequestMessage", &bcproto.Message{Sum: &bcproto.Message_BlockRequest{ - BlockRequest: &bcproto.BlockRequest{Height: 1}}}, "0a020801"}, + BlockRequest: &tmbcproto.BlockRequest{Height: 1}}}, "0a020801"}, {"BlockRequestMessage", &bcproto.Message{Sum: &bcproto.Message_BlockRequest{ - BlockRequest: &bcproto.BlockRequest{Height: math.MaxInt64}}}, + BlockRequest: &tmbcproto.BlockRequest{Height: math.MaxInt64}}}, "0a0a08ffffffffffffffff7f"}, {"BlockResponseMessage", &bcproto.Message{Sum: &bcproto.Message_BlockResponse{ BlockResponse: &bcproto.BlockResponse{Block: bpb}}}, "1a720a700a5d0a04080b100b1803220b088092b8c398feffffff012a0212003a20c4da88e876062aa1543400d50d0eaa0dac88096057949cfb7bca7f3a48c04bf96a20e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855120d0a0b48656c6c6f20576f726c641a00"}, {"NoBlockResponseMessage", &bcproto.Message{Sum: &bcproto.Message_NoBlockResponse{ - NoBlockResponse: &bcproto.NoBlockResponse{Height: 1}}}, "12020801"}, + NoBlockResponse: &tmbcproto.NoBlockResponse{Height: 1}}}, "12020801"}, {"NoBlockResponseMessage", &bcproto.Message{Sum: &bcproto.Message_NoBlockResponse{ - NoBlockResponse: &bcproto.NoBlockResponse{Height: math.MaxInt64}}}, + NoBlockResponse: &tmbcproto.NoBlockResponse{Height: math.MaxInt64}}}, "120a08ffffffffffffffff7f"}, {"StatusRequestMessage", &bcproto.Message{Sum: &bcproto.Message_StatusRequest{ - StatusRequest: &bcproto.StatusRequest{}}}, + StatusRequest: &tmbcproto.StatusRequest{}}}, "2200"}, {"StatusResponseMessage", &bcproto.Message{Sum: &bcproto.Message_StatusResponse{ - StatusResponse: &bcproto.StatusResponse{Height: 1, Base: 2}}}, + StatusResponse: &tmbcproto.StatusResponse{Height: 1, Base: 2}}}, "2a0408011002"}, {"StatusResponseMessage", &bcproto.Message{Sum: &bcproto.Message_StatusResponse{ - StatusResponse: &bcproto.StatusResponse{Height: math.MaxInt64, Base: math.MaxInt64}}}, + StatusResponse: &tmbcproto.StatusResponse{Height: math.MaxInt64, Base: math.MaxInt64}}}, "2a1408ffffffffffffffff7f10ffffffffffffffff7f"}, } diff --git a/blockchain/v0/reactor.go b/blockchain/v0/reactor.go index 8ec839ff1..c63e82a5f 100644 --- a/blockchain/v0/reactor.go +++ b/blockchain/v0/reactor.go @@ -5,6 +5,8 @@ import ( "reflect" "time" + tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" @@ -156,7 +158,7 @@ func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor { // AddPeer implements Reactor by sending our state to peer. func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) { - msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ + msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ Base: bcR.store.Base(), Height: bcR.store.Height()}) if err != nil { @@ -178,7 +180,7 @@ func (bcR *BlockchainReactor) RemovePeer(peer p2p.Peer, reason interface{}) { // respondToPeer loads a block and sends it to the requesting peer, // if we have it. Otherwise, we'll respond saying we don't have it. -func (bcR *BlockchainReactor) respondToPeer(msg *bcproto.BlockRequest, +func (bcR *BlockchainReactor) respondToPeer(msg *tmbcproto.BlockRequest, src p2p.Peer) (queued bool) { block := bcR.store.LoadBlock(msg.Height) @@ -200,7 +202,7 @@ func (bcR *BlockchainReactor) respondToPeer(msg *bcproto.BlockRequest, bcR.Logger.Info("Peer asking for a block we don't have", "src", src, "height", msg.Height) - msgBytes, err := bc.EncodeMsg(&bcproto.NoBlockResponse{Height: msg.Height}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.NoBlockResponse{Height: msg.Height}) if err != nil { bcR.Logger.Error("could not convert msg to protobuf", "err", err) return false @@ -227,7 +229,7 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) bcR.Logger.Debug("Receive", "src", src, "chID", chID, "msg", msg) switch msg := msg.(type) { - case *bcproto.BlockRequest: + case *tmbcproto.BlockRequest: bcR.respondToPeer(msg, src) case *bcproto.BlockResponse: bi, err := types.BlockFromProto(msg.Block) @@ -236,9 +238,9 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) return } bcR.pool.AddBlock(src.ID(), bi, len(msgBytes)) - case *bcproto.StatusRequest: + case *tmbcproto.StatusRequest: // Send peer our state. - msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ + msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ Height: bcR.store.Height(), Base: bcR.store.Base(), }) @@ -247,10 +249,10 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) return } src.TrySend(BlockchainChannel, msgBytes) - case *bcproto.StatusResponse: + case *tmbcproto.StatusResponse: // Got a peer status. Unverified. bcR.pool.SetPeerRange(src.ID(), msg.Base, msg.Height) - case *bcproto.NoBlockResponse: + case *tmbcproto.NoBlockResponse: bcR.Logger.Debug("Peer does not have requested block", "peer", src, "height", msg.Height) default: bcR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) @@ -292,7 +294,7 @@ func (bcR *BlockchainReactor) poolRoutine(stateSynced bool) { if peer == nil { continue } - msgBytes, err := bc.EncodeMsg(&bcproto.BlockRequest{Height: request.Height}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.BlockRequest{Height: request.Height}) if err != nil { bcR.Logger.Error("could not convert msg to proto", "err", err) continue @@ -431,7 +433,7 @@ FOR_LOOP: // BroadcastStatusRequest broadcasts `BlockStore` base and height. func (bcR *BlockchainReactor) BroadcastStatusRequest() error { - bm, err := bc.EncodeMsg(&bcproto.StatusRequest{}) + bm, err := bc.EncodeMsg(&tmbcproto.StatusRequest{}) if err != nil { bcR.Logger.Error("could not convert msg to proto", "err", err) return fmt.Errorf("could not convert msg to proto: %w", err) diff --git a/blockchain/v1/reactor.go b/blockchain/v1/reactor.go index 6ee8e252c..dce6a45cc 100644 --- a/blockchain/v1/reactor.go +++ b/blockchain/v1/reactor.go @@ -5,6 +5,8 @@ import ( "reflect" "time" + tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + "github.com/line/ostracon/behaviour" bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/libs/log" @@ -185,7 +187,7 @@ func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor { // AddPeer implements Reactor by sending our state to peer. func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) { - msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ + msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ Base: bcR.store.Base(), Height: bcR.store.Height(), }) @@ -203,7 +205,7 @@ func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) { // sendBlockToPeer loads a block and sends it to the requesting peer. // If the block doesn't exist a bcNoBlockResponseMessage is sent. // If all nodes are honest, no node should be requesting for a block that doesn't exist. -func (bcR *BlockchainReactor) sendBlockToPeer(msg *bcproto.BlockRequest, +func (bcR *BlockchainReactor) sendBlockToPeer(msg *tmbcproto.BlockRequest, src p2p.Peer) (queued bool) { block := bcR.store.LoadBlock(msg.Height) @@ -223,7 +225,7 @@ func (bcR *BlockchainReactor) sendBlockToPeer(msg *bcproto.BlockRequest, bcR.Logger.Info("peer asking for a block we don't have", "src", src, "height", msg.Height) - msgBytes, err := bc.EncodeMsg(&bcproto.NoBlockResponse{Height: msg.Height}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.NoBlockResponse{Height: msg.Height}) if err != nil { bcR.Logger.Error("unable to marshal msg", "err", err) return false @@ -231,8 +233,8 @@ func (bcR *BlockchainReactor) sendBlockToPeer(msg *bcproto.BlockRequest, return src.TrySend(BlockchainChannel, msgBytes) } -func (bcR *BlockchainReactor) sendStatusResponseToPeer(msg *bcproto.StatusRequest, src p2p.Peer) (queued bool) { - msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ +func (bcR *BlockchainReactor) sendStatusResponseToPeer(msg *tmbcproto.StatusRequest, src p2p.Peer) (queued bool) { + msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ Base: bcR.store.Base(), Height: bcR.store.Height(), }) @@ -274,13 +276,13 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) bcR.Logger.Debug("Receive", "src", src, "chID", chID, "msg", msg) switch msg := msg.(type) { - case *bcproto.BlockRequest: + case *tmbcproto.BlockRequest: if queued := bcR.sendBlockToPeer(msg, src); !queued { // Unfortunately not queued since the queue is full. bcR.Logger.Error("Could not send block message to peer", "src", src, "height", msg.Height) } - case *bcproto.StatusRequest: + case *tmbcproto.StatusRequest: // Send peer our state. if queued := bcR.sendStatusResponseToPeer(msg, src); !queued { // Unfortunately not queued since the queue is full. @@ -304,7 +306,7 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) } bcR.Logger.Info("Received", "src", src, "height", bi.Height) bcR.messagesForFSMCh <- msgForFSM - case *bcproto.NoBlockResponse: + case *tmbcproto.NoBlockResponse: msgForFSM := bcReactorMessage{ event: noBlockResponseEv, data: bReactorEventData{ @@ -315,7 +317,7 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) bcR.Logger.Debug("Peer does not have requested block", "peer", src, "height", msg.Height) bcR.messagesForFSMCh <- msgForFSM - case *bcproto.StatusResponse: + case *tmbcproto.StatusResponse: // Got a peer status. Unverified. msgForFSM := bcReactorMessage{ event: statusResponseEv, @@ -499,7 +501,7 @@ func (bcR *BlockchainReactor) processBlock() error { // Implements bcRNotifier // sendStatusRequest broadcasts `BlockStore` height. func (bcR *BlockchainReactor) sendStatusRequest() { - msgBytes, err := bc.EncodeMsg(&bcproto.StatusRequest{}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusRequest{}) if err != nil { panic(err) } @@ -514,7 +516,7 @@ func (bcR *BlockchainReactor) sendBlockRequest(peerID p2p.ID, height int64) erro return errNilPeerForBlockRequest } - msgBytes, err := bc.EncodeMsg(&bcproto.BlockRequest{Height: height}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.BlockRequest{Height: height}) if err != nil { return err } diff --git a/blockchain/v2/io.go b/blockchain/v2/io.go index 9cc9e5882..49d2d59c1 100644 --- a/blockchain/v2/io.go +++ b/blockchain/v2/io.go @@ -3,6 +3,8 @@ package v2 import ( "fmt" + tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/p2p" bcproto "github.com/line/ostracon/proto/ostracon/blockchain" @@ -47,7 +49,7 @@ func (sio *switchIO) sendBlockRequest(peerID p2p.ID, height int64) error { if peer == nil { return fmt.Errorf("peer not found") } - msgBytes, err := bc.EncodeMsg(&bcproto.BlockRequest{Height: height}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.BlockRequest{Height: height}) if err != nil { return err } @@ -65,7 +67,7 @@ func (sio *switchIO) sendStatusResponse(base int64, height int64, peerID p2p.ID) return fmt.Errorf("peer not found") } - msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{Height: height, Base: base}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{Height: height, Base: base}) if err != nil { return err } @@ -107,7 +109,7 @@ func (sio *switchIO) sendBlockNotFound(height int64, peerID p2p.ID) error { if peer == nil { return fmt.Errorf("peer not found") } - msgBytes, err := bc.EncodeMsg(&bcproto.NoBlockResponse{Height: height}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.NoBlockResponse{Height: height}) if err != nil { return err } @@ -128,7 +130,7 @@ func (sio *switchIO) trySwitchToConsensus(state state.State, skipWAL bool) bool } func (sio *switchIO) broadcastStatusRequest() error { - msgBytes, err := bc.EncodeMsg(&bcproto.StatusRequest{}) + msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusRequest{}) if err != nil { return err } diff --git a/blockchain/v2/reactor.go b/blockchain/v2/reactor.go index 30c860d9a..44951369d 100644 --- a/blockchain/v2/reactor.go +++ b/blockchain/v2/reactor.go @@ -5,6 +5,8 @@ import ( "fmt" "time" + tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + "github.com/line/ostracon/behaviour" bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/libs/log" @@ -474,12 +476,12 @@ func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { r.logger.Debug("Receive", "src", src.ID(), "chID", chID, "msg", msg) switch msg := msg.(type) { - case *bcproto.StatusRequest: + case *tmbcproto.StatusRequest: if err := r.io.sendStatusResponse(r.store.Base(), r.store.Height(), src.ID()); err != nil { r.logger.Error("Could not send status message to peer", "src", src) } - case *bcproto.BlockRequest: + case *tmbcproto.BlockRequest: block := r.store.LoadBlock(msg.Height) if block != nil { if err = r.io.sendBlockToPeer(block, src.ID()); err != nil { @@ -493,7 +495,7 @@ func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { } } - case *bcproto.StatusResponse: + case *tmbcproto.StatusResponse: r.mtx.RLock() if r.events != nil { r.events <- bcStatusResponse{peerID: src.ID(), base: msg.Base, height: msg.Height} @@ -517,7 +519,7 @@ func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { } r.mtx.RUnlock() - case *bcproto.NoBlockResponse: + case *tmbcproto.NoBlockResponse: r.mtx.RLock() if r.events != nil { r.events <- bcNoBlockResponse{peerID: src.ID(), height: msg.Height, time: time.Now()} diff --git a/blockchain/v2/reactor_test.go b/blockchain/v2/reactor_test.go index e48e7cd64..3f262152a 100644 --- a/blockchain/v2/reactor_test.go +++ b/blockchain/v2/reactor_test.go @@ -9,6 +9,8 @@ import ( "testing" "time" + tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/behaviour" bc "github.com/line/ostracon/blockchain" @@ -18,7 +20,6 @@ import ( "github.com/line/ostracon/mempool/mock" "github.com/line/ostracon/p2p" "github.com/line/ostracon/p2p/conn" - bcproto "github.com/line/ostracon/proto/ostracon/blockchain" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/store" @@ -380,10 +381,10 @@ func TestReactorHelperMode(t *testing.T) { name: "status request", params: params, msgs: []testEvent{ - {"P1", bcproto.StatusRequest{}}, - {"P1", bcproto.BlockRequest{Height: 13}}, - {"P1", bcproto.BlockRequest{Height: 20}}, - {"P1", bcproto.BlockRequest{Height: 22}}, + {"P1", tmbcproto.StatusRequest{}}, + {"P1", tmbcproto.BlockRequest{Height: 13}}, + {"P1", tmbcproto.BlockRequest{Height: 20}}, + {"P1", tmbcproto.BlockRequest{Height: 22}}, }, }, } @@ -400,13 +401,13 @@ func TestReactorHelperMode(t *testing.T) { for i := 0; i < len(tt.msgs); i++ { step := tt.msgs[i] switch ev := step.event.(type) { - case bcproto.StatusRequest: + case tmbcproto.StatusRequest: old := mockSwitch.numStatusResponse msg, err := bc.EncodeMsg(&ev) assert.NoError(t, err) reactor.Receive(channelID, mockPeer{id: p2p.ID(step.peer)}, msg) assert.Equal(t, old+1, mockSwitch.numStatusResponse) - case bcproto.BlockRequest: + case tmbcproto.BlockRequest: if ev.Height > params.startHeight { old := mockSwitch.numNoBlockResponse msg, err := bc.EncodeMsg(&ev) diff --git a/consensus/msgs.go b/consensus/msgs.go index 8555dcb7a..e33119ff7 100644 --- a/consensus/msgs.go +++ b/consensus/msgs.go @@ -6,13 +6,13 @@ import ( "github.com/gogo/protobuf/proto" + tmcons "github.com/tendermint/tendermint/proto/tendermint/consensus" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" cstypes "github.com/line/ostracon/consensus/types" "github.com/line/ostracon/libs/bits" tmmath "github.com/line/ostracon/libs/math" "github.com/line/ostracon/p2p" - tmcons "github.com/line/ostracon/proto/ostracon/consensus" "github.com/line/ostracon/types" ) diff --git a/consensus/msgs_test.go b/consensus/msgs_test.go index c44133898..1f8e2f85e 100644 --- a/consensus/msgs_test.go +++ b/consensus/msgs_test.go @@ -10,13 +10,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmcons "github.com/tendermint/tendermint/proto/tendermint/consensus" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/libs/bits" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/p2p" - tmcons "github.com/line/ostracon/proto/ostracon/consensus" "github.com/line/ostracon/types" ) diff --git a/consensus/reactor.go b/consensus/reactor.go index b6bf875a6..4462eaddb 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -9,6 +9,7 @@ import ( "github.com/gogo/protobuf/proto" + tmcons "github.com/tendermint/tendermint/proto/tendermint/consensus" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" cstypes "github.com/line/ostracon/consensus/types" @@ -18,7 +19,6 @@ import ( "github.com/line/ostracon/libs/log" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" - tmcons "github.com/line/ostracon/proto/ostracon/consensus" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" diff --git a/consensus/wal.go b/consensus/wal.go index 7280e2df6..13c4c150f 100644 --- a/consensus/wal.go +++ b/consensus/wal.go @@ -11,12 +11,13 @@ import ( "github.com/gogo/protobuf/proto" + tmcons "github.com/tendermint/tendermint/proto/tendermint/consensus" + auto "github.com/line/ostracon/libs/autofile" tmjson "github.com/line/ostracon/libs/json" "github.com/line/ostracon/libs/log" tmos "github.com/line/ostracon/libs/os" "github.com/line/ostracon/libs/service" - tmcons "github.com/line/ostracon/proto/ostracon/consensus" tmtime "github.com/line/ostracon/types/time" ) diff --git a/proto/ostracon/blockchain/types.pb.go b/proto/ostracon/blockchain/types.pb.go index 6136a7424..f40f22c47 100644 --- a/proto/ostracon/blockchain/types.pb.go +++ b/proto/ostracon/blockchain/types.pb.go @@ -7,6 +7,7 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" types "github.com/line/ostracon/proto/ostracon/types" + blockchain "github.com/tendermint/tendermint/proto/tendermint/blockchain" io "io" math "math" math_bits "math/bits" @@ -23,96 +24,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// BlockRequest requests a block for a specific height -type BlockRequest struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *BlockRequest) Reset() { *m = BlockRequest{} } -func (m *BlockRequest) String() string { return proto.CompactTextString(m) } -func (*BlockRequest) ProtoMessage() {} -func (*BlockRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8fcd44ecf244cfa3, []int{0} -} -func (m *BlockRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BlockRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockRequest.Merge(m, src) -} -func (m *BlockRequest) XXX_Size() int { - return m.Size() -} -func (m *BlockRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BlockRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockRequest proto.InternalMessageInfo - -func (m *BlockRequest) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -// NoBlockResponse informs the node that the peer does not have block at the requested height -type NoBlockResponse struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *NoBlockResponse) Reset() { *m = NoBlockResponse{} } -func (m *NoBlockResponse) String() string { return proto.CompactTextString(m) } -func (*NoBlockResponse) ProtoMessage() {} -func (*NoBlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8fcd44ecf244cfa3, []int{1} -} -func (m *NoBlockResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NoBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NoBlockResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NoBlockResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NoBlockResponse.Merge(m, src) -} -func (m *NoBlockResponse) XXX_Size() int { - return m.Size() -} -func (m *NoBlockResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NoBlockResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NoBlockResponse proto.InternalMessageInfo - -func (m *NoBlockResponse) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - // BlockResponse returns block to the requested type BlockResponse struct { Block *types.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` @@ -122,7 +33,7 @@ func (m *BlockResponse) Reset() { *m = BlockResponse{} } func (m *BlockResponse) String() string { return proto.CompactTextString(m) } func (*BlockResponse) ProtoMessage() {} func (*BlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8fcd44ecf244cfa3, []int{2} + return fileDescriptor_8fcd44ecf244cfa3, []int{0} } func (m *BlockResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -158,96 +69,6 @@ func (m *BlockResponse) GetBlock() *types.Block { return nil } -// StatusRequest requests the status of a peer. -type StatusRequest struct { -} - -func (m *StatusRequest) Reset() { *m = StatusRequest{} } -func (m *StatusRequest) String() string { return proto.CompactTextString(m) } -func (*StatusRequest) ProtoMessage() {} -func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8fcd44ecf244cfa3, []int{3} -} -func (m *StatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusRequest.Merge(m, src) -} -func (m *StatusRequest) XXX_Size() int { - return m.Size() -} -func (m *StatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusRequest proto.InternalMessageInfo - -// StatusResponse is a peer response to inform their status. -type StatusResponse struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Base int64 `protobuf:"varint,2,opt,name=base,proto3" json:"base,omitempty"` -} - -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} -func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8fcd44ecf244cfa3, []int{4} -} -func (m *StatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusResponse.Merge(m, src) -} -func (m *StatusResponse) XXX_Size() int { - return m.Size() -} -func (m *StatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusResponse proto.InternalMessageInfo - -func (m *StatusResponse) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *StatusResponse) GetBase() int64 { - if m != nil { - return m.Base - } - return 0 -} - type Message struct { // Types that are valid to be assigned to Sum: // *Message_BlockRequest @@ -262,7 +83,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_8fcd44ecf244cfa3, []int{5} + return fileDescriptor_8fcd44ecf244cfa3, []int{1} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -298,19 +119,19 @@ type isMessage_Sum interface { } type Message_BlockRequest struct { - BlockRequest *BlockRequest `protobuf:"bytes,1,opt,name=block_request,json=blockRequest,proto3,oneof" json:"block_request,omitempty"` + BlockRequest *blockchain.BlockRequest `protobuf:"bytes,1,opt,name=block_request,json=blockRequest,proto3,oneof" json:"block_request,omitempty"` } type Message_NoBlockResponse struct { - NoBlockResponse *NoBlockResponse `protobuf:"bytes,2,opt,name=no_block_response,json=noBlockResponse,proto3,oneof" json:"no_block_response,omitempty"` + NoBlockResponse *blockchain.NoBlockResponse `protobuf:"bytes,2,opt,name=no_block_response,json=noBlockResponse,proto3,oneof" json:"no_block_response,omitempty"` } type Message_BlockResponse struct { BlockResponse *BlockResponse `protobuf:"bytes,3,opt,name=block_response,json=blockResponse,proto3,oneof" json:"block_response,omitempty"` } type Message_StatusRequest struct { - StatusRequest *StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest,proto3,oneof" json:"status_request,omitempty"` + StatusRequest *blockchain.StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest,proto3,oneof" json:"status_request,omitempty"` } type Message_StatusResponse struct { - StatusResponse *StatusResponse `protobuf:"bytes,5,opt,name=status_response,json=statusResponse,proto3,oneof" json:"status_response,omitempty"` + StatusResponse *blockchain.StatusResponse `protobuf:"bytes,5,opt,name=status_response,json=statusResponse,proto3,oneof" json:"status_response,omitempty"` } func (*Message_BlockRequest) isMessage_Sum() {} @@ -326,14 +147,14 @@ func (m *Message) GetSum() isMessage_Sum { return nil } -func (m *Message) GetBlockRequest() *BlockRequest { +func (m *Message) GetBlockRequest() *blockchain.BlockRequest { if x, ok := m.GetSum().(*Message_BlockRequest); ok { return x.BlockRequest } return nil } -func (m *Message) GetNoBlockResponse() *NoBlockResponse { +func (m *Message) GetNoBlockResponse() *blockchain.NoBlockResponse { if x, ok := m.GetSum().(*Message_NoBlockResponse); ok { return x.NoBlockResponse } @@ -347,14 +168,14 @@ func (m *Message) GetBlockResponse() *BlockResponse { return nil } -func (m *Message) GetStatusRequest() *StatusRequest { +func (m *Message) GetStatusRequest() *blockchain.StatusRequest { if x, ok := m.GetSum().(*Message_StatusRequest); ok { return x.StatusRequest } return nil } -func (m *Message) GetStatusResponse() *StatusResponse { +func (m *Message) GetStatusResponse() *blockchain.StatusResponse { if x, ok := m.GetSum().(*Message_StatusResponse); ok { return x.StatusResponse } @@ -373,97 +194,35 @@ func (*Message) XXX_OneofWrappers() []interface{} { } func init() { - proto.RegisterType((*BlockRequest)(nil), "ostracon.blockchain.BlockRequest") - proto.RegisterType((*NoBlockResponse)(nil), "ostracon.blockchain.NoBlockResponse") proto.RegisterType((*BlockResponse)(nil), "ostracon.blockchain.BlockResponse") - proto.RegisterType((*StatusRequest)(nil), "ostracon.blockchain.StatusRequest") - proto.RegisterType((*StatusResponse)(nil), "ostracon.blockchain.StatusResponse") proto.RegisterType((*Message)(nil), "ostracon.blockchain.Message") } func init() { proto.RegisterFile("ostracon/blockchain/types.proto", fileDescriptor_8fcd44ecf244cfa3) } var fileDescriptor_8fcd44ecf244cfa3 = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xb1, 0x4f, 0xc2, 0x40, - 0x14, 0xc6, 0x5b, 0x0b, 0x98, 0x3c, 0x28, 0x8d, 0x35, 0x1a, 0xc2, 0x50, 0xb5, 0x1a, 0xa3, 0x31, - 0x69, 0x13, 0x5c, 0x99, 0x98, 0x48, 0x54, 0x86, 0xba, 0xb9, 0x90, 0xb6, 0xb9, 0xd0, 0x46, 0xb8, - 0x43, 0xde, 0x75, 0xf0, 0xbf, 0x70, 0xf4, 0x4f, 0x72, 0x64, 0x74, 0x34, 0xf0, 0x8f, 0x18, 0xee, - 0xca, 0x09, 0x4d, 0xed, 0xd6, 0x7b, 0xfd, 0xde, 0xef, 0xfb, 0xfa, 0xe5, 0x0a, 0x67, 0x0c, 0xf9, - 0x22, 0x8c, 0x19, 0xf5, 0xa3, 0x29, 0x8b, 0x5f, 0xe3, 0x24, 0x4c, 0xa9, 0xcf, 0xdf, 0xe7, 0x04, - 0xbd, 0xf9, 0x82, 0x71, 0x66, 0x1f, 0x6f, 0x05, 0xde, 0x9f, 0xa0, 0xdb, 0x55, 0x5b, 0x42, 0x2a, - 0x77, 0xe5, 0x82, 0x7b, 0x0d, 0xad, 0xc1, 0xe6, 0x18, 0x90, 0xb7, 0x8c, 0x20, 0xb7, 0x4f, 0xa1, - 0x91, 0x90, 0x74, 0x92, 0xf0, 0x8e, 0x7e, 0xae, 0xdf, 0x18, 0x41, 0x7e, 0x72, 0x6f, 0xc1, 0x1a, - 0xb1, 0x5c, 0x89, 0x73, 0x46, 0x91, 0xfc, 0x2b, 0xed, 0x83, 0xb9, 0x2f, 0xbc, 0x83, 0xba, 0xb0, - 0x14, 0xba, 0x66, 0xef, 0xc4, 0x53, 0x21, 0x65, 0x74, 0xa9, 0x96, 0x1a, 0xd7, 0x02, 0xf3, 0x99, - 0x87, 0x3c, 0xc3, 0x3c, 0x91, 0xdb, 0x87, 0xf6, 0x76, 0x50, 0x6d, 0x6c, 0xdb, 0x50, 0x8b, 0x42, - 0x24, 0x9d, 0x03, 0x31, 0x15, 0xcf, 0xee, 0xa7, 0x01, 0x87, 0x4f, 0x04, 0x31, 0x9c, 0x10, 0x7b, - 0x08, 0xa6, 0xf0, 0x18, 0x2f, 0x24, 0x3a, 0xcf, 0x73, 0xe1, 0x95, 0x94, 0xe6, 0xed, 0xb6, 0x32, - 0xd4, 0x82, 0x56, 0xb4, 0xdb, 0x52, 0x00, 0x47, 0x94, 0x8d, 0xb7, 0x30, 0x19, 0x4b, 0xd8, 0x36, - 0x7b, 0x57, 0xa5, 0xb4, 0x42, 0x77, 0x43, 0x2d, 0xb0, 0x68, 0xa1, 0xce, 0x07, 0x68, 0x17, 0x80, - 0x86, 0x00, 0xba, 0x55, 0xf1, 0x14, 0xce, 0x8c, 0x8a, 0x30, 0x14, 0xa5, 0xa9, 0x6f, 0xad, 0x55, - 0xc0, 0xf6, 0x0a, 0xdf, 0xc0, 0x70, 0x77, 0x60, 0x8f, 0xc0, 0x52, 0xb0, 0x3c, 0x5a, 0x5d, 0xd0, - 0x2e, 0x2b, 0x69, 0x2a, 0x5b, 0x1b, 0xf7, 0x26, 0x83, 0x3a, 0x18, 0x98, 0xcd, 0x06, 0x8f, 0x5f, - 0x2b, 0x47, 0x5f, 0xae, 0x1c, 0xfd, 0x67, 0xe5, 0xe8, 0x1f, 0x6b, 0x47, 0x5b, 0xae, 0x1d, 0xed, - 0x7b, 0xed, 0x68, 0x2f, 0xbd, 0x49, 0xca, 0x93, 0x2c, 0xf2, 0x62, 0x36, 0xf3, 0xa7, 0x29, 0x25, - 0xbe, 0xba, 0xc0, 0xe2, 0xd2, 0xfa, 0x25, 0x7f, 0x41, 0xd4, 0x10, 0xaf, 0xee, 0x7f, 0x03, 0x00, - 0x00, 0xff, 0xff, 0x96, 0x66, 0x60, 0x50, 0x23, 0x03, 0x00, 0x00, -} - -func (m *BlockRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NoBlockResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NoBlockResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NoBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcf, 0x4a, 0xc3, 0x40, + 0x10, 0x87, 0x13, 0x6b, 0x15, 0x56, 0xd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7c, 0xf7, 0xa2, + 0xb4, 0x47, 0xdf, 0x1a, 0x36, 0x79, 0xb9, 0x84, 0x6f, 0x51, 0x63, 0x45, 0x59, 0x53, 0xca, 0x0e, + 0x5d, 0xf3, 0xb0, 0x74, 0x55, 0xe7, 0xf8, 0x25, 0xd9, 0x00, 0x35, 0x40, 0x7a, 0x32, 0x06, 0xb3, + 0xef, 0xa6, 0x92, 0x9d, 0x56, 0xe4, 0x7b, 0x54, 0x70, 0xbe, 0xb0, 0x03, 0xc5, 0x02, 0x7e, 0x40, + 0x4d, 0xa3, 0xcb, 0xc2, 0xd5, 0x95, 0xef, 0xec, 0x1f, 0x9f, 0xc9, 0xd7, 0x80, 0x52, 0xa5, 0x57, + 0x47, 0x35, 0x88, 0x67, 0xbd, 0xbb, 0xaf, 0x84, 0xd8, 0x8b, 0x84, 0xd8, 0x3f, 0x09, 0xb1, 0x3f, + 0x52, 0x62, 0x2d, 0x52, 0x62, 0x7d, 0xa7, 0xc4, 0x7a, 0xee, 0x8e, 0x43, 0x39, 0x89, 0x7d, 0x1a, + 0x88, 0x99, 0x3b, 0x0d, 0x39, 0x73, 0xcd, 0x25, 0xa9, 0xd3, 0x70, 0xd7, 0x9c, 0xa3, 0xbf, 0xa5, + 0x5a, 0x57, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x41, 0x33, 0x04, 0xec, 0xac, 0x02, 0x00, 0x00, } func (m *BlockResponse) Marshal() (dAtA []byte, err error) { @@ -501,62 +260,6 @@ func (m *BlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *StatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *StatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Base != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Base)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *Message) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -705,30 +408,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *BlockRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - -func (m *NoBlockResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - func (m *BlockResponse) Size() (n int) { if m == nil { return 0 @@ -742,30 +421,6 @@ func (m *BlockResponse) Size() (n int) { return n } -func (m *StatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *StatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Base != 0 { - n += 1 + sovTypes(uint64(m.Base)) - } - return n -} - func (m *Message) Size() (n int) { if m == nil { return 0 @@ -845,144 +500,6 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *BlockRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NoBlockResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NoBlockResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NoBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *BlockResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1069,144 +586,6 @@ func (m *BlockResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *StatusRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) - } - m.Base = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Base |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Message) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1265,7 +644,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &BlockRequest{} + v := &blockchain.BlockRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1300,7 +679,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &NoBlockResponse{} + v := &blockchain.NoBlockResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1370,7 +749,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &StatusRequest{} + v := &blockchain.StatusRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1405,7 +784,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &StatusResponse{} + v := &blockchain.StatusResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ostracon/blockchain/types.proto b/proto/ostracon/blockchain/types.proto index da953ff33..6acd4c52b 100644 --- a/proto/ostracon/blockchain/types.proto +++ b/proto/ostracon/blockchain/types.proto @@ -4,16 +4,17 @@ package ostracon.blockchain; option go_package = "github.com/line/ostracon/proto/ostracon/blockchain"; import "ostracon/types/block.proto"; +import "tendermint/blockchain/types.proto"; // BlockRequest requests a block for a specific height -message BlockRequest { - int64 height = 1; -} +//message BlockRequest { +// int64 height = 1; +//} // NoBlockResponse informs the node that the peer does not have block at the requested height -message NoBlockResponse { - int64 height = 1; -} +//message NoBlockResponse { +// int64 height = 1; +//} // BlockResponse returns block to the requested message BlockResponse { @@ -21,21 +22,21 @@ message BlockResponse { } // StatusRequest requests the status of a peer. -message StatusRequest { -} +//message StatusRequest { +//} // StatusResponse is a peer response to inform their status. -message StatusResponse { - int64 height = 1; - int64 base = 2; -} +//message StatusResponse { +// int64 height = 1; +// int64 base = 2; +//} message Message { oneof sum { - BlockRequest block_request = 1; - NoBlockResponse no_block_response = 2; + tendermint.blockchain.BlockRequest block_request = 1; + tendermint.blockchain.NoBlockResponse no_block_response = 2; BlockResponse block_response = 3; - StatusRequest status_request = 4; - StatusResponse status_response = 5; + tendermint.blockchain.StatusRequest status_request = 4; + tendermint.blockchain.StatusResponse status_response = 5; } } diff --git a/proto/ostracon/consensus/types.pb.go b/proto/ostracon/consensus/types.pb.go deleted file mode 100644 index 8b7d3cc1d..000000000 --- a/proto/ostracon/consensus/types.pb.go +++ /dev/null @@ -1,3425 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/consensus/types.proto - -package consensus - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - bits "github.com/tendermint/tendermint/proto/tendermint/libs/bits" - types "github.com/tendermint/tendermint/proto/tendermint/types" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// NewRoundStep is sent for every step taken in the ConsensusState. -// For every height/round/step transition -type NewRoundStep struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Step uint32 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` - SecondsSinceStartTime int64 `protobuf:"varint,4,opt,name=seconds_since_start_time,json=secondsSinceStartTime,proto3" json:"seconds_since_start_time,omitempty"` - LastCommitRound int32 `protobuf:"varint,5,opt,name=last_commit_round,json=lastCommitRound,proto3" json:"last_commit_round,omitempty"` -} - -func (m *NewRoundStep) Reset() { *m = NewRoundStep{} } -func (m *NewRoundStep) String() string { return proto.CompactTextString(m) } -func (*NewRoundStep) ProtoMessage() {} -func (*NewRoundStep) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{0} -} -func (m *NewRoundStep) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NewRoundStep) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NewRoundStep.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NewRoundStep) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewRoundStep.Merge(m, src) -} -func (m *NewRoundStep) XXX_Size() int { - return m.Size() -} -func (m *NewRoundStep) XXX_DiscardUnknown() { - xxx_messageInfo_NewRoundStep.DiscardUnknown(m) -} - -var xxx_messageInfo_NewRoundStep proto.InternalMessageInfo - -func (m *NewRoundStep) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *NewRoundStep) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *NewRoundStep) GetStep() uint32 { - if m != nil { - return m.Step - } - return 0 -} - -func (m *NewRoundStep) GetSecondsSinceStartTime() int64 { - if m != nil { - return m.SecondsSinceStartTime - } - return 0 -} - -func (m *NewRoundStep) GetLastCommitRound() int32 { - if m != nil { - return m.LastCommitRound - } - return 0 -} - -// NewValidBlock is sent when a validator observes a valid block B in some round r, -//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. -// In case the block is also committed, then IsCommit flag is set to true. -type NewValidBlock struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - BlockPartSetHeader types.PartSetHeader `protobuf:"bytes,3,opt,name=block_part_set_header,json=blockPartSetHeader,proto3" json:"block_part_set_header"` - BlockParts *bits.BitArray `protobuf:"bytes,4,opt,name=block_parts,json=blockParts,proto3" json:"block_parts,omitempty"` - IsCommit bool `protobuf:"varint,5,opt,name=is_commit,json=isCommit,proto3" json:"is_commit,omitempty"` -} - -func (m *NewValidBlock) Reset() { *m = NewValidBlock{} } -func (m *NewValidBlock) String() string { return proto.CompactTextString(m) } -func (*NewValidBlock) ProtoMessage() {} -func (*NewValidBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{1} -} -func (m *NewValidBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NewValidBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NewValidBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NewValidBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewValidBlock.Merge(m, src) -} -func (m *NewValidBlock) XXX_Size() int { - return m.Size() -} -func (m *NewValidBlock) XXX_DiscardUnknown() { - xxx_messageInfo_NewValidBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_NewValidBlock proto.InternalMessageInfo - -func (m *NewValidBlock) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *NewValidBlock) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *NewValidBlock) GetBlockPartSetHeader() types.PartSetHeader { - if m != nil { - return m.BlockPartSetHeader - } - return types.PartSetHeader{} -} - -func (m *NewValidBlock) GetBlockParts() *bits.BitArray { - if m != nil { - return m.BlockParts - } - return nil -} - -func (m *NewValidBlock) GetIsCommit() bool { - if m != nil { - return m.IsCommit - } - return false -} - -// Proposal is sent when a new block is proposed. -type Proposal struct { - Proposal types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{2} -} -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} -func (m *Proposal) XXX_Size() int { - return m.Size() -} -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -func (m *Proposal) GetProposal() types.Proposal { - if m != nil { - return m.Proposal - } - return types.Proposal{} -} - -// ProposalPOL is sent when a previous proposal is re-proposed. -type ProposalPOL struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - ProposalPolRound int32 `protobuf:"varint,2,opt,name=proposal_pol_round,json=proposalPolRound,proto3" json:"proposal_pol_round,omitempty"` - ProposalPol bits.BitArray `protobuf:"bytes,3,opt,name=proposal_pol,json=proposalPol,proto3" json:"proposal_pol"` -} - -func (m *ProposalPOL) Reset() { *m = ProposalPOL{} } -func (m *ProposalPOL) String() string { return proto.CompactTextString(m) } -func (*ProposalPOL) ProtoMessage() {} -func (*ProposalPOL) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{3} -} -func (m *ProposalPOL) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProposalPOL) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProposalPOL.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProposalPOL) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalPOL.Merge(m, src) -} -func (m *ProposalPOL) XXX_Size() int { - return m.Size() -} -func (m *ProposalPOL) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalPOL.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposalPOL proto.InternalMessageInfo - -func (m *ProposalPOL) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ProposalPOL) GetProposalPolRound() int32 { - if m != nil { - return m.ProposalPolRound - } - return 0 -} - -func (m *ProposalPOL) GetProposalPol() bits.BitArray { - if m != nil { - return m.ProposalPol - } - return bits.BitArray{} -} - -// BlockPart is sent when gossipping a piece of the proposed block. -type BlockPart struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Part types.Part `protobuf:"bytes,3,opt,name=part,proto3" json:"part"` -} - -func (m *BlockPart) Reset() { *m = BlockPart{} } -func (m *BlockPart) String() string { return proto.CompactTextString(m) } -func (*BlockPart) ProtoMessage() {} -func (*BlockPart) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{4} -} -func (m *BlockPart) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockPart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockPart.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BlockPart) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockPart.Merge(m, src) -} -func (m *BlockPart) XXX_Size() int { - return m.Size() -} -func (m *BlockPart) XXX_DiscardUnknown() { - xxx_messageInfo_BlockPart.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockPart proto.InternalMessageInfo - -func (m *BlockPart) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *BlockPart) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *BlockPart) GetPart() types.Part { - if m != nil { - return m.Part - } - return types.Part{} -} - -// Vote is sent when voting for a proposal (or lack thereof). -type Vote struct { - Vote *types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (m *Vote) String() string { return proto.CompactTextString(m) } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{5} -} -func (m *Vote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(m, src) -} -func (m *Vote) XXX_Size() int { - return m.Size() -} -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) -} - -var xxx_messageInfo_Vote proto.InternalMessageInfo - -func (m *Vote) GetVote() *types.Vote { - if m != nil { - return m.Vote - } - return nil -} - -// HasVote is sent to indicate that a particular vote has been received. -type HasVote struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - Index int32 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *HasVote) Reset() { *m = HasVote{} } -func (m *HasVote) String() string { return proto.CompactTextString(m) } -func (*HasVote) ProtoMessage() {} -func (*HasVote) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{6} -} -func (m *HasVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HasVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasVote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HasVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasVote.Merge(m, src) -} -func (m *HasVote) XXX_Size() int { - return m.Size() -} -func (m *HasVote) XXX_DiscardUnknown() { - xxx_messageInfo_HasVote.DiscardUnknown(m) -} - -var xxx_messageInfo_HasVote proto.InternalMessageInfo - -func (m *HasVote) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *HasVote) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *HasVote) GetType() types.SignedMsgType { - if m != nil { - return m.Type - } - return types.UnknownType -} - -func (m *HasVote) GetIndex() int32 { - if m != nil { - return m.Index - } - return 0 -} - -// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes. -type VoteSetMaj23 struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` -} - -func (m *VoteSetMaj23) Reset() { *m = VoteSetMaj23{} } -func (m *VoteSetMaj23) String() string { return proto.CompactTextString(m) } -func (*VoteSetMaj23) ProtoMessage() {} -func (*VoteSetMaj23) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{7} -} -func (m *VoteSetMaj23) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VoteSetMaj23) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VoteSetMaj23.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VoteSetMaj23) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteSetMaj23.Merge(m, src) -} -func (m *VoteSetMaj23) XXX_Size() int { - return m.Size() -} -func (m *VoteSetMaj23) XXX_DiscardUnknown() { - xxx_messageInfo_VoteSetMaj23.DiscardUnknown(m) -} - -var xxx_messageInfo_VoteSetMaj23 proto.InternalMessageInfo - -func (m *VoteSetMaj23) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *VoteSetMaj23) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *VoteSetMaj23) GetType() types.SignedMsgType { - if m != nil { - return m.Type - } - return types.UnknownType -} - -func (m *VoteSetMaj23) GetBlockID() types.BlockID { - if m != nil { - return m.BlockID - } - return types.BlockID{} -} - -// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID. -type VoteSetBits struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Votes bits.BitArray `protobuf:"bytes,5,opt,name=votes,proto3" json:"votes"` -} - -func (m *VoteSetBits) Reset() { *m = VoteSetBits{} } -func (m *VoteSetBits) String() string { return proto.CompactTextString(m) } -func (*VoteSetBits) ProtoMessage() {} -func (*VoteSetBits) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{8} -} -func (m *VoteSetBits) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VoteSetBits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VoteSetBits.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VoteSetBits) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteSetBits.Merge(m, src) -} -func (m *VoteSetBits) XXX_Size() int { - return m.Size() -} -func (m *VoteSetBits) XXX_DiscardUnknown() { - xxx_messageInfo_VoteSetBits.DiscardUnknown(m) -} - -var xxx_messageInfo_VoteSetBits proto.InternalMessageInfo - -func (m *VoteSetBits) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *VoteSetBits) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *VoteSetBits) GetType() types.SignedMsgType { - if m != nil { - return m.Type - } - return types.UnknownType -} - -func (m *VoteSetBits) GetBlockID() types.BlockID { - if m != nil { - return m.BlockID - } - return types.BlockID{} -} - -func (m *VoteSetBits) GetVotes() bits.BitArray { - if m != nil { - return m.Votes - } - return bits.BitArray{} -} - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_NewRoundStep - // *Message_NewValidBlock - // *Message_Proposal - // *Message_ProposalPol - // *Message_BlockPart - // *Message_Vote - // *Message_HasVote - // *Message_VoteSetMaj23 - // *Message_VoteSetBits - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_0ef76b376cac7abc, []int{9} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return m.Size() -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_NewRoundStep struct { - NewRoundStep *NewRoundStep `protobuf:"bytes,1,opt,name=new_round_step,json=newRoundStep,proto3,oneof" json:"new_round_step,omitempty"` -} -type Message_NewValidBlock struct { - NewValidBlock *NewValidBlock `protobuf:"bytes,2,opt,name=new_valid_block,json=newValidBlock,proto3,oneof" json:"new_valid_block,omitempty"` -} -type Message_Proposal struct { - Proposal *Proposal `protobuf:"bytes,3,opt,name=proposal,proto3,oneof" json:"proposal,omitempty"` -} -type Message_ProposalPol struct { - ProposalPol *ProposalPOL `protobuf:"bytes,4,opt,name=proposal_pol,json=proposalPol,proto3,oneof" json:"proposal_pol,omitempty"` -} -type Message_BlockPart struct { - BlockPart *BlockPart `protobuf:"bytes,5,opt,name=block_part,json=blockPart,proto3,oneof" json:"block_part,omitempty"` -} -type Message_Vote struct { - Vote *Vote `protobuf:"bytes,6,opt,name=vote,proto3,oneof" json:"vote,omitempty"` -} -type Message_HasVote struct { - HasVote *HasVote `protobuf:"bytes,7,opt,name=has_vote,json=hasVote,proto3,oneof" json:"has_vote,omitempty"` -} -type Message_VoteSetMaj23 struct { - VoteSetMaj23 *VoteSetMaj23 `protobuf:"bytes,8,opt,name=vote_set_maj23,json=voteSetMaj23,proto3,oneof" json:"vote_set_maj23,omitempty"` -} -type Message_VoteSetBits struct { - VoteSetBits *VoteSetBits `protobuf:"bytes,9,opt,name=vote_set_bits,json=voteSetBits,proto3,oneof" json:"vote_set_bits,omitempty"` -} - -func (*Message_NewRoundStep) isMessage_Sum() {} -func (*Message_NewValidBlock) isMessage_Sum() {} -func (*Message_Proposal) isMessage_Sum() {} -func (*Message_ProposalPol) isMessage_Sum() {} -func (*Message_BlockPart) isMessage_Sum() {} -func (*Message_Vote) isMessage_Sum() {} -func (*Message_HasVote) isMessage_Sum() {} -func (*Message_VoteSetMaj23) isMessage_Sum() {} -func (*Message_VoteSetBits) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetNewRoundStep() *NewRoundStep { - if x, ok := m.GetSum().(*Message_NewRoundStep); ok { - return x.NewRoundStep - } - return nil -} - -func (m *Message) GetNewValidBlock() *NewValidBlock { - if x, ok := m.GetSum().(*Message_NewValidBlock); ok { - return x.NewValidBlock - } - return nil -} - -func (m *Message) GetProposal() *Proposal { - if x, ok := m.GetSum().(*Message_Proposal); ok { - return x.Proposal - } - return nil -} - -func (m *Message) GetProposalPol() *ProposalPOL { - if x, ok := m.GetSum().(*Message_ProposalPol); ok { - return x.ProposalPol - } - return nil -} - -func (m *Message) GetBlockPart() *BlockPart { - if x, ok := m.GetSum().(*Message_BlockPart); ok { - return x.BlockPart - } - return nil -} - -func (m *Message) GetVote() *Vote { - if x, ok := m.GetSum().(*Message_Vote); ok { - return x.Vote - } - return nil -} - -func (m *Message) GetHasVote() *HasVote { - if x, ok := m.GetSum().(*Message_HasVote); ok { - return x.HasVote - } - return nil -} - -func (m *Message) GetVoteSetMaj23() *VoteSetMaj23 { - if x, ok := m.GetSum().(*Message_VoteSetMaj23); ok { - return x.VoteSetMaj23 - } - return nil -} - -func (m *Message) GetVoteSetBits() *VoteSetBits { - if x, ok := m.GetSum().(*Message_VoteSetBits); ok { - return x.VoteSetBits - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_NewRoundStep)(nil), - (*Message_NewValidBlock)(nil), - (*Message_Proposal)(nil), - (*Message_ProposalPol)(nil), - (*Message_BlockPart)(nil), - (*Message_Vote)(nil), - (*Message_HasVote)(nil), - (*Message_VoteSetMaj23)(nil), - (*Message_VoteSetBits)(nil), - } -} - -func init() { - proto.RegisterType((*NewRoundStep)(nil), "ostracon.consensus.NewRoundStep") - proto.RegisterType((*NewValidBlock)(nil), "ostracon.consensus.NewValidBlock") - proto.RegisterType((*Proposal)(nil), "ostracon.consensus.Proposal") - proto.RegisterType((*ProposalPOL)(nil), "ostracon.consensus.ProposalPOL") - proto.RegisterType((*BlockPart)(nil), "ostracon.consensus.BlockPart") - proto.RegisterType((*Vote)(nil), "ostracon.consensus.Vote") - proto.RegisterType((*HasVote)(nil), "ostracon.consensus.HasVote") - proto.RegisterType((*VoteSetMaj23)(nil), "ostracon.consensus.VoteSetMaj23") - proto.RegisterType((*VoteSetBits)(nil), "ostracon.consensus.VoteSetBits") - proto.RegisterType((*Message)(nil), "ostracon.consensus.Message") -} - -func init() { proto.RegisterFile("ostracon/consensus/types.proto", fileDescriptor_0ef76b376cac7abc) } - -var fileDescriptor_0ef76b376cac7abc = []byte{ - // 859 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0xb6, 0x59, 0x67, 0x93, 0x7d, 0x4e, 0x76, 0x61, 0xd4, 0x56, 0x26, 0x2d, 0xde, 0xe0, 0xd3, - 0x0a, 0x21, 0x07, 0xb2, 0x07, 0x50, 0x85, 0x40, 0x98, 0x56, 0xb8, 0x6a, 0xb7, 0x8d, 0x9c, 0xaa, - 0x42, 0x5c, 0x2c, 0x27, 0x1e, 0x25, 0x43, 0x6d, 0x8f, 0xe5, 0x99, 0x64, 0xd9, 0x2b, 0xbf, 0x80, - 0x1f, 0xc0, 0xdf, 0x40, 0xe2, 0x27, 0xf4, 0xd8, 0x23, 0xa7, 0x15, 0xca, 0xf2, 0x0f, 0x10, 0x77, - 0x34, 0xe3, 0x49, 0xe2, 0xb0, 0x0e, 0xb0, 0x17, 0xa4, 0xde, 0x62, 0xbf, 0xf7, 0x7d, 0xf3, 0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7, 0xee, 0x84, 0xa6, 0xfd, 0x84, 0x64, 0xb8, 0xbf, - 0xfe, 0x14, 0x29, 0xbf, 0x2d, 0xae, 0x7f, 0x99, 0x8c, 0xf7, 0x65, 0xe4, 0xf4, 0xaf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xd3, 0x7f, 0xca, 0x8d, 0xb6, 0x08, 0x00, 0x00, -} - -func (m *NewRoundStep) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NewRoundStep) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NewRoundStep) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastCommitRound != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastCommitRound)) - i-- - dAtA[i] = 0x28 - } - if m.SecondsSinceStartTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.SecondsSinceStartTime)) - i-- - dAtA[i] = 0x20 - } - if m.Step != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NewValidBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NewValidBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NewValidBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IsCommit { - i-- - if m.IsCommit { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.BlockParts != nil { - { - size, err := m.BlockParts.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - { - size, err := m.BlockPartSetHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Proposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ProposalPOL) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProposalPOL) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProposalPOL) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ProposalPol.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.ProposalPolRound != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ProposalPolRound)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BlockPart) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockPart) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockPart) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Part.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Vote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Vote != nil { - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasVote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x20 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *VoteSetMaj23) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VoteSetMaj23) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VoteSetMaj23) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *VoteSetBits) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VoteSetBits) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VoteSetBits) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Votes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_NewRoundStep) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_NewRoundStep) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NewRoundStep != nil { - { - size, err := m.NewRoundStep.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Message_NewValidBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_NewValidBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NewValidBlock != nil { - { - size, err := m.NewValidBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Message_Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Proposal != nil { - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Message_ProposalPol) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_ProposalPol) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ProposalPol != nil { - { - size, err := m.ProposalPol.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Message_BlockPart) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_BlockPart) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BlockPart != nil { - { - size, err := m.BlockPart.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *Message_Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Vote != nil { - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *Message_HasVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_HasVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.HasVote != nil { - { - size, err := m.HasVote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *Message_VoteSetMaj23) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_VoteSetMaj23) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.VoteSetMaj23 != nil { - { - size, err := m.VoteSetMaj23.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *Message_VoteSetBits) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_VoteSetBits) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.VoteSetBits != nil { - { - size, err := m.VoteSetBits.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *NewRoundStep) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Step != 0 { - n += 1 + sovTypes(uint64(m.Step)) - } - if m.SecondsSinceStartTime != 0 { - n += 1 + sovTypes(uint64(m.SecondsSinceStartTime)) - } - if m.LastCommitRound != 0 { - n += 1 + sovTypes(uint64(m.LastCommitRound)) - } - return n -} - -func (m *NewValidBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.BlockPartSetHeader.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.BlockParts != nil { - l = m.BlockParts.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.IsCommit { - n += 2 - } - return n -} - -func (m *Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *ProposalPOL) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.ProposalPolRound != 0 { - n += 1 + sovTypes(uint64(m.ProposalPolRound)) - } - l = m.ProposalPol.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *BlockPart) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.Part.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *HasVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - return n -} - -func (m *VoteSetMaj23) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *VoteSetBits) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.Votes.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_NewRoundStep) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NewRoundStep != nil { - l = m.NewRoundStep.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_NewValidBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NewValidBlock != nil { - l = m.NewValidBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Proposal != nil { - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_ProposalPol) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalPol != nil { - l = m.ProposalPol.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_BlockPart) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockPart != nil { - l = m.BlockPart.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_HasVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasVote != nil { - l = m.HasVote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_VoteSetMaj23) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VoteSetMaj23 != nil { - l = m.VoteSetMaj23.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Message_VoteSetBits) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VoteSetBits != nil { - l = m.VoteSetBits.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *NewRoundStep) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NewRoundStep: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NewRoundStep: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - m.Step = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SecondsSinceStartTime", wireType) - } - m.SecondsSinceStartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SecondsSinceStartTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommitRound", wireType) - } - m.LastCommitRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastCommitRound |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NewValidBlock) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NewValidBlock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NewValidBlock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockPartSetHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockPartSetHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockParts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockParts == nil { - m.BlockParts = &bits.BitArray{} - } - if err := m.BlockParts.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsCommit", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsCommit = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Proposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Proposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProposalPOL) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProposalPOL: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposalPOL: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalPolRound", wireType) - } - m.ProposalPolRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalPolRound |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalPol", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProposalPol.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockPart) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockPart: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockPart: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Part", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Part.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Vote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Vote == nil { - m.Vote = &types.Vote{} - } - if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HasVote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= types.SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VoteSetMaj23) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VoteSetMaj23: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VoteSetMaj23: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= types.SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VoteSetBits) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VoteSetBits: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VoteSetBits: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= types.SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Votes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewRoundStep", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NewRoundStep{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_NewRoundStep{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewValidBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NewValidBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_NewValidBlock{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Proposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_Proposal{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalPol", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ProposalPOL{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_ProposalPol{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockPart", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &BlockPart{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_BlockPart{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Vote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_Vote{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasVote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &HasVote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_HasVote{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VoteSetMaj23", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VoteSetMaj23{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_VoteSetMaj23{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VoteSetBits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VoteSetBits{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_VoteSetBits{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/consensus/types.proto b/proto/ostracon/consensus/types.proto deleted file mode 100644 index 0d51ec310..000000000 --- a/proto/ostracon/consensus/types.proto +++ /dev/null @@ -1,92 +0,0 @@ -syntax = "proto3"; -package ostracon.consensus; - -option go_package = "github.com/line/ostracon/proto/ostracon/consensus"; - -import "gogoproto/gogo.proto"; -import "tendermint/libs/bits/types.proto"; -import "tendermint/types/types.proto"; - -// NewRoundStep is sent for every step taken in the ConsensusState. -// For every height/round/step transition -message NewRoundStep { - int64 height = 1; - int32 round = 2; - uint32 step = 3; - int64 seconds_since_start_time = 4; - int32 last_commit_round = 5; -} - -// NewValidBlock is sent when a validator observes a valid block B in some round r, -//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. -// In case the block is also committed, then IsCommit flag is set to true. -message NewValidBlock { - int64 height = 1; - int32 round = 2; - tendermint.types.PartSetHeader block_part_set_header = 3 [(gogoproto.nullable) = false]; - tendermint.libs.bits.BitArray block_parts = 4; - bool is_commit = 5; -} - -// Proposal is sent when a new block is proposed. -message Proposal { - tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; -} - -// ProposalPOL is sent when a previous proposal is re-proposed. -message ProposalPOL { - int64 height = 1; - int32 proposal_pol_round = 2; - tendermint.libs.bits.BitArray proposal_pol = 3 [(gogoproto.nullable) = false]; -} - -// BlockPart is sent when gossipping a piece of the proposed block. -message BlockPart { - int64 height = 1; - int32 round = 2; - tendermint.types.Part part = 3 [(gogoproto.nullable) = false]; -} - -// Vote is sent when voting for a proposal (or lack thereof). -message Vote { - tendermint.types.Vote vote = 1; -} - -// HasVote is sent to indicate that a particular vote has been received. -message HasVote { - int64 height = 1; - int32 round = 2; - tendermint.types.SignedMsgType type = 3; - int32 index = 4; -} - -// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes. -message VoteSetMaj23 { - int64 height = 1; - int32 round = 2; - tendermint.types.SignedMsgType type = 3; - tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; -} - -// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID. -message VoteSetBits { - int64 height = 1; - int32 round = 2; - tendermint.types.SignedMsgType type = 3; - tendermint.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - tendermint.libs.bits.BitArray votes = 5 [(gogoproto.nullable) = false]; -} - -message Message { - oneof sum { - NewRoundStep new_round_step = 1; - NewValidBlock new_valid_block = 2; - Proposal proposal = 3; - ProposalPOL proposal_pol = 4; - BlockPart block_part = 5; - Vote vote = 6; - HasVote has_vote = 7; - VoteSetMaj23 vote_set_maj23 = 8; - VoteSetBits vote_set_bits = 9; - } -} diff --git a/proto/ostracon/consensus/wal.pb.go b/proto/ostracon/consensus/wal.pb.go deleted file mode 100644 index ba82b701e..000000000 --- a/proto/ostracon/consensus/wal.pb.go +++ /dev/null @@ -1,1541 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/consensus/wal.proto - -package consensus - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - types "github.com/tendermint/tendermint/proto/tendermint/types" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MsgInfo are msgs from the reactor which may update the state -type MsgInfo struct { - Msg Message `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"` - PeerID string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` -} - -func (m *MsgInfo) Reset() { *m = MsgInfo{} } -func (m *MsgInfo) String() string { return proto.CompactTextString(m) } -func (*MsgInfo) ProtoMessage() {} -func (*MsgInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_4c737e612f9cf5e0, []int{0} -} -func (m *MsgInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgInfo.Merge(m, src) -} -func (m *MsgInfo) XXX_Size() int { - return m.Size() -} -func (m *MsgInfo) XXX_DiscardUnknown() { - xxx_messageInfo_MsgInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgInfo proto.InternalMessageInfo - -func (m *MsgInfo) GetMsg() Message { - if m != nil { - return m.Msg - } - return Message{} -} - -func (m *MsgInfo) GetPeerID() string { - if m != nil { - return m.PeerID - } - return "" -} - -// TimeoutInfo internally generated messages which may update the state -type TimeoutInfo struct { - Duration time.Duration `protobuf:"bytes,1,opt,name=duration,proto3,stdduration" json:"duration"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"` - Step uint32 `protobuf:"varint,4,opt,name=step,proto3" json:"step,omitempty"` -} - -func (m *TimeoutInfo) Reset() { *m = TimeoutInfo{} } -func (m *TimeoutInfo) String() string { return proto.CompactTextString(m) } -func (*TimeoutInfo) ProtoMessage() {} -func (*TimeoutInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_4c737e612f9cf5e0, []int{1} -} -func (m *TimeoutInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TimeoutInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimeoutInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TimeoutInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeoutInfo.Merge(m, src) -} -func (m *TimeoutInfo) XXX_Size() int { - return m.Size() -} -func (m *TimeoutInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TimeoutInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeoutInfo proto.InternalMessageInfo - -func (m *TimeoutInfo) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *TimeoutInfo) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *TimeoutInfo) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *TimeoutInfo) GetStep() uint32 { - if m != nil { - return m.Step - } - return 0 -} - -// EndHeight marks the end of the given height inside WAL. -// @internal used by scripts/wal2json util. -type EndHeight struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *EndHeight) Reset() { *m = EndHeight{} } -func (m *EndHeight) String() string { return proto.CompactTextString(m) } -func (*EndHeight) ProtoMessage() {} -func (*EndHeight) Descriptor() ([]byte, []int) { - return fileDescriptor_4c737e612f9cf5e0, []int{2} -} -func (m *EndHeight) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EndHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EndHeight.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EndHeight) XXX_Merge(src proto.Message) { - xxx_messageInfo_EndHeight.Merge(m, src) -} -func (m *EndHeight) XXX_Size() int { - return m.Size() -} -func (m *EndHeight) XXX_DiscardUnknown() { - xxx_messageInfo_EndHeight.DiscardUnknown(m) -} - -var xxx_messageInfo_EndHeight proto.InternalMessageInfo - -func (m *EndHeight) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -type WALMessage struct { - // Types that are valid to be assigned to Sum: - // *WALMessage_EventDataRoundState - // *WALMessage_MsgInfo - // *WALMessage_TimeoutInfo - // *WALMessage_EndHeight - Sum isWALMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *WALMessage) Reset() { *m = WALMessage{} } -func (m *WALMessage) String() string { return proto.CompactTextString(m) } -func (*WALMessage) ProtoMessage() {} -func (*WALMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_4c737e612f9cf5e0, []int{3} -} -func (m *WALMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WALMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WALMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WALMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_WALMessage.Merge(m, src) -} -func (m *WALMessage) XXX_Size() int { - return m.Size() -} -func (m *WALMessage) XXX_DiscardUnknown() { - xxx_messageInfo_WALMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_WALMessage proto.InternalMessageInfo - -type isWALMessage_Sum interface { - isWALMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type WALMessage_EventDataRoundState struct { - EventDataRoundState *types.EventDataRoundState `protobuf:"bytes,1,opt,name=event_data_round_state,json=eventDataRoundState,proto3,oneof" json:"event_data_round_state,omitempty"` -} -type WALMessage_MsgInfo struct { - MsgInfo *MsgInfo `protobuf:"bytes,2,opt,name=msg_info,json=msgInfo,proto3,oneof" json:"msg_info,omitempty"` -} -type WALMessage_TimeoutInfo struct { - TimeoutInfo *TimeoutInfo `protobuf:"bytes,3,opt,name=timeout_info,json=timeoutInfo,proto3,oneof" json:"timeout_info,omitempty"` -} -type WALMessage_EndHeight struct { - EndHeight *EndHeight `protobuf:"bytes,4,opt,name=end_height,json=endHeight,proto3,oneof" json:"end_height,omitempty"` -} - -func (*WALMessage_EventDataRoundState) isWALMessage_Sum() {} -func (*WALMessage_MsgInfo) isWALMessage_Sum() {} -func (*WALMessage_TimeoutInfo) isWALMessage_Sum() {} -func (*WALMessage_EndHeight) isWALMessage_Sum() {} - -func (m *WALMessage) GetSum() isWALMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *WALMessage) GetEventDataRoundState() *types.EventDataRoundState { - if x, ok := m.GetSum().(*WALMessage_EventDataRoundState); ok { - return x.EventDataRoundState - } - return nil -} - -func (m *WALMessage) GetMsgInfo() *MsgInfo { - if x, ok := m.GetSum().(*WALMessage_MsgInfo); ok { - return x.MsgInfo - } - return nil -} - -func (m *WALMessage) GetTimeoutInfo() *TimeoutInfo { - if x, ok := m.GetSum().(*WALMessage_TimeoutInfo); ok { - return x.TimeoutInfo - } - return nil -} - -func (m *WALMessage) GetEndHeight() *EndHeight { - if x, ok := m.GetSum().(*WALMessage_EndHeight); ok { - return x.EndHeight - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*WALMessage) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*WALMessage_EventDataRoundState)(nil), - (*WALMessage_MsgInfo)(nil), - (*WALMessage_TimeoutInfo)(nil), - (*WALMessage_EndHeight)(nil), - } -} - -// TimedWALMessage wraps WALMessage and adds Time for debugging purposes. -type TimedWALMessage struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` - Msg *WALMessage `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` -} - -func (m *TimedWALMessage) Reset() { *m = TimedWALMessage{} } -func (m *TimedWALMessage) String() string { return proto.CompactTextString(m) } -func (*TimedWALMessage) ProtoMessage() {} -func (*TimedWALMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_4c737e612f9cf5e0, []int{4} -} -func (m *TimedWALMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TimedWALMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimedWALMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TimedWALMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimedWALMessage.Merge(m, src) -} -func (m *TimedWALMessage) XXX_Size() int { - return m.Size() -} -func (m *TimedWALMessage) XXX_DiscardUnknown() { - xxx_messageInfo_TimedWALMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_TimedWALMessage proto.InternalMessageInfo - -func (m *TimedWALMessage) GetTime() time.Time { - if m != nil { - return m.Time - } - return time.Time{} -} - -func (m *TimedWALMessage) GetMsg() *WALMessage { - if m != nil { - return m.Msg - } - return nil -} - -func init() { - proto.RegisterType((*MsgInfo)(nil), "ostracon.consensus.MsgInfo") - proto.RegisterType((*TimeoutInfo)(nil), "ostracon.consensus.TimeoutInfo") - proto.RegisterType((*EndHeight)(nil), "ostracon.consensus.EndHeight") - proto.RegisterType((*WALMessage)(nil), "ostracon.consensus.WALMessage") - proto.RegisterType((*TimedWALMessage)(nil), "ostracon.consensus.TimedWALMessage") -} - -func init() { proto.RegisterFile("ostracon/consensus/wal.proto", fileDescriptor_4c737e612f9cf5e0) } - -var fileDescriptor_4c737e612f9cf5e0 = []byte{ - // 548 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcf, 0x8a, 0x13, 0x4f, - 0x10, 0x9e, 0xde, 0x64, 0xf3, 0xa7, 0xf2, 0xfb, 0x21, 0xb4, 0xcb, 0x12, 0xa3, 0x3b, 0x09, 0x59, - 0x84, 0x9c, 0x66, 0xd4, 0xbd, 0xec, 0x49, 0x31, 0x64, 0x21, 0x41, 0x17, 0xa4, 0x5d, 0x10, 0x44, - 0x18, 0x26, 0x99, 0xca, 0x64, 0x20, 0xd3, 0x1d, 0xa6, 0x7b, 0x14, 0x0f, 0xbe, 0x43, 0x8e, 0xbe, - 0x86, 0x6f, 0xb1, 0xc7, 0x3d, 0x7a, 0x5a, 0x25, 0x79, 0x11, 0x99, 0xee, 0x99, 0x24, 0x98, 0x78, - 0xeb, 0xea, 0xaf, 0xaa, 0xbe, 0xaa, 0xef, 0xeb, 0x86, 0x27, 0x42, 0xaa, 0xc4, 0x9f, 0x08, 0xee, - 0x4e, 0x04, 0x97, 0xc8, 0x65, 0x2a, 0xdd, 0x2f, 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 0x5e, 0x66, 0x5e, 0xeb, 0x0a, 0xfa, 0xcc, 0x3c, 0x49, 0x23, 0x87, 0x7d, - 0x68, 0x98, 0x2d, 0x8d, 0x7e, 0x8f, 0xfd, 0x37, 0xb7, 0x2b, 0x9b, 0xdc, 0xad, 0x6c, 0xf2, 0x7b, - 0x65, 0x93, 0xe5, 0xda, 0xb6, 0xee, 0xd6, 0xb6, 0xf5, 0x73, 0x6d, 0x5b, 0x1f, 0x9f, 0x87, 0x91, - 0x9a, 0xa5, 0x63, 0x67, 0x22, 0x62, 0x77, 0x1e, 0x71, 0x74, 0x37, 0x3f, 0xcf, 0x7c, 0xca, 0xfd, - 0x8f, 0x38, 0xae, 0x68, 0xe4, 0xe2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x85, 0x7e, 0x3b, 0xd4, - 0xed, 0x03, 0x00, 0x00, -} - -func (m *MsgInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PeerID) > 0 { - i -= len(m.PeerID) - copy(dAtA[i:], m.PeerID) - i = encodeVarintWal(dAtA, i, uint64(len(m.PeerID))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *TimeoutInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TimeoutInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeoutInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Step != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x20 - } - if m.Round != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x18 - } - if m.Height != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintWal(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *EndHeight) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EndHeight) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *WALMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WALMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *WALMessage_EventDataRoundState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_EventDataRoundState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EventDataRoundState != nil { - { - size, err := m.EventDataRoundState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *WALMessage_MsgInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_MsgInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgInfo != nil { - { - size, err := m.MsgInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *WALMessage_TimeoutInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_TimeoutInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.TimeoutInfo != nil { - { - size, err := m.TimeoutInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *WALMessage_EndHeight) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_EndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EndHeight != nil { - { - size, err := m.EndHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *TimedWALMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TimedWALMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimedWALMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Msg != nil { - { - size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintWal(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintWal(dAtA []byte, offset int, v uint64) int { - offset -= sovWal(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Msg.Size() - n += 1 + l + sovWal(uint64(l)) - l = len(m.PeerID) - if l > 0 { - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func (m *TimeoutInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovWal(uint64(l)) - if m.Height != 0 { - n += 1 + sovWal(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovWal(uint64(m.Round)) - } - if m.Step != 0 { - n += 1 + sovWal(uint64(m.Step)) - } - return n -} - -func (m *EndHeight) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovWal(uint64(m.Height)) - } - return n -} - -func (m *WALMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *WALMessage_EventDataRoundState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EventDataRoundState != nil { - l = m.EventDataRoundState.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} -func (m *WALMessage_MsgInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgInfo != nil { - l = m.MsgInfo.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} -func (m *WALMessage_TimeoutInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TimeoutInfo != nil { - l = m.TimeoutInfo.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} -func (m *WALMessage_EndHeight) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EndHeight != nil { - l = m.EndHeight.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} -func (m *TimedWALMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) - n += 1 + l + sovWal(uint64(l)) - if m.Msg != nil { - l = m.Msg.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func sovWal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozWal(x uint64) (n int) { - return sovWal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TimeoutInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TimeoutInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimeoutInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - m.Step = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EndHeight) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EndHeight: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EndHeight: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WALMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WALMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WALMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EventDataRoundState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.EventDataRoundState{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_EventDataRoundState{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MsgInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_MsgInfo{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TimeoutInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_TimeoutInfo{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &EndHeight{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_EndHeight{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TimedWALMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TimedWALMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimedWALMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Msg == nil { - m.Msg = &WALMessage{} - } - if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipWal(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthWal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupWal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthWal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthWal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupWal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/consensus/wal.proto b/proto/ostracon/consensus/wal.proto deleted file mode 100644 index e915658ce..000000000 --- a/proto/ostracon/consensus/wal.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; -package ostracon.consensus; - -option go_package = "github.com/line/ostracon/proto/ostracon/consensus"; - -import "gogoproto/gogo.proto"; -import "ostracon/consensus/types.proto"; -import "tendermint/types/events.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// MsgInfo are msgs from the reactor which may update the state -message MsgInfo { - Message msg = 1 [(gogoproto.nullable) = false]; - string peer_id = 2 [(gogoproto.customname) = "PeerID"]; -} - -// TimeoutInfo internally generated messages which may update the state -message TimeoutInfo { - google.protobuf.Duration duration = 1 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - int64 height = 2; - int32 round = 3; - uint32 step = 4; -} - -// EndHeight marks the end of the given height inside WAL. -// @internal used by scripts/wal2json util. -message EndHeight { - int64 height = 1; -} - -message WALMessage { - oneof sum { - tendermint.types.EventDataRoundState event_data_round_state = 1; - MsgInfo msg_info = 2; - TimeoutInfo timeout_info = 3; - EndHeight end_height = 4; - } -} - -// TimedWALMessage wraps WALMessage and adds Time for debugging purposes. -message TimedWALMessage { - google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - WALMessage msg = 2; -} diff --git a/third_party/proto/tendermint/blockchain/types.proto b/third_party/proto/tendermint/blockchain/types.proto new file mode 100644 index 000000000..f5c143cf5 --- /dev/null +++ b/third_party/proto/tendermint/blockchain/types.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package tendermint.blockchain; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/blockchain"; + +import "tendermint/types/block.proto"; + +// BlockRequest requests a block for a specific height +message BlockRequest { + int64 height = 1; +} + +// NoBlockResponse informs the node that the peer does not have block at the requested height +message NoBlockResponse { + int64 height = 1; +} + +// BlockResponse returns block to the requested +message BlockResponse { + tendermint.types.Block block = 1; +} + +// StatusRequest requests the status of a peer. +message StatusRequest { +} + +// StatusResponse is a peer response to inform their status. +message StatusResponse { + int64 height = 1; + int64 base = 2; +} + +message Message { + oneof sum { + BlockRequest block_request = 1; + NoBlockResponse no_block_response = 2; + BlockResponse block_response = 3; + StatusRequest status_request = 4; + StatusResponse status_response = 5; + } +} From fbe0cfe198c6c8a4bf256719788a094733ad16f1 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 7 Jan 2023 02:34:52 +0900 Subject: [PATCH 10/25] feat: clean up `proto/ostracon/privval` proto directory --- privval/msgs.go | 16 +- privval/msgs_test.go | 27 +- privval/signer_client.go | 7 +- privval/signer_client_test.go | 3 +- privval/signer_listener_endpoint.go | 4 +- privval/signer_requestHandler.go | 29 +- proto/ostracon/privval/types.pb.go | 1883 ++--------------- proto/ostracon/privval/types.proto | 85 +- test/kms/bench_test.go | 3 +- .../proto/tendermint/privval/types.proto | 76 + 10 files changed, 311 insertions(+), 1822 deletions(-) create mode 100644 third_party/proto/tendermint/privval/types.proto diff --git a/privval/msgs.go b/privval/msgs.go index 13644a64d..3e2a0024a 100644 --- a/privval/msgs.go +++ b/privval/msgs.go @@ -5,6 +5,8 @@ import ( "github.com/gogo/protobuf/proto" + tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/line/ostracon/proto/ostracon/privval" ) @@ -16,25 +18,25 @@ func mustWrapMsg(pb proto.Message) privvalproto.Message { switch pb := pb.(type) { case *privvalproto.Message: msg = *pb - case *privvalproto.PubKeyRequest: + case *tmprivvalproto.PubKeyRequest: msg.Sum = &privvalproto.Message_PubKeyRequest{PubKeyRequest: pb} case *privvalproto.PubKeyResponse: msg.Sum = &privvalproto.Message_PubKeyResponse{PubKeyResponse: pb} - case *privvalproto.SignVoteRequest: + case *tmprivvalproto.SignVoteRequest: msg.Sum = &privvalproto.Message_SignVoteRequest{SignVoteRequest: pb} - case *privvalproto.SignedVoteResponse: + case *tmprivvalproto.SignedVoteResponse: msg.Sum = &privvalproto.Message_SignedVoteResponse{SignedVoteResponse: pb} - case *privvalproto.SignedProposalResponse: + case *tmprivvalproto.SignedProposalResponse: msg.Sum = &privvalproto.Message_SignedProposalResponse{SignedProposalResponse: pb} - case *privvalproto.SignProposalRequest: + case *tmprivvalproto.SignProposalRequest: msg.Sum = &privvalproto.Message_SignProposalRequest{SignProposalRequest: pb} case *privvalproto.VRFProofRequest: msg.Sum = &privvalproto.Message_VrfProofRequest{VrfProofRequest: pb} case *privvalproto.VRFProofResponse: msg.Sum = &privvalproto.Message_VrfProofResponse{VrfProofResponse: pb} - case *privvalproto.PingRequest: + case *tmprivvalproto.PingRequest: msg.Sum = &privvalproto.Message_PingRequest{PingRequest: pb} - case *privvalproto.PingResponse: + case *tmprivvalproto.PingResponse: msg.Sum = &privvalproto.Message_PingResponse{PingResponse: pb} default: panic(fmt.Errorf("unknown message type %T", pb)) diff --git a/privval/msgs_test.go b/privval/msgs_test.go index 53ef049f1..556d0bd1e 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/gogo/protobuf/proto" @@ -15,7 +16,7 @@ import ( cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/tmhash" cryptoproto "github.com/line/ostracon/proto/ostracon/crypto" - privproto "github.com/line/ostracon/proto/ostracon/privval" + privvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) @@ -73,24 +74,24 @@ func TestPrivvalVectors(t *testing.T) { proposalpb := proposal.ToProto() // Create a Reuseable remote error - remoteError := &privproto.RemoteSignerError{Code: 1, Description: "it's a error"} + remoteError := &tmprivvalproto.RemoteSignerError{Code: 1, Description: "it's a error"} testCases := []struct { testName string msg proto.Message expBytes string }{ - {"ping request", &privproto.PingRequest{}, "3a00"}, - {"ping response", &privproto.PingResponse{}, "4200"}, - {"pubKey request", &privproto.PubKeyRequest{}, "0a00"}, - {"pubKey response", &privproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, - {"pubKey response with error", &privproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, - {"Vote Request", &privproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, - {"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, - {"Vote Response with error", &privproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, - {"Proposal Request", &privproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, - {"Proposal Response", &privproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, - {"Proposal Response with error", &privproto.SignedProposalResponse{Proposal: tmproto.Proposal{}, Error: remoteError}, "32250a112a021200320b088092b8c398feffffff0112100801120c697427732061206572726f72"}, + {"ping request", &tmprivvalproto.PingRequest{}, "3a00"}, + {"ping response", &tmprivvalproto.PingResponse{}, "4200"}, + {"pubKey request", &tmprivvalproto.PubKeyRequest{}, "0a00"}, + {"pubKey response", &privvalproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, + {"pubKey response with error", &privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, + {"Vote Request", &tmprivvalproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, + {"Vote Response", &tmprivvalproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, + {"Vote Response with error", &tmprivvalproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, + {"Proposal Request", &tmprivvalproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, + {"Proposal Response", &tmprivvalproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, + {"Proposal Response with error", &tmprivvalproto.SignedProposalResponse{Proposal: tmproto.Proposal{}, Error: remoteError}, "32250a112a021200320b088092b8c398feffffff0112100801120c697427732061206572726f72"}, } for _, tc := range testCases { diff --git a/privval/signer_client.go b/privval/signer_client.go index 5c76b01d4..44c529176 100644 --- a/privval/signer_client.go +++ b/privval/signer_client.go @@ -4,6 +4,7 @@ import ( "fmt" "time" + tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" @@ -54,7 +55,7 @@ func (sc *SignerClient) WaitForConnection(maxWait time.Duration) error { // GetPubKey retrieves a public key from a remote signer // returns an error if client is not able to provide the key func (sc *SignerClient) GetPubKey() (crypto.PubKey, error) { - response, err := sc.endpoint.SendRequest(mustWrapMsg(&privvalproto.PubKeyRequest{ChainId: sc.chainID})) + response, err := sc.endpoint.SendRequest(mustWrapMsg(&tmprivvalproto.PubKeyRequest{ChainId: sc.chainID})) if err != nil { return nil, fmt.Errorf("send: %w", err) } @@ -77,7 +78,7 @@ func (sc *SignerClient) GetPubKey() (crypto.PubKey, error) { // SignVote requests a remote signer to sign a vote func (sc *SignerClient) SignVote(chainID string, vote *tmproto.Vote) error { - response, err := sc.endpoint.SendRequest(mustWrapMsg(&privvalproto.SignVoteRequest{Vote: vote, ChainId: chainID})) + response, err := sc.endpoint.SendRequest(mustWrapMsg(&tmprivvalproto.SignVoteRequest{Vote: vote, ChainId: chainID})) if err != nil { return err } @@ -98,7 +99,7 @@ func (sc *SignerClient) SignVote(chainID string, vote *tmproto.Vote) error { // SignProposal requests a remote signer to sign a proposal func (sc *SignerClient) SignProposal(chainID string, proposal *tmproto.Proposal) error { response, err := sc.endpoint.SendRequest(mustWrapMsg( - &privvalproto.SignProposalRequest{Proposal: proposal, ChainId: chainID}, + &tmprivvalproto.SignProposalRequest{Proposal: proposal, ChainId: chainID}, )) if err != nil { return err diff --git a/privval/signer_client_test.go b/privval/signer_client_test.go index 3357e53d6..8a1b3428b 100644 --- a/privval/signer_client_test.go +++ b/privval/signer_client_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" @@ -422,7 +423,7 @@ func brokenHandler(privVal types.PrivValidator, request privvalproto.Message, case *privvalproto.Message_SignProposalRequest: res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) case *privvalproto.Message_PingRequest: - err, res = nil, mustWrapMsg(&privvalproto.PingResponse{}) + err, res = nil, mustWrapMsg(&tmprivvalproto.PingResponse{}) default: err = fmt.Errorf("unknown msg: %v", r) } diff --git a/privval/signer_listener_endpoint.go b/privval/signer_listener_endpoint.go index b4ed8c5cb..00b13fa3d 100644 --- a/privval/signer_listener_endpoint.go +++ b/privval/signer_listener_endpoint.go @@ -5,6 +5,8 @@ import ( "net" "time" + tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" @@ -210,7 +212,7 @@ func (sl *SignerListenerEndpoint) pingLoop() { select { case <-sl.pingTimer.C: { - _, err := sl.SendRequest(mustWrapMsg(&privvalproto.PingRequest{})) + _, err := sl.SendRequest(mustWrapMsg(&tmprivvalproto.PingRequest{})) if err != nil { sl.Logger.Error("SignerListener: Ping timeout") sl.triggerReconnect() diff --git a/privval/signer_requestHandler.go b/privval/signer_requestHandler.go index 605e21590..00f51243e 100644 --- a/privval/signer_requestHandler.go +++ b/privval/signer_requestHandler.go @@ -3,6 +3,7 @@ package privval import ( "fmt" + tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" @@ -26,7 +27,7 @@ func DefaultValidationRequestHandler( case *privvalproto.Message_PubKeyRequest: if r.PubKeyRequest.GetChainId() != chainID { res = mustWrapMsg(&privvalproto.PubKeyResponse{ - PubKey: cryptoproto.PublicKey{}, Error: &privvalproto.RemoteSignerError{ + PubKey: cryptoproto.PublicKey{}, Error: &tmprivvalproto.RemoteSignerError{ Code: 0, Description: "unable to provide pubkey"}}) return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.PubKeyRequest.GetChainId(), chainID) } @@ -43,15 +44,15 @@ func DefaultValidationRequestHandler( if err != nil { res = mustWrapMsg(&privvalproto.PubKeyResponse{ - PubKey: cryptoproto.PublicKey{}, Error: &privvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) + PubKey: cryptoproto.PublicKey{}, Error: &tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) } else { res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: pk, Error: nil}) } case *privvalproto.Message_SignVoteRequest: if r.SignVoteRequest.ChainId != chainID { - res = mustWrapMsg(&privvalproto.SignedVoteResponse{ - Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{ + res = mustWrapMsg(&tmprivvalproto.SignedVoteResponse{ + Vote: tmproto.Vote{}, Error: &tmprivvalproto.RemoteSignerError{ Code: 0, Description: "unable to sign vote"}}) return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.SignVoteRequest.GetChainId(), chainID) } @@ -60,16 +61,16 @@ func DefaultValidationRequestHandler( err = privVal.SignVote(chainID, vote) if err != nil { - res = mustWrapMsg(&privvalproto.SignedVoteResponse{ - Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) + res = mustWrapMsg(&tmprivvalproto.SignedVoteResponse{ + Vote: tmproto.Vote{}, Error: &tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) } else { - res = mustWrapMsg(&privvalproto.SignedVoteResponse{Vote: *vote, Error: nil}) + res = mustWrapMsg(&tmprivvalproto.SignedVoteResponse{Vote: *vote, Error: nil}) } case *privvalproto.Message_SignProposalRequest: if r.SignProposalRequest.GetChainId() != chainID { - res = mustWrapMsg(&privvalproto.SignedProposalResponse{ - Proposal: tmproto.Proposal{}, Error: &privvalproto.RemoteSignerError{ + res = mustWrapMsg(&tmprivvalproto.SignedProposalResponse{ + Proposal: tmproto.Proposal{}, Error: &tmprivvalproto.RemoteSignerError{ Code: 0, Description: "unable to sign proposal"}}) return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.SignProposalRequest.GetChainId(), chainID) @@ -79,18 +80,18 @@ func DefaultValidationRequestHandler( err = privVal.SignProposal(chainID, proposal) if err != nil { - res = mustWrapMsg(&privvalproto.SignedProposalResponse{ - Proposal: tmproto.Proposal{}, Error: &privvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) + res = mustWrapMsg(&tmprivvalproto.SignedProposalResponse{ + Proposal: tmproto.Proposal{}, Error: &tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) } else { - res = mustWrapMsg(&privvalproto.SignedProposalResponse{Proposal: *proposal, Error: nil}) + res = mustWrapMsg(&tmprivvalproto.SignedProposalResponse{Proposal: *proposal, Error: nil}) } case *privvalproto.Message_PingRequest: - err, res = nil, mustWrapMsg(&privvalproto.PingResponse{}) + err, res = nil, mustWrapMsg(&tmprivvalproto.PingResponse{}) case *privvalproto.Message_VrfProofRequest: proof, err := privVal.GenerateVRFProof(r.VrfProofRequest.Message) if err != nil { - err := privvalproto.RemoteSignerError{Code: 0, Description: err.Error()} + err := tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()} res = mustWrapMsg(&privvalproto.VRFProofResponse{Proof: nil, Error: &err}) } else { res = mustWrapMsg(&privvalproto.VRFProofResponse{Proof: proof[:], Error: nil}) diff --git a/proto/ostracon/privval/types.pb.go b/proto/ostracon/privval/types.pb.go index ca3038c70..b33d056bc 100644 --- a/proto/ostracon/privval/types.pb.go +++ b/proto/ostracon/privval/types.pb.go @@ -8,7 +8,8 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" crypto "github.com/line/ostracon/proto/ostracon/crypto" - types "github.com/tendermint/tendermint/proto/tendermint/types" + privval "github.com/tendermint/tendermint/proto/tendermint/privval" + _ "github.com/tendermint/tendermint/proto/tendermint/types" io "io" math "math" math_bits "math/bits" @@ -25,151 +26,17 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type Errors int32 - -const ( - Errors_ERRORS_UNKNOWN Errors = 0 - Errors_ERRORS_UNEXPECTED_RESPONSE Errors = 1 - Errors_ERRORS_NO_CONNECTION Errors = 2 - Errors_ERRORS_CONNECTION_TIMEOUT Errors = 3 - Errors_ERRORS_READ_TIMEOUT Errors = 4 - Errors_ERRORS_WRITE_TIMEOUT Errors = 5 -) - -var Errors_name = map[int32]string{ - 0: "ERRORS_UNKNOWN", - 1: "ERRORS_UNEXPECTED_RESPONSE", - 2: "ERRORS_NO_CONNECTION", - 3: "ERRORS_CONNECTION_TIMEOUT", - 4: "ERRORS_READ_TIMEOUT", - 5: "ERRORS_WRITE_TIMEOUT", -} - -var Errors_value = map[string]int32{ - "ERRORS_UNKNOWN": 0, - "ERRORS_UNEXPECTED_RESPONSE": 1, - "ERRORS_NO_CONNECTION": 2, - "ERRORS_CONNECTION_TIMEOUT": 3, - "ERRORS_READ_TIMEOUT": 4, - "ERRORS_WRITE_TIMEOUT": 5, -} - -func (x Errors) String() string { - return proto.EnumName(Errors_name, int32(x)) -} - -func (Errors) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{0} -} - -type RemoteSignerError struct { - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (m *RemoteSignerError) Reset() { *m = RemoteSignerError{} } -func (m *RemoteSignerError) String() string { return proto.CompactTextString(m) } -func (*RemoteSignerError) ProtoMessage() {} -func (*RemoteSignerError) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{0} -} -func (m *RemoteSignerError) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RemoteSignerError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoteSignerError.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RemoteSignerError) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoteSignerError.Merge(m, src) -} -func (m *RemoteSignerError) XXX_Size() int { - return m.Size() -} -func (m *RemoteSignerError) XXX_DiscardUnknown() { - xxx_messageInfo_RemoteSignerError.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoteSignerError proto.InternalMessageInfo - -func (m *RemoteSignerError) GetCode() int32 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *RemoteSignerError) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -// PubKeyRequest requests the consensus public key from the remote signer. -type PubKeyRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *PubKeyRequest) Reset() { *m = PubKeyRequest{} } -func (m *PubKeyRequest) String() string { return proto.CompactTextString(m) } -func (*PubKeyRequest) ProtoMessage() {} -func (*PubKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{1} -} -func (m *PubKeyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKeyRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PubKeyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKeyRequest.Merge(m, src) -} -func (m *PubKeyRequest) XXX_Size() int { - return m.Size() -} -func (m *PubKeyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PubKeyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKeyRequest proto.InternalMessageInfo - -func (m *PubKeyRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - // PubKeyResponse is a response message containing the public key. type PubKeyResponse struct { - PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` + Error *privval.RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` } func (m *PubKeyResponse) Reset() { *m = PubKeyResponse{} } func (m *PubKeyResponse) String() string { return proto.CompactTextString(m) } func (*PubKeyResponse) ProtoMessage() {} func (*PubKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{2} + return fileDescriptor_abbbbe5131a55005, []int{0} } func (m *PubKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -205,219 +72,7 @@ func (m *PubKeyResponse) GetPubKey() crypto.PublicKey { return crypto.PublicKey{} } -func (m *PubKeyResponse) GetError() *RemoteSignerError { - if m != nil { - return m.Error - } - return nil -} - -// SignVoteRequest is a request to sign a vote -type SignVoteRequest struct { - Vote *types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *SignVoteRequest) Reset() { *m = SignVoteRequest{} } -func (m *SignVoteRequest) String() string { return proto.CompactTextString(m) } -func (*SignVoteRequest) ProtoMessage() {} -func (*SignVoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{3} -} -func (m *SignVoteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignVoteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignVoteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignVoteRequest.Merge(m, src) -} -func (m *SignVoteRequest) XXX_Size() int { - return m.Size() -} -func (m *SignVoteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignVoteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignVoteRequest proto.InternalMessageInfo - -func (m *SignVoteRequest) GetVote() *types.Vote { - if m != nil { - return m.Vote - } - return nil -} - -func (m *SignVoteRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// SignedVoteResponse is a response containing a signed vote or an error -type SignedVoteResponse struct { - Vote types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` - Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *SignedVoteResponse) Reset() { *m = SignedVoteResponse{} } -func (m *SignedVoteResponse) String() string { return proto.CompactTextString(m) } -func (*SignedVoteResponse) ProtoMessage() {} -func (*SignedVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{4} -} -func (m *SignedVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignedVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedVoteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignedVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedVoteResponse.Merge(m, src) -} -func (m *SignedVoteResponse) XXX_Size() int { - return m.Size() -} -func (m *SignedVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SignedVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedVoteResponse proto.InternalMessageInfo - -func (m *SignedVoteResponse) GetVote() types.Vote { - if m != nil { - return m.Vote - } - return types.Vote{} -} - -func (m *SignedVoteResponse) GetError() *RemoteSignerError { - if m != nil { - return m.Error - } - return nil -} - -// SignProposalRequest is a request to sign a proposal -type SignProposalRequest struct { - Proposal *types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *SignProposalRequest) Reset() { *m = SignProposalRequest{} } -func (m *SignProposalRequest) String() string { return proto.CompactTextString(m) } -func (*SignProposalRequest) ProtoMessage() {} -func (*SignProposalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{5} -} -func (m *SignProposalRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignProposalRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignProposalRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignProposalRequest.Merge(m, src) -} -func (m *SignProposalRequest) XXX_Size() int { - return m.Size() -} -func (m *SignProposalRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignProposalRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignProposalRequest proto.InternalMessageInfo - -func (m *SignProposalRequest) GetProposal() *types.Proposal { - if m != nil { - return m.Proposal - } - return nil -} - -func (m *SignProposalRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// SignedProposalResponse is response containing a signed proposal or an error -type SignedProposalResponse struct { - Proposal types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` - Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *SignedProposalResponse) Reset() { *m = SignedProposalResponse{} } -func (m *SignedProposalResponse) String() string { return proto.CompactTextString(m) } -func (*SignedProposalResponse) ProtoMessage() {} -func (*SignedProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{6} -} -func (m *SignedProposalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignedProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedProposalResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignedProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedProposalResponse.Merge(m, src) -} -func (m *SignedProposalResponse) XXX_Size() int { - return m.Size() -} -func (m *SignedProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SignedProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedProposalResponse proto.InternalMessageInfo - -func (m *SignedProposalResponse) GetProposal() types.Proposal { - if m != nil { - return m.Proposal - } - return types.Proposal{} -} - -func (m *SignedProposalResponse) GetError() *RemoteSignerError { +func (m *PubKeyResponse) GetError() *privval.RemoteSignerError { if m != nil { return m.Error } @@ -433,7 +88,7 @@ func (m *VRFProofRequest) Reset() { *m = VRFProofRequest{} } func (m *VRFProofRequest) String() string { return proto.CompactTextString(m) } func (*VRFProofRequest) ProtoMessage() {} func (*VRFProofRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{7} + return fileDescriptor_abbbbe5131a55005, []int{1} } func (m *VRFProofRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -471,15 +126,15 @@ func (m *VRFProofRequest) GetMessage() []byte { // VRFProofResponse is a PrivValidatorSocket message containing a Proof. type VRFProofResponse struct { - Proof []byte `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` - Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Proof []byte `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` + Error *privval.RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` } func (m *VRFProofResponse) Reset() { *m = VRFProofResponse{} } func (m *VRFProofResponse) String() string { return proto.CompactTextString(m) } func (*VRFProofResponse) ProtoMessage() {} func (*VRFProofResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{8} + return fileDescriptor_abbbbe5131a55005, []int{2} } func (m *VRFProofResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -515,87 +170,13 @@ func (m *VRFProofResponse) GetProof() []byte { return nil } -func (m *VRFProofResponse) GetError() *RemoteSignerError { +func (m *VRFProofResponse) GetError() *privval.RemoteSignerError { if m != nil { return m.Error } return nil } -// PingRequest is a request to confirm that the connection is alive. -type PingRequest struct { -} - -func (m *PingRequest) Reset() { *m = PingRequest{} } -func (m *PingRequest) String() string { return proto.CompactTextString(m) } -func (*PingRequest) ProtoMessage() {} -func (*PingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{9} -} -func (m *PingRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingRequest.Merge(m, src) -} -func (m *PingRequest) XXX_Size() int { - return m.Size() -} -func (m *PingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PingRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PingRequest proto.InternalMessageInfo - -// PingResponse is a response to confirm that the connection is alive. -type PingResponse struct { -} - -func (m *PingResponse) Reset() { *m = PingResponse{} } -func (m *PingResponse) String() string { return proto.CompactTextString(m) } -func (*PingResponse) ProtoMessage() {} -func (*PingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{10} -} -func (m *PingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingResponse.Merge(m, src) -} -func (m *PingResponse) XXX_Size() int { - return m.Size() -} -func (m *PingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PingResponse proto.InternalMessageInfo - type Message struct { // Types that are valid to be assigned to Sum: // *Message_PubKeyRequest @@ -615,7 +196,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{11} + return fileDescriptor_abbbbe5131a55005, []int{3} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -651,28 +232,28 @@ type isMessage_Sum interface { } type Message_PubKeyRequest struct { - PubKeyRequest *PubKeyRequest `protobuf:"bytes,1,opt,name=pub_key_request,json=pubKeyRequest,proto3,oneof" json:"pub_key_request,omitempty"` + PubKeyRequest *privval.PubKeyRequest `protobuf:"bytes,1,opt,name=pub_key_request,json=pubKeyRequest,proto3,oneof" json:"pub_key_request,omitempty"` } type Message_PubKeyResponse struct { PubKeyResponse *PubKeyResponse `protobuf:"bytes,2,opt,name=pub_key_response,json=pubKeyResponse,proto3,oneof" json:"pub_key_response,omitempty"` } type Message_SignVoteRequest struct { - SignVoteRequest *SignVoteRequest `protobuf:"bytes,3,opt,name=sign_vote_request,json=signVoteRequest,proto3,oneof" json:"sign_vote_request,omitempty"` + SignVoteRequest *privval.SignVoteRequest `protobuf:"bytes,3,opt,name=sign_vote_request,json=signVoteRequest,proto3,oneof" json:"sign_vote_request,omitempty"` } type Message_SignedVoteResponse struct { - SignedVoteResponse *SignedVoteResponse `protobuf:"bytes,4,opt,name=signed_vote_response,json=signedVoteResponse,proto3,oneof" json:"signed_vote_response,omitempty"` + SignedVoteResponse *privval.SignedVoteResponse `protobuf:"bytes,4,opt,name=signed_vote_response,json=signedVoteResponse,proto3,oneof" json:"signed_vote_response,omitempty"` } type Message_SignProposalRequest struct { - SignProposalRequest *SignProposalRequest `protobuf:"bytes,5,opt,name=sign_proposal_request,json=signProposalRequest,proto3,oneof" json:"sign_proposal_request,omitempty"` + SignProposalRequest *privval.SignProposalRequest `protobuf:"bytes,5,opt,name=sign_proposal_request,json=signProposalRequest,proto3,oneof" json:"sign_proposal_request,omitempty"` } type Message_SignedProposalResponse struct { - SignedProposalResponse *SignedProposalResponse `protobuf:"bytes,6,opt,name=signed_proposal_response,json=signedProposalResponse,proto3,oneof" json:"signed_proposal_response,omitempty"` + SignedProposalResponse *privval.SignedProposalResponse `protobuf:"bytes,6,opt,name=signed_proposal_response,json=signedProposalResponse,proto3,oneof" json:"signed_proposal_response,omitempty"` } type Message_PingRequest struct { - PingRequest *PingRequest `protobuf:"bytes,7,opt,name=ping_request,json=pingRequest,proto3,oneof" json:"ping_request,omitempty"` + PingRequest *privval.PingRequest `protobuf:"bytes,7,opt,name=ping_request,json=pingRequest,proto3,oneof" json:"ping_request,omitempty"` } type Message_PingResponse struct { - PingResponse *PingResponse `protobuf:"bytes,8,opt,name=ping_response,json=pingResponse,proto3,oneof" json:"ping_response,omitempty"` + PingResponse *privval.PingResponse `protobuf:"bytes,8,opt,name=ping_response,json=pingResponse,proto3,oneof" json:"ping_response,omitempty"` } type Message_VrfProofRequest struct { VrfProofRequest *VRFProofRequest `protobuf:"bytes,1000,opt,name=vrf_proof_request,json=vrfProofRequest,proto3,oneof" json:"vrf_proof_request,omitempty"` @@ -699,7 +280,7 @@ func (m *Message) GetSum() isMessage_Sum { return nil } -func (m *Message) GetPubKeyRequest() *PubKeyRequest { +func (m *Message) GetPubKeyRequest() *privval.PubKeyRequest { if x, ok := m.GetSum().(*Message_PubKeyRequest); ok { return x.PubKeyRequest } @@ -713,42 +294,42 @@ func (m *Message) GetPubKeyResponse() *PubKeyResponse { return nil } -func (m *Message) GetSignVoteRequest() *SignVoteRequest { +func (m *Message) GetSignVoteRequest() *privval.SignVoteRequest { if x, ok := m.GetSum().(*Message_SignVoteRequest); ok { return x.SignVoteRequest } return nil } -func (m *Message) GetSignedVoteResponse() *SignedVoteResponse { +func (m *Message) GetSignedVoteResponse() *privval.SignedVoteResponse { if x, ok := m.GetSum().(*Message_SignedVoteResponse); ok { return x.SignedVoteResponse } return nil } -func (m *Message) GetSignProposalRequest() *SignProposalRequest { +func (m *Message) GetSignProposalRequest() *privval.SignProposalRequest { if x, ok := m.GetSum().(*Message_SignProposalRequest); ok { return x.SignProposalRequest } return nil } -func (m *Message) GetSignedProposalResponse() *SignedProposalResponse { +func (m *Message) GetSignedProposalResponse() *privval.SignedProposalResponse { if x, ok := m.GetSum().(*Message_SignedProposalResponse); ok { return x.SignedProposalResponse } return nil } -func (m *Message) GetPingRequest() *PingRequest { +func (m *Message) GetPingRequest() *privval.PingRequest { if x, ok := m.GetSum().(*Message_PingRequest); ok { return x.PingRequest } return nil } -func (m *Message) GetPingResponse() *PingResponse { +func (m *Message) GetPingResponse() *privval.PingResponse { if x, ok := m.GetSum().(*Message_PingResponse); ok { return x.PingResponse } @@ -786,81 +367,56 @@ func (*Message) XXX_OneofWrappers() []interface{} { } func init() { - proto.RegisterEnum("ostracon.privval.Errors", Errors_name, Errors_value) - proto.RegisterType((*RemoteSignerError)(nil), "ostracon.privval.RemoteSignerError") - proto.RegisterType((*PubKeyRequest)(nil), "ostracon.privval.PubKeyRequest") proto.RegisterType((*PubKeyResponse)(nil), "ostracon.privval.PubKeyResponse") - proto.RegisterType((*SignVoteRequest)(nil), "ostracon.privval.SignVoteRequest") - proto.RegisterType((*SignedVoteResponse)(nil), "ostracon.privval.SignedVoteResponse") - proto.RegisterType((*SignProposalRequest)(nil), "ostracon.privval.SignProposalRequest") - proto.RegisterType((*SignedProposalResponse)(nil), "ostracon.privval.SignedProposalResponse") proto.RegisterType((*VRFProofRequest)(nil), "ostracon.privval.VRFProofRequest") proto.RegisterType((*VRFProofResponse)(nil), "ostracon.privval.VRFProofResponse") - proto.RegisterType((*PingRequest)(nil), "ostracon.privval.PingRequest") - proto.RegisterType((*PingResponse)(nil), "ostracon.privval.PingResponse") proto.RegisterType((*Message)(nil), "ostracon.privval.Message") } func init() { proto.RegisterFile("ostracon/privval/types.proto", fileDescriptor_abbbbe5131a55005) } var fileDescriptor_abbbbe5131a55005 = []byte{ - // 845 bytes of a gzipped FileDescriptorProto - 0x1f, 0x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, 0xe0, 0x50, 0xed, 0x5b, 0xb6, 0x7b, 0x6e, 0x5b, 0x96, - 0x79, 0xde, 0xeb, 0xd8, 0x56, 0x75, 0x03, 0x3d, 0x86, 0x87, 0x6a, 0x27, 0x2f, 0xbb, 0xbd, 0xce, - 0x0b, 0xd3, 0x7e, 0xd9, 0xab, 0x6e, 0xa2, 0x8f, 0xe1, 0x40, 0x6d, 0x63, 0xf3, 0xdb, 0xe7, 0xd9, - 0x46, 0x61, 0x86, 0xf8, 0x1a, 0x77, 0x7a, 0x66, 0xb6, 0x53, 0x3c, 0xeb, 0xbc, 0xbd, 0x6d, 0xe8, - 0xef, 0x6e, 0x1b, 0xfa, 0xdf, 0xb7, 0x0d, 0xfd, 0xd7, 0xbb, 0x86, 0xf6, 0xee, 0xae, 0xa1, 0xfd, - 0x79, 0xd7, 0xd0, 0x7e, 0x68, 0xf9, 0x41, 0x7c, 0x3d, 0x1e, 0x18, 0x1e, 0x1d, 0xb5, 0x6e, 0x82, - 0x90, 0xb4, 0x66, 0xbe, 0x16, 0x92, 0xbf, 0xf9, 0xc5, 0x8f, 0x87, 0x41, 0x49, 0xd4, 0xbf, 0xfa, - 0x2f, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x37, 0x44, 0x89, 0x57, 0x08, 0x00, 0x00, -} - -func (m *RemoteSignerError) Marshal() (dAtA []byte, err error) { + // 578 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x4d, 0x6f, 0xd3, 0x30, + 0x18, 0xc7, 0x13, 0xb6, 0xb6, 0xe8, 0x59, 0xb7, 0x76, 0xa6, 0xa0, 0xaa, 0x9a, 0xb2, 0x51, 0xc4, + 0x8b, 0x40, 0x4a, 0x24, 0x38, 0x21, 0x6e, 0x15, 0x2f, 0x43, 0x05, 0xa9, 0x64, 0xd2, 0x0e, 0x93, + 0x50, 0xd5, 0x97, 0xa7, 0x21, 0x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 0x51, + 0xad, 0xf0, 0x74, 0xbb, 0x7e, 0x06, 0x4b, 0xb7, 0x70, 0x4f, 0x6c, 0x9c, 0x21, 0xaf, 0xa1, 0xcc, + 0xfc, 0xc0, 0x4b, 0xed, 0x4b, 0x8a, 0x7d, 0xbc, 0xb1, 0x1b, 0xfc, 0xc0, 0xcb, 0xac, 0xf7, 0x58, + 0x36, 0x24, 0xef, 0x60, 0x5f, 0x53, 0xb4, 0xe2, 0x6d, 0xdd, 0x06, 0x5b, 0x31, 0xa9, 0x58, 0x99, + 0xe5, 0xc6, 0xa4, 0x03, 0x87, 0x53, 0x3e, 0xea, 0xaa, 0xae, 0x4f, 0x9d, 0xfe, 0x94, 0x74, 0x8b, + 0xae, 0x35, 0xd5, 0xca, 0xbf, 0x16, 0xf7, 0xc0, 0x94, 0x8f, 0x96, 0x7e, 0xbf, 0x33, 0x20, 0x79, + 0xa2, 0xf6, 0xfb, 0x9b, 0x20, 0x9b, 0xff, 0x43, 0xa6, 0x8a, 0xd5, 0x8c, 0x99, 0x64, 0xad, 0x02, + 0xec, 0x88, 0x70, 0xd2, 0x7a, 0x7f, 0x35, 0xb3, 0xcc, 0xeb, 0x99, 0x65, 0xfe, 0x9e, 0x59, 0xe6, + 0xf7, 0xb9, 0x65, 0x5c, 0xcf, 0x2d, 0xe3, 0xe7, 0xdc, 0x32, 0x2e, 0x1c, 0xcf, 0x97, 0x5f, 0xc2, + 0xbe, 0x3d, 0xa0, 0x13, 0x67, 0xec, 0x07, 0xe8, 0xe4, 0xae, 0xd0, 0xf8, 0xee, 0x5b, 0xbd, 0x51, + 0xfb, 0x45, 0x95, 0xbf, 0xf8, 0x17, 0x00, 0x00, 0xff, 0xff, 0x68, 0x64, 0x6e, 0x30, 0x6c, 0x05, + 0x00, 0x00, +} + +func (m *PubKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -870,90 +426,25 @@ func (m *RemoteSignerError) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoteSignerError) MarshalTo(dAtA []byte) (int, error) { +func (m *PubKeyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoteSignerError) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PubKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PubKeyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKeyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PubKeyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } + if m.Error != nil { + { + size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } @@ -970,180 +461,6 @@ func (m *PubKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SignVoteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignVoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if m.Vote != nil { - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SignedVoteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignedVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *SignProposalRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignProposalRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if m.Proposal != nil { - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SignedProposalResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignedProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *VRFProofRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1216,52 +533,6 @@ func (m *VRFProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PingRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PingRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PingResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *Message) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1519,128 +790,35 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *RemoteSignerError) Size() (n int) { +func (m *PubKeyResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - l = len(m.Description) - if l > 0 { + l = m.PubKey.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.Error != nil { + l = m.Error.Size() n += 1 + l + sovTypes(uint64(l)) } return n } -func (m *PubKeyRequest) Size() (n int) { +func (m *VRFProofRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ChainId) + l = len(m.Message) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } return n } -func (m *PubKeyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PubKey.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignVoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignedVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignProposalRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Proposal != nil { - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignedProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *VRFProofRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *VRFProofResponse) Size() (n int) { +func (m *VRFProofResponse) Size() (n int) { if m == nil { return 0 } @@ -1657,24 +835,6 @@ func (m *VRFProofResponse) Size() (n int) { return n } -func (m *PingRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *Message) Size() (n int) { if m == nil { return 0 @@ -1814,7 +974,7 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *RemoteSignerError) Unmarshal(dAtA []byte) error { +func (m *PubKeyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1837,36 +997,17 @@ func (m *RemoteSignerError) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemoteSignerError: wiretype end group for non-group") + return fmt.Errorf("proto: PubKeyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemoteSignerError: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PubKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1876,79 +1017,30 @@ func (m *RemoteSignerError) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PubKeyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PubKeyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1958,23 +1050,27 @@ func (m *PubKeyRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + if m.Error == nil { + m.Error = &privval.RemoteSignerError{} + } + if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1997,7 +1093,7 @@ func (m *PubKeyRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *PubKeyResponse) Unmarshal(dAtA []byte) error { +func (m *VRFProofRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2020,50 +1116,17 @@ func (m *PubKeyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PubKeyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: VRFProofRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PubKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VRFProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2073,26 +1136,24 @@ func (m *PubKeyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Error == nil { - m.Error = &RemoteSignerError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Message = append(m.Message[:0], dAtA[iNdEx:postIndex]...) + if m.Message == nil { + m.Message = []byte{} } iNdEx = postIndex default: @@ -2116,7 +1177,7 @@ func (m *PubKeyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *SignVoteRequest) Unmarshal(dAtA []byte) error { +func (m *VRFProofResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2139,17 +1200,17 @@ func (m *SignVoteRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SignVoteRequest: wiretype end group for non-group") + return fmt.Errorf("proto: VRFProofResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SignVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VRFProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2159,33 +1220,31 @@ func (m *SignVoteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Vote == nil { - m.Vote = &types.Vote{} - } - if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2195,571 +1254,15 @@ func (m *SignVoteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignedVoteResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignedVoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignedVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &RemoteSignerError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignProposalRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignProposalRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proposal == nil { - m.Proposal = &types.Proposal{} - } - if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignedProposalResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignedProposalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignedProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &RemoteSignerError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VRFProofRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VRFProofRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VRFProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = append(m.Message[:0], dAtA[iNdEx:postIndex]...) - if m.Message == nil { - m.Message = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VRFProofResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VRFProofResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VRFProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } @@ -2767,7 +1270,7 @@ func (m *VRFProofResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Error == nil { - m.Error = &RemoteSignerError{} + m.Error = &privval.RemoteSignerError{} } if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2794,106 +1297,6 @@ func (m *VRFProofResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *PingRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PingRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PingRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Message) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2952,7 +1355,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &PubKeyRequest{} + v := &privval.PubKeyRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3022,7 +1425,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &SignVoteRequest{} + v := &privval.SignVoteRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3057,7 +1460,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &SignedVoteResponse{} + v := &privval.SignedVoteResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3092,7 +1495,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &SignProposalRequest{} + v := &privval.SignProposalRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3127,7 +1530,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &SignedProposalResponse{} + v := &privval.SignedProposalResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3162,7 +1565,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &PingRequest{} + v := &privval.PingRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3197,7 +1600,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &PingResponse{} + v := &privval.PingResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ostracon/privval/types.proto b/proto/ostracon/privval/types.proto index b24434d37..01397862e 100644 --- a/proto/ostracon/privval/types.proto +++ b/proto/ostracon/privval/types.proto @@ -4,57 +4,58 @@ package ostracon.privval; import "ostracon/crypto/keys.proto"; import "gogoproto/gogo.proto"; import "tendermint/types/types.proto"; +import "tendermint/privval/types.proto"; option go_package = "github.com/line/ostracon/proto/ostracon/privval"; -enum Errors { - ERRORS_UNKNOWN = 0; - ERRORS_UNEXPECTED_RESPONSE = 1; - ERRORS_NO_CONNECTION = 2; - ERRORS_CONNECTION_TIMEOUT = 3; - ERRORS_READ_TIMEOUT = 4; - ERRORS_WRITE_TIMEOUT = 5; -} +//enum Errors { +// ERRORS_UNKNOWN = 0; +// ERRORS_UNEXPECTED_RESPONSE = 1; +// ERRORS_NO_CONNECTION = 2; +// ERRORS_CONNECTION_TIMEOUT = 3; +// ERRORS_READ_TIMEOUT = 4; +// ERRORS_WRITE_TIMEOUT = 5; +//} -message RemoteSignerError { - int32 code = 1; - string description = 2; -} +//message RemoteSignerError { +// int32 code = 1; +// string description = 2; +//} // PubKeyRequest requests the consensus public key from the remote signer. -message PubKeyRequest { - string chain_id = 1; -} +//message PubKeyRequest { +// string chain_id = 1; +//} // PubKeyResponse is a response message containing the public key. message PubKeyResponse { ostracon.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; - RemoteSignerError error = 2; + tendermint.privval.RemoteSignerError error = 2; } // SignVoteRequest is a request to sign a vote -message SignVoteRequest { - tendermint.types.Vote vote = 1; - string chain_id = 2; -} +//message SignVoteRequest { +// tendermint.types.Vote vote = 1; +// string chain_id = 2; +//} // SignedVoteResponse is a response containing a signed vote or an error -message SignedVoteResponse { - tendermint.types.Vote vote = 1 [(gogoproto.nullable) = false]; - RemoteSignerError error = 2; -} +//message SignedVoteResponse { +// tendermint.types.Vote vote = 1 [(gogoproto.nullable) = false]; +// RemoteSignerError error = 2; +//} // SignProposalRequest is a request to sign a proposal -message SignProposalRequest { - tendermint.types.Proposal proposal = 1; - string chain_id = 2; -} +//message SignProposalRequest { +// tendermint.types.Proposal proposal = 1; +// string chain_id = 2; +//} // SignedProposalResponse is response containing a signed proposal or an error -message SignedProposalResponse { - tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; - RemoteSignerError error = 2; -} +//message SignedProposalResponse { +// tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; +// RemoteSignerError error = 2; +//} // VRFProofRequest is a PrivValidatorSocket message containing a message to generate proof. message VRFProofRequest { @@ -64,25 +65,25 @@ message VRFProofRequest { // VRFProofResponse is a PrivValidatorSocket message containing a Proof. message VRFProofResponse { bytes proof = 1; - RemoteSignerError error = 2; + tendermint.privval.RemoteSignerError error = 2; } // PingRequest is a request to confirm that the connection is alive. -message PingRequest {} +//message PingRequest {} // PingResponse is a response to confirm that the connection is alive. -message PingResponse {} +//message PingResponse {} message Message { oneof sum { - PubKeyRequest pub_key_request = 1; + tendermint.privval.PubKeyRequest pub_key_request = 1; PubKeyResponse pub_key_response = 2; - SignVoteRequest sign_vote_request = 3; - SignedVoteResponse signed_vote_response = 4; - SignProposalRequest sign_proposal_request = 5; - SignedProposalResponse signed_proposal_response = 6; - PingRequest ping_request = 7; - PingResponse ping_response = 8; + tendermint.privval.SignVoteRequest sign_vote_request = 3; + tendermint.privval.SignedVoteResponse signed_vote_response = 4; + tendermint.privval.SignProposalRequest sign_proposal_request = 5; + tendermint.privval.SignedProposalResponse signed_proposal_response = 6; + tendermint.privval.PingRequest ping_request = 7; + tendermint.privval.PingResponse ping_response = 8; VRFProofRequest vrf_proof_request = 1000; VRFProofResponse vrf_proof_response = 1001; } diff --git a/test/kms/bench_test.go b/test/kms/bench_test.go index c899fb5bc..f00800713 100644 --- a/test/kms/bench_test.go +++ b/test/kms/bench_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" + tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/config" @@ -186,7 +187,7 @@ func benchmarkVRFProof(b *testing.B, pv types.PrivValidator, pubKey crypto.PubKe func ping(sl *privval.SignerListenerEndpoint) { msg := privvalproto.Message{ Sum: &privvalproto.Message_PingRequest{ - PingRequest: &privvalproto.PingRequest{}, + PingRequest: &tmprivvalproto.PingRequest{}, }, } _, err := sl.SendRequest(msg) diff --git a/third_party/proto/tendermint/privval/types.proto b/third_party/proto/tendermint/privval/types.proto new file mode 100644 index 000000000..0fc8b61dc --- /dev/null +++ b/third_party/proto/tendermint/privval/types.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; +package tendermint.privval; + +import "tendermint/crypto/keys.proto"; +import "tendermint/types/types.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/privval"; + +enum Errors { + ERRORS_UNKNOWN = 0; + ERRORS_UNEXPECTED_RESPONSE = 1; + ERRORS_NO_CONNECTION = 2; + ERRORS_CONNECTION_TIMEOUT = 3; + ERRORS_READ_TIMEOUT = 4; + ERRORS_WRITE_TIMEOUT = 5; +} + +message RemoteSignerError { + int32 code = 1; + string description = 2; +} + +// PubKeyRequest requests the consensus public key from the remote signer. +message PubKeyRequest { + string chain_id = 1; +} + +// PubKeyResponse is a response message containing the public key. +message PubKeyResponse { + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + RemoteSignerError error = 2; +} + +// SignVoteRequest is a request to sign a vote +message SignVoteRequest { + tendermint.types.Vote vote = 1; + string chain_id = 2; +} + +// SignedVoteResponse is a response containing a signed vote or an error +message SignedVoteResponse { + tendermint.types.Vote vote = 1 [(gogoproto.nullable) = false]; + RemoteSignerError error = 2; +} + +// SignProposalRequest is a request to sign a proposal +message SignProposalRequest { + tendermint.types.Proposal proposal = 1; + string chain_id = 2; +} + +// SignedProposalResponse is response containing a signed proposal or an error +message SignedProposalResponse { + tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; + RemoteSignerError error = 2; +} + +// PingRequest is a request to confirm that the connection is alive. +message PingRequest {} + +// PingResponse is a response to confirm that the connection is alive. +message PingResponse {} + +message Message { + oneof sum { + PubKeyRequest pub_key_request = 1; + PubKeyResponse pub_key_response = 2; + SignVoteRequest sign_vote_request = 3; + SignedVoteResponse signed_vote_response = 4; + SignProposalRequest sign_proposal_request = 5; + SignedProposalResponse signed_proposal_response = 6; + PingRequest ping_request = 7; + PingResponse ping_response = 8; + } +} From 29ca21d7832c0d30b326809613d796cb59bee8e2 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 7 Jan 2023 05:11:12 +0900 Subject: [PATCH 11/25] feat: clean up `proto/ostracon/abci` proto directory --- abci/client/client.go | 54 +- abci/client/grpc_client.go | 144 +- abci/client/grpc_client_test.go | 62 +- abci/client/local_client.go | 148 +- abci/client/local_client_test.go | 44 +- abci/client/mocks/client.go | 229 +- abci/client/socket_client.go | 222 +- abci/client/socket_client_test.go | 78 +- abci/cmd/abci-cli/abci-cli.go | 18 +- abci/example/counter/counter.go | 52 +- abci/example/example_test.go | 24 +- abci/example/kvstore/helpers.go | 3 +- abci/example/kvstore/kvstore.go | 33 +- abci/example/kvstore/kvstore_test.go | 36 +- abci/example/kvstore/persistent_kvstore.go | 63 +- abci/server/grpc_server.go | 8 +- abci/server/server.go | 6 +- abci/server/socket_server.go | 94 +- abci/tests/benchmarks/parallel/parallel.go | 2 +- abci/tests/benchmarks/simple/simple.go | 2 +- abci/tests/server/client.go | 10 +- abci/tests/test_app/app.go | 7 +- abci/tests/test_app/main.go | 2 +- abci/types/application.go | 108 +- abci/types/messages.go | 54 +- abci/types/messages_test.go | 16 +- abci/types/mocks/application.go | 92 +- abci/types/result.go | 77 - abci/types/types.pb.go | 15904 +++++-------------- blockchain/v0/reactor_test.go | 25 +- consensus/mempool_test.go | 25 +- consensus/replay_stubs.go | 14 +- consensus/replay_test.go | 19 +- consensus/state_test.go | 5 +- light/rpc/client.go | 4 +- mempool/clist_mempool.go | 13 +- mempool/clist_mempool_system_test.go | 9 +- mempool/clist_mempool_test.go | 26 +- mempool/mempool.go | 4 +- mempool/mock/mempool.go | 4 +- mempool/reactor_test.go | 8 +- node/node.go | 6 +- proto/ostracon/abci/types.proto | 459 +- proto/ostracon/rpc/grpc/types.proto | 3 +- proto/ostracon/state/types.pb.go | 144 +- proto/ostracon/state/types.proto | 5 +- proxy/app_conn.go | 74 +- proxy/app_conn_test.go | 13 +- proxy/client.go | 8 +- proxy/mocks/app_conn_consensus.go | 47 +- proxy/mocks/app_conn_mempool.go | 21 +- proxy/mocks/app_conn_query.go | 30 +- proxy/mocks/app_conn_snapshot.go | 42 +- proxy/version.go | 5 +- rpc/client/mock/abci.go | 20 +- rpc/client/mock/abci_test.go | 8 +- rpc/core/abci.go | 5 +- rpc/core/blocks_test.go | 7 +- rpc/core/mempool.go | 10 +- rpc/core/types/responses.go | 37 +- rpc/grpc/api.go | 4 +- rpc/grpc/types.pb.go | 46 +- state/execution.go | 11 +- state/execution_test.go | 5 +- state/helpers_test.go | 33 +- state/indexer/block/kv/kv.go | 4 +- state/indexer/block/kv/kv_test.go | 21 +- state/indexer/sink/psql/backport.go | 11 +- state/indexer/sink/psql/backport_test.go | 7 +- state/indexer/sink/psql/psql.go | 21 +- state/indexer/sink/psql/psql_test.go | 26 +- state/state_test.go | 59 +- state/store.go | 4 +- state/store_test.go | 7 +- state/txindex/indexer.go | 15 +- state/txindex/indexer_service.go | 6 +- state/txindex/indexer_service_test.go | 73 +- state/txindex/kv/kv.go | 26 +- state/txindex/kv/kv_bench_test.go | 9 +- state/txindex/kv/kv_test.go | 85 +- state/txindex/null/null.go | 11 +- statesync/reactor.go | 6 +- statesync/reactor_test.go | 30 +- statesync/syncer.go | 28 +- statesync/syncer_test.go | 182 +- test/e2e/app/app.go | 44 +- test/e2e/app/snapshots.go | 20 +- types/event_bus.go | 7 +- types/event_bus_test.go | 42 +- types/events.go | 14 +- types/evidence.go | 5 +- types/params.go | 4 +- types/params_test.go | 13 +- types/protobuf.go | 7 +- types/results.go | 11 +- types/results_test.go | 14 +- 96 files changed, 5951 insertions(+), 13652 deletions(-) diff --git a/abci/client/client.go b/abci/client/client.go index 8ccfc5cb6..351eacad8 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -4,7 +4,9 @@ import ( "fmt" "sync" - "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + + types "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" ) @@ -29,39 +31,39 @@ type Client interface { FlushAsync(ResponseCallback) *ReqRes EchoAsync(string, ResponseCallback) *ReqRes - InfoAsync(types.RequestInfo, ResponseCallback) *ReqRes - SetOptionAsync(types.RequestSetOption, ResponseCallback) *ReqRes - DeliverTxAsync(types.RequestDeliverTx, ResponseCallback) *ReqRes - CheckTxAsync(types.RequestCheckTx, ResponseCallback) *ReqRes - QueryAsync(types.RequestQuery, ResponseCallback) *ReqRes + InfoAsync(tmabci.RequestInfo, ResponseCallback) *ReqRes + SetOptionAsync(tmabci.RequestSetOption, ResponseCallback) *ReqRes + DeliverTxAsync(tmabci.RequestDeliverTx, ResponseCallback) *ReqRes + CheckTxAsync(tmabci.RequestCheckTx, ResponseCallback) *ReqRes + QueryAsync(tmabci.RequestQuery, ResponseCallback) *ReqRes CommitAsync(ResponseCallback) *ReqRes InitChainAsync(types.RequestInitChain, ResponseCallback) *ReqRes BeginBlockAsync(types.RequestBeginBlock, ResponseCallback) *ReqRes - EndBlockAsync(types.RequestEndBlock, ResponseCallback) *ReqRes + EndBlockAsync(tmabci.RequestEndBlock, ResponseCallback) *ReqRes BeginRecheckTxAsync(types.RequestBeginRecheckTx, ResponseCallback) *ReqRes EndRecheckTxAsync(types.RequestEndRecheckTx, ResponseCallback) *ReqRes - ListSnapshotsAsync(types.RequestListSnapshots, ResponseCallback) *ReqRes - OfferSnapshotAsync(types.RequestOfferSnapshot, ResponseCallback) *ReqRes - LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk, ResponseCallback) *ReqRes - ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk, ResponseCallback) *ReqRes - - FlushSync() (*types.ResponseFlush, error) - EchoSync(string) (*types.ResponseEcho, error) - InfoSync(types.RequestInfo) (*types.ResponseInfo, error) - SetOptionSync(types.RequestSetOption) (*types.ResponseSetOption, error) - DeliverTxSync(types.RequestDeliverTx) (*types.ResponseDeliverTx, error) - CheckTxSync(types.RequestCheckTx) (*types.ResponseCheckTx, error) - QuerySync(types.RequestQuery) (*types.ResponseQuery, error) - CommitSync() (*types.ResponseCommit, error) + ListSnapshotsAsync(tmabci.RequestListSnapshots, ResponseCallback) *ReqRes + OfferSnapshotAsync(tmabci.RequestOfferSnapshot, ResponseCallback) *ReqRes + LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk, ResponseCallback) *ReqRes + ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk, ResponseCallback) *ReqRes + + FlushSync() (*tmabci.ResponseFlush, error) + EchoSync(string) (*tmabci.ResponseEcho, error) + InfoSync(tmabci.RequestInfo) (*tmabci.ResponseInfo, error) + SetOptionSync(tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) + DeliverTxSync(tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) + CheckTxSync(tmabci.RequestCheckTx) (*types.ResponseCheckTx, error) + QuerySync(tmabci.RequestQuery) (*tmabci.ResponseQuery, error) + CommitSync() (*tmabci.ResponseCommit, error) InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error) - BeginBlockSync(types.RequestBeginBlock) (*types.ResponseBeginBlock, error) - EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error) + BeginBlockSync(types.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) + EndBlockSync(tmabci.RequestEndBlock) (*types.ResponseEndBlock, error) BeginRecheckTxSync(types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) EndRecheckTxSync(types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) - ListSnapshotsSync(types.RequestListSnapshots) (*types.ResponseListSnapshots, error) - OfferSnapshotSync(types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) - LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunkSync(types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) + ListSnapshotsSync(tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) + OfferSnapshotSync(tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) + LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) } //---------------------------------------- diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index c8c57cae7..a4d5d65d2 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -9,7 +9,9 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" - "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + + abci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" @@ -23,7 +25,7 @@ type grpcClient struct { service.BaseService mustConnect bool - client types.ABCIApplicationClient + client abci.ABCIApplicationClient conn *grpc.ClientConn mtx tmsync.Mutex @@ -31,7 +33,7 @@ type grpcClient struct { err error globalCbMtx sync.Mutex - globalCb func(*types.Request, *types.Response) // listens to all callbacks + globalCb func(*abci.Request, *abci.Response) // listens to all callbacks } func NewGRPCClient(addr string, mustConnect bool) Client { @@ -66,12 +68,12 @@ RETRY_LOOP: } cli.Logger.Info("Dialed server. Waiting for echo.", "addr", cli.addr) - client := types.NewABCIApplicationClient(conn) + client := abci.NewABCIApplicationClient(conn) cli.conn = conn ENSURE_CONNECTED: for { - _, err := client.Echo(context.Background(), &types.RequestEcho{Message: "hello"}, grpc.WaitForReady(true)) + _, err := client.Echo(context.Background(), &tmabci.RequestEcho{Message: "hello"}, grpc.WaitForReady(true)) if err == nil { break ENSURE_CONNECTED } @@ -137,160 +139,160 @@ func (cli *grpcClient) GetGlobalCallback() (cb GlobalCallback) { // but hopefully not :D func (cli *grpcClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { - req := types.ToRequestEcho(msg) + req := abci.ToRequestEcho(msg) res, err := cli.client.Echo(context.Background(), req.GetEcho(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Echo{Echo: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Echo{Echo: res}}, cb) } func (cli *grpcClient) FlushAsync(cb ResponseCallback) *ReqRes { - req := types.ToRequestFlush() + req := abci.ToRequestFlush() res, err := cli.client.Flush(context.Background(), req.GetFlush(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Flush{Flush: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Flush{Flush: res}}, cb) } -func (cli *grpcClient) InfoAsync(params types.RequestInfo, cb ResponseCallback) *ReqRes { - req := types.ToRequestInfo(params) +func (cli *grpcClient) InfoAsync(params tmabci.RequestInfo, cb ResponseCallback) *ReqRes { + req := abci.ToRequestInfo(params) res, err := cli.client.Info(context.Background(), req.GetInfo(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Info{Info: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Info{Info: res}}, cb) } -func (cli *grpcClient) SetOptionAsync(params types.RequestSetOption, cb ResponseCallback) *ReqRes { - req := types.ToRequestSetOption(params) +func (cli *grpcClient) SetOptionAsync(params tmabci.RequestSetOption, cb ResponseCallback) *ReqRes { + req := abci.ToRequestSetOption(params) res, err := cli.client.SetOption(context.Background(), req.GetSetOption(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_SetOption{SetOption: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_SetOption{SetOption: res}}, cb) } -func (cli *grpcClient) DeliverTxAsync(params types.RequestDeliverTx, cb ResponseCallback) *ReqRes { - req := types.ToRequestDeliverTx(params) +func (cli *grpcClient) DeliverTxAsync(params tmabci.RequestDeliverTx, cb ResponseCallback) *ReqRes { + req := abci.ToRequestDeliverTx(params) res, err := cli.client.DeliverTx(context.Background(), req.GetDeliverTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_DeliverTx{DeliverTx: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_DeliverTx{DeliverTx: res}}, cb) } -func (cli *grpcClient) CheckTxAsync(params types.RequestCheckTx, cb ResponseCallback) *ReqRes { - req := types.ToRequestCheckTx(params) +func (cli *grpcClient) CheckTxAsync(params tmabci.RequestCheckTx, cb ResponseCallback) *ReqRes { + req := abci.ToRequestCheckTx(params) res, err := cli.client.CheckTx(context.Background(), req.GetCheckTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_CheckTx{CheckTx: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_CheckTx{CheckTx: res}}, cb) } -func (cli *grpcClient) QueryAsync(params types.RequestQuery, cb ResponseCallback) *ReqRes { - req := types.ToRequestQuery(params) +func (cli *grpcClient) QueryAsync(params tmabci.RequestQuery, cb ResponseCallback) *ReqRes { + req := abci.ToRequestQuery(params) res, err := cli.client.Query(context.Background(), req.GetQuery(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Query{Query: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Query{Query: res}}, cb) } func (cli *grpcClient) CommitAsync(cb ResponseCallback) *ReqRes { - req := types.ToRequestCommit() + req := abci.ToRequestCommit() res, err := cli.client.Commit(context.Background(), req.GetCommit(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Commit{Commit: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Commit{Commit: res}}, cb) } -func (cli *grpcClient) InitChainAsync(params types.RequestInitChain, cb ResponseCallback) *ReqRes { - req := types.ToRequestInitChain(params) +func (cli *grpcClient) InitChainAsync(params abci.RequestInitChain, cb ResponseCallback) *ReqRes { + req := abci.ToRequestInitChain(params) res, err := cli.client.InitChain(context.Background(), req.GetInitChain(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_InitChain{InitChain: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_InitChain{InitChain: res}}, cb) } -func (cli *grpcClient) BeginBlockAsync(params types.RequestBeginBlock, cb ResponseCallback) *ReqRes { - req := types.ToRequestBeginBlock(params) +func (cli *grpcClient) BeginBlockAsync(params abci.RequestBeginBlock, cb ResponseCallback) *ReqRes { + req := abci.ToRequestBeginBlock(params) res, err := cli.client.BeginBlock(context.Background(), req.GetBeginBlock(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_BeginBlock{BeginBlock: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_BeginBlock{BeginBlock: res}}, cb) } -func (cli *grpcClient) EndBlockAsync(params types.RequestEndBlock, cb ResponseCallback) *ReqRes { - req := types.ToRequestEndBlock(params) +func (cli *grpcClient) EndBlockAsync(params tmabci.RequestEndBlock, cb ResponseCallback) *ReqRes { + req := abci.ToRequestEndBlock(params) res, err := cli.client.EndBlock(context.Background(), req.GetEndBlock(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_EndBlock{EndBlock: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_EndBlock{EndBlock: res}}, cb) } -func (cli *grpcClient) BeginRecheckTxAsync(params types.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { - req := types.ToRequestBeginRecheckTx(params) +func (cli *grpcClient) BeginRecheckTxAsync(params abci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { + req := abci.ToRequestBeginRecheckTx(params) res, err := cli.client.BeginRecheckTx(context.Background(), req.GetBeginRecheckTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_BeginRecheckTx{BeginRecheckTx: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_BeginRecheckTx{BeginRecheckTx: res}}, cb) } -func (cli *grpcClient) EndRecheckTxAsync(params types.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { - req := types.ToRequestEndRecheckTx(params) +func (cli *grpcClient) EndRecheckTxAsync(params abci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { + req := abci.ToRequestEndRecheckTx(params) res, err := cli.client.EndRecheckTx(context.Background(), req.GetEndRecheckTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_EndRecheckTx{EndRecheckTx: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_EndRecheckTx{EndRecheckTx: res}}, cb) } -func (cli *grpcClient) ListSnapshotsAsync(params types.RequestListSnapshots, cb ResponseCallback) *ReqRes { - req := types.ToRequestListSnapshots(params) +func (cli *grpcClient) ListSnapshotsAsync(params tmabci.RequestListSnapshots, cb ResponseCallback) *ReqRes { + req := abci.ToRequestListSnapshots(params) res, err := cli.client.ListSnapshots(context.Background(), req.GetListSnapshots(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_ListSnapshots{ListSnapshots: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_ListSnapshots{ListSnapshots: res}}, cb) } -func (cli *grpcClient) OfferSnapshotAsync(params types.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { - req := types.ToRequestOfferSnapshot(params) +func (cli *grpcClient) OfferSnapshotAsync(params tmabci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { + req := abci.ToRequestOfferSnapshot(params) res, err := cli.client.OfferSnapshot(context.Background(), req.GetOfferSnapshot(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_OfferSnapshot{OfferSnapshot: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_OfferSnapshot{OfferSnapshot: res}}, cb) } -func (cli *grpcClient) LoadSnapshotChunkAsync(params types.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { - req := types.ToRequestLoadSnapshotChunk(params) +func (cli *grpcClient) LoadSnapshotChunkAsync(params tmabci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { + req := abci.ToRequestLoadSnapshotChunk(params) res, err := cli.client.LoadSnapshotChunk(context.Background(), req.GetLoadSnapshotChunk(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_LoadSnapshotChunk{LoadSnapshotChunk: res}}, cb) + return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_LoadSnapshotChunk{LoadSnapshotChunk: res}}, cb) } -func (cli *grpcClient) ApplySnapshotChunkAsync(params types.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { - req := types.ToRequestApplySnapshotChunk(params) +func (cli *grpcClient) ApplySnapshotChunkAsync(params tmabci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { + req := abci.ToRequestApplySnapshotChunk(params) res, err := cli.client.ApplySnapshotChunk(context.Background(), req.GetApplySnapshotChunk(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } return cli.finishAsyncCall(req, - &types.Response{Value: &types.Response_ApplySnapshotChunk{ApplySnapshotChunk: res}}, cb) + &abci.Response{Value: &abci.Response_ApplySnapshotChunk{ApplySnapshotChunk: res}}, cb) } -func (cli *grpcClient) finishAsyncCall(req *types.Request, res *types.Response, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) finishAsyncCall(req *abci.Request, res *abci.Response, cb ResponseCallback) *ReqRes { reqRes := NewReqRes(req, cb) // goroutine for callbacks @@ -308,106 +310,106 @@ func (cli *grpcClient) finishAsyncCall(req *types.Request, res *types.Response, } //---------------------------------------- -func (cli *grpcClient) FlushSync() (*types.ResponseFlush, error) { +func (cli *grpcClient) FlushSync() (*tmabci.ResponseFlush, error) { reqres := cli.FlushAsync(nil) reqres.Wait() return reqres.Response.GetFlush(), cli.Error() } -func (cli *grpcClient) EchoSync(msg string) (*types.ResponseEcho, error) { +func (cli *grpcClient) EchoSync(msg string) (*tmabci.ResponseEcho, error) { reqres := cli.EchoAsync(msg, nil) reqres.Wait() // StopForError should already have been called if error is set return reqres.Response.GetEcho(), cli.Error() } -func (cli *grpcClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { +func (cli *grpcClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { reqres := cli.InfoAsync(req, nil) reqres.Wait() return reqres.Response.GetInfo(), cli.Error() } -func (cli *grpcClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { +func (cli *grpcClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { reqres := cli.SetOptionAsync(req, nil) reqres.Wait() return reqres.Response.GetSetOption(), cli.Error() } -func (cli *grpcClient) DeliverTxSync(params types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { +func (cli *grpcClient) DeliverTxSync(params tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { reqres := cli.DeliverTxAsync(params, nil) reqres.Wait() return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *grpcClient) CheckTxSync(params types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (cli *grpcClient) CheckTxSync(params tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { reqres := cli.CheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetCheckTx(), cli.Error() } -func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { +func (cli *grpcClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { reqres := cli.QueryAsync(req, nil) reqres.Wait() return reqres.Response.GetQuery(), cli.Error() } -func (cli *grpcClient) CommitSync() (*types.ResponseCommit, error) { +func (cli *grpcClient) CommitSync() (*tmabci.ResponseCommit, error) { reqres := cli.CommitAsync(nil) reqres.Wait() return reqres.Response.GetCommit(), cli.Error() } -func (cli *grpcClient) InitChainSync(params types.RequestInitChain) (*types.ResponseInitChain, error) { +func (cli *grpcClient) InitChainSync(params abci.RequestInitChain) (*abci.ResponseInitChain, error) { reqres := cli.InitChainAsync(params, nil) reqres.Wait() return reqres.Response.GetInitChain(), cli.Error() } -func (cli *grpcClient) BeginBlockSync(params types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { +func (cli *grpcClient) BeginBlockSync(params abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { reqres := cli.BeginBlockAsync(params, nil) reqres.Wait() return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *grpcClient) EndBlockSync(params types.RequestEndBlock) (*types.ResponseEndBlock, error) { +func (cli *grpcClient) EndBlockSync(params tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { reqres := cli.EndBlockAsync(params, nil) reqres.Wait() return reqres.Response.GetEndBlock(), cli.Error() } -func (cli *grpcClient) BeginRecheckTxSync(params types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) { +func (cli *grpcClient) BeginRecheckTxSync(params abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { reqres := cli.BeginRecheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetBeginRecheckTx(), cli.Error() } -func (cli *grpcClient) EndRecheckTxSync(params types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) { +func (cli *grpcClient) EndRecheckTxSync(params abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { reqres := cli.EndRecheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetEndRecheckTx(), cli.Error() } -func (cli *grpcClient) ListSnapshotsSync(params types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (cli *grpcClient) ListSnapshotsSync(params tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { reqres := cli.ListSnapshotsAsync(params, nil) reqres.Wait() return reqres.Response.GetListSnapshots(), cli.Error() } -func (cli *grpcClient) OfferSnapshotSync(params types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (cli *grpcClient) OfferSnapshotSync(params tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { reqres := cli.OfferSnapshotAsync(params, nil) reqres.Wait() return reqres.Response.GetOfferSnapshot(), cli.Error() } func (cli *grpcClient) LoadSnapshotChunkSync( - params types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { + params tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { reqres := cli.LoadSnapshotChunkAsync(params, nil) reqres.Wait() return reqres.Response.GetLoadSnapshotChunk(), cli.Error() } func (cli *grpcClient) ApplySnapshotChunkSync( - params types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { + params tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { reqres := cli.ApplySnapshotChunkAsync(params, nil) reqres.Wait() return reqres.Response.GetApplySnapshotChunk(), cli.Error() diff --git a/abci/client/grpc_client_test.go b/abci/client/grpc_client_test.go index 7b1d386ad..eeec39201 100644 --- a/abci/client/grpc_client_test.go +++ b/abci/client/grpc_client_test.go @@ -4,8 +4,10 @@ import ( "fmt" "testing" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/abci/server" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/rand" "github.com/stretchr/testify/require" ) @@ -22,28 +24,28 @@ func TestGrpcClientCalls(t *testing.T) { require.NoError(t, err0) c := NewGRPCClient(addr, true) - c.SetGlobalCallback(func(*types.Request, *types.Response) { + c.SetGlobalCallback(func(*abci.Request, *abci.Response) { }) err0 = c.Start() require.NoError(t, err0) c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(types.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(types.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(types.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(types.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(types.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(tmabci.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(tmabci.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(tmabci.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(tmabci.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(tmabci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(types.RequestInitChain{}, getResponseCallback(t)) - c.BeginBlockAsync(types.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(types.RequestEndBlock{}, getResponseCallback(t)) - c.BeginRecheckTxAsync(types.RequestBeginRecheckTx{}, getResponseCallback(t)) - c.EndRecheckTxAsync(types.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(types.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(types.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) + c.BeginBlockAsync(abci.RequestBeginBlock{}, getResponseCallback(t)) + c.EndBlockAsync(tmabci.RequestEndBlock{}, getResponseCallback(t)) + c.BeginRecheckTxAsync(abci.RequestBeginRecheckTx{}, getResponseCallback(t)) + c.EndRecheckTxAsync(abci.RequestEndRecheckTx{}, getResponseCallback(t)) + c.ListSnapshotsAsync(tmabci.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(tmabci.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -51,48 +53,48 @@ func TestGrpcClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(types.RequestInfo{}) + _, err = c.InfoSync(tmabci.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(types.RequestSetOption{}) + _, err = c.SetOptionSync(tmabci.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(types.RequestDeliverTx{}) + _, err = c.DeliverTxSync(tmabci.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(types.RequestCheckTx{}) + _, err = c.CheckTxSync(tmabci.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(types.RequestQuery{}) + _, err = c.QuerySync(tmabci.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(types.RequestInitChain{}) + _, err = c.InitChainSync(abci.RequestInitChain{}) require.NoError(t, err) - _, err = c.BeginBlockSync(types.RequestBeginBlock{}) + _, err = c.BeginBlockSync(abci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(types.RequestEndBlock{}) + _, err = c.EndBlockSync(tmabci.RequestEndBlock{}) require.NoError(t, err) - _, err = c.BeginRecheckTxSync(types.RequestBeginRecheckTx{}) + _, err = c.BeginRecheckTxSync(abci.RequestBeginRecheckTx{}) require.NoError(t, err) - _, err = c.EndRecheckTxSync(types.RequestEndRecheckTx{}) + _, err = c.EndRecheckTxSync(abci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(types.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(tmabci.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(types.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(tmabci.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(types.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{}) require.NoError(t, err) } diff --git a/abci/client/local_client.go b/abci/client/local_client.go index 1b89774dc..ef19fe158 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -1,7 +1,9 @@ package abcicli import ( - types "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" ) @@ -18,7 +20,7 @@ type localClient struct { // TODO: remove `mtx` to increase concurrency. We could remove it because the app should protect itself. mtx *tmsync.Mutex // CONTRACT: The application should protect itself from concurrency as an abci server. - types.Application + abci.Application globalCbMtx tmsync.Mutex globalCb GlobalCallback @@ -30,7 +32,7 @@ var _ Client = (*localClient)(nil) // methods of the given app. // // Both Async and Sync methods ignore the given context.Context parameter. -func NewLocalClient(mtx *tmsync.Mutex, app types.Application) Client { +func NewLocalClient(mtx *tmsync.Mutex, app abci.Application) Client { if mtx == nil { mtx = new(tmsync.Mutex) } @@ -55,15 +57,15 @@ func (app *localClient) GetGlobalCallback() (cb GlobalCallback) { return cb } -// TODO: change types.Application to include Error()? +// TODO: change abci.Application to include Error()? func (app *localClient) Error() error { return nil } func (app *localClient) FlushAsync(cb ResponseCallback) *ReqRes { // Do nothing - reqRes := NewReqRes(types.ToRequestFlush(), cb) - return app.done(reqRes, types.ToResponseFlush()) + reqRes := NewReqRes(abci.ToRequestFlush(), cb) + return app.done(reqRes, abci.ToResponseFlush()) } func (app *localClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { @@ -71,167 +73,167 @@ func (app *localClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestEcho(msg), cb) - return app.done(reqRes, types.ToResponseEcho(msg)) + reqRes := NewReqRes(abci.ToRequestEcho(msg), cb) + return app.done(reqRes, abci.ToResponseEcho(msg)) } -func (app *localClient) InfoAsync(req types.RequestInfo, cb ResponseCallback) *ReqRes { +func (app *localClient) InfoAsync(req tmabci.RequestInfo, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestInfo(req), cb) + reqRes := NewReqRes(abci.ToRequestInfo(req), cb) res := app.Application.Info(req) - return app.done(reqRes, types.ToResponseInfo(res)) + return app.done(reqRes, abci.ToResponseInfo(res)) } -func (app *localClient) SetOptionAsync(req types.RequestSetOption, cb ResponseCallback) *ReqRes { +func (app *localClient) SetOptionAsync(req tmabci.RequestSetOption, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestSetOption(req), cb) + reqRes := NewReqRes(abci.ToRequestSetOption(req), cb) res := app.Application.SetOption(req) - return app.done(reqRes, types.ToResponseSetOption(res)) + return app.done(reqRes, abci.ToResponseSetOption(res)) } -func (app *localClient) DeliverTxAsync(req types.RequestDeliverTx, cb ResponseCallback) *ReqRes { +func (app *localClient) DeliverTxAsync(req tmabci.RequestDeliverTx, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestDeliverTx(req), cb) + reqRes := NewReqRes(abci.ToRequestDeliverTx(req), cb) res := app.Application.DeliverTx(req) - return app.done(reqRes, types.ToResponseDeliverTx(res)) + return app.done(reqRes, abci.ToResponseDeliverTx(res)) } -func (app *localClient) CheckTxAsync(req types.RequestCheckTx, cb ResponseCallback) *ReqRes { +func (app *localClient) CheckTxAsync(req tmabci.RequestCheckTx, cb ResponseCallback) *ReqRes { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestCheckTx(req), cb) + reqRes := NewReqRes(abci.ToRequestCheckTx(req), cb) - app.Application.CheckTxAsync(req, func(r types.ResponseCheckTx) { - res := types.ToResponseCheckTx(r) + app.Application.CheckTxAsync(req, func(r abci.ResponseCheckTx) { + res := abci.ToResponseCheckTx(r) app.done(reqRes, res) }) return reqRes } -func (app *localClient) QueryAsync(req types.RequestQuery, cb ResponseCallback) *ReqRes { +func (app *localClient) QueryAsync(req tmabci.RequestQuery, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestQuery(req), cb) + reqRes := NewReqRes(abci.ToRequestQuery(req), cb) res := app.Application.Query(req) - return app.done(reqRes, types.ToResponseQuery(res)) + return app.done(reqRes, abci.ToResponseQuery(res)) } func (app *localClient) CommitAsync(cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestCommit(), cb) + reqRes := NewReqRes(abci.ToRequestCommit(), cb) res := app.Application.Commit() - return app.done(reqRes, types.ToResponseCommit(res)) + return app.done(reqRes, abci.ToResponseCommit(res)) } -func (app *localClient) InitChainAsync(req types.RequestInitChain, cb ResponseCallback) *ReqRes { +func (app *localClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestInitChain(req), cb) + reqRes := NewReqRes(abci.ToRequestInitChain(req), cb) res := app.Application.InitChain(req) - return app.done(reqRes, types.ToResponseInitChain(res)) + return app.done(reqRes, abci.ToResponseInitChain(res)) } -func (app *localClient) BeginBlockAsync(req types.RequestBeginBlock, cb ResponseCallback) *ReqRes { +func (app *localClient) BeginBlockAsync(req abci.RequestBeginBlock, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestBeginBlock(req), cb) + reqRes := NewReqRes(abci.ToRequestBeginBlock(req), cb) res := app.Application.BeginBlock(req) - return app.done(reqRes, types.ToResponseBeginBlock(res)) + return app.done(reqRes, abci.ToResponseBeginBlock(res)) } -func (app *localClient) EndBlockAsync(req types.RequestEndBlock, cb ResponseCallback) *ReqRes { +func (app *localClient) EndBlockAsync(req tmabci.RequestEndBlock, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestEndBlock(req), cb) + reqRes := NewReqRes(abci.ToRequestEndBlock(req), cb) res := app.Application.EndBlock(req) - return app.done(reqRes, types.ToResponseEndBlock(res)) + return app.done(reqRes, abci.ToResponseEndBlock(res)) } -func (app *localClient) BeginRecheckTxAsync(req types.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { +func (app *localClient) BeginRecheckTxAsync(req abci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestBeginRecheckTx(req), cb) + reqRes := NewReqRes(abci.ToRequestBeginRecheckTx(req), cb) res := app.Application.BeginRecheckTx(req) - return app.done(reqRes, types.ToResponseBeginRecheckTx(res)) + return app.done(reqRes, abci.ToResponseBeginRecheckTx(res)) } -func (app *localClient) EndRecheckTxAsync(req types.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { +func (app *localClient) EndRecheckTxAsync(req abci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestEndRecheckTx(req), cb) + reqRes := NewReqRes(abci.ToRequestEndRecheckTx(req), cb) res := app.Application.EndRecheckTx(req) - return app.done(reqRes, types.ToResponseEndRecheckTx(res)) + return app.done(reqRes, abci.ToResponseEndRecheckTx(res)) } -func (app *localClient) ListSnapshotsAsync(req types.RequestListSnapshots, cb ResponseCallback) *ReqRes { +func (app *localClient) ListSnapshotsAsync(req tmabci.RequestListSnapshots, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestListSnapshots(req), cb) + reqRes := NewReqRes(abci.ToRequestListSnapshots(req), cb) res := app.Application.ListSnapshots(req) - return app.done(reqRes, types.ToResponseListSnapshots(res)) + return app.done(reqRes, abci.ToResponseListSnapshots(res)) } -func (app *localClient) OfferSnapshotAsync(req types.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { +func (app *localClient) OfferSnapshotAsync(req tmabci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestOfferSnapshot(req), cb) + reqRes := NewReqRes(abci.ToRequestOfferSnapshot(req), cb) res := app.Application.OfferSnapshot(req) - return app.done(reqRes, types.ToResponseOfferSnapshot(res)) + return app.done(reqRes, abci.ToResponseOfferSnapshot(res)) } -func (app *localClient) LoadSnapshotChunkAsync(req types.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { +func (app *localClient) LoadSnapshotChunkAsync(req tmabci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestLoadSnapshotChunk(req), cb) + reqRes := NewReqRes(abci.ToRequestLoadSnapshotChunk(req), cb) res := app.Application.LoadSnapshotChunk(req) - return app.done(reqRes, types.ToResponseLoadSnapshotChunk(res)) + return app.done(reqRes, abci.ToResponseLoadSnapshotChunk(res)) } -func (app *localClient) ApplySnapshotChunkAsync(req types.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { +func (app *localClient) ApplySnapshotChunkAsync(req tmabci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(types.ToRequestApplySnapshotChunk(req), cb) + reqRes := NewReqRes(abci.ToRequestApplySnapshotChunk(req), cb) res := app.Application.ApplySnapshotChunk(req) - return app.done(reqRes, types.ToResponseApplySnapshotChunk(res)) + return app.done(reqRes, abci.ToResponseApplySnapshotChunk(res)) } //------------------------------------------------------- -func (app *localClient) FlushSync() (*types.ResponseFlush, error) { - return &types.ResponseFlush{}, nil +func (app *localClient) FlushSync() (*tmabci.ResponseFlush, error) { + return &tmabci.ResponseFlush{}, nil } -func (app *localClient) EchoSync(msg string) (*types.ResponseEcho, error) { +func (app *localClient) EchoSync(msg string) (*tmabci.ResponseEcho, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - return &types.ResponseEcho{Message: msg}, nil + return &tmabci.ResponseEcho{Message: msg}, nil } -func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { +func (app *localClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -239,7 +241,7 @@ func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, er return &res, nil } -func (app *localClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { +func (app *localClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -247,7 +249,7 @@ func (app *localClient) SetOptionSync(req types.RequestSetOption) (*types.Respon return &res, nil } -func (app *localClient) DeliverTxSync(req types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { +func (app *localClient) DeliverTxSync(req tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -255,7 +257,7 @@ func (app *localClient) DeliverTxSync(req types.RequestDeliverTx) (*types.Respon return &res, nil } -func (app *localClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (app *localClient) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -264,7 +266,7 @@ func (app *localClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCh return &res, nil } -func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { +func (app *localClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -272,7 +274,7 @@ func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, return &res, nil } -func (app *localClient) CommitSync() (*types.ResponseCommit, error) { +func (app *localClient) CommitSync() (*tmabci.ResponseCommit, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -280,7 +282,7 @@ func (app *localClient) CommitSync() (*types.ResponseCommit, error) { return &res, nil } -func (app *localClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { +func (app *localClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -288,7 +290,7 @@ func (app *localClient) InitChainSync(req types.RequestInitChain) (*types.Respon return &res, nil } -func (app *localClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { +func (app *localClient) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -296,7 +298,7 @@ func (app *localClient) BeginBlockSync(req types.RequestBeginBlock) (*types.Resp return &res, nil } -func (app *localClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { +func (app *localClient) EndBlockSync(req tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -304,7 +306,7 @@ func (app *localClient) EndBlockSync(req types.RequestEndBlock) (*types.Response return &res, nil } -func (app *localClient) BeginRecheckTxSync(req types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) { +func (app *localClient) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -313,7 +315,7 @@ func (app *localClient) BeginRecheckTxSync(req types.RequestBeginRecheckTx) (*ty return &res, nil } -func (app *localClient) EndRecheckTxSync(req types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) { +func (app *localClient) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -322,7 +324,7 @@ func (app *localClient) EndRecheckTxSync(req types.RequestEndRecheckTx) (*types. return &res, nil } -func (app *localClient) ListSnapshotsSync(req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (app *localClient) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -330,7 +332,7 @@ func (app *localClient) ListSnapshotsSync(req types.RequestListSnapshots) (*type return &res, nil } -func (app *localClient) OfferSnapshotSync(req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (app *localClient) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -339,7 +341,7 @@ func (app *localClient) OfferSnapshotSync(req types.RequestOfferSnapshot) (*type } func (app *localClient) LoadSnapshotChunkSync( - req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { + req tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -348,7 +350,7 @@ func (app *localClient) LoadSnapshotChunkSync( } func (app *localClient) ApplySnapshotChunkSync( - req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { + req tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -358,7 +360,7 @@ func (app *localClient) ApplySnapshotChunkSync( //------------------------------------------------------- -func (app *localClient) done(reqRes *ReqRes, res *types.Response) *ReqRes { +func (app *localClient) done(reqRes *ReqRes, res *abci.Response) *ReqRes { set := reqRes.SetDone(res) if set { if globalCb := app.GetGlobalCallback(); globalCb != nil { diff --git a/abci/client/local_client_test.go b/abci/client/local_client_test.go index c8aab0ba1..bb8936f66 100644 --- a/abci/client/local_client_test.go +++ b/abci/client/local_client_test.go @@ -4,7 +4,9 @@ import ( "testing" "time" - "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + + types "github.com/line/ostracon/abci/types" "github.com/stretchr/testify/require" ) @@ -42,21 +44,21 @@ func TestLocalClientCalls(t *testing.T) { c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(types.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(types.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(types.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(types.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(types.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(tmabci.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(tmabci.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(tmabci.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(tmabci.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(tmabci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) c.InitChainAsync(types.RequestInitChain{}, getResponseCallback(t)) c.BeginBlockAsync(types.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(types.RequestEndBlock{}, getResponseCallback(t)) + c.EndBlockAsync(tmabci.RequestEndBlock{}, getResponseCallback(t)) c.BeginRecheckTxAsync(types.RequestBeginRecheckTx{}, getResponseCallback(t)) c.EndRecheckTxAsync(types.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(types.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(types.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.ListSnapshotsAsync(tmabci.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(tmabci.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -64,19 +66,19 @@ func TestLocalClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(types.RequestInfo{}) + _, err = c.InfoSync(tmabci.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(types.RequestSetOption{}) + _, err = c.SetOptionSync(tmabci.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(types.RequestDeliverTx{}) + _, err = c.DeliverTxSync(tmabci.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(types.RequestCheckTx{}) + _, err = c.CheckTxSync(tmabci.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(types.RequestQuery{}) + _, err = c.QuerySync(tmabci.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() @@ -88,7 +90,7 @@ func TestLocalClientCalls(t *testing.T) { _, err = c.BeginBlockSync(types.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(types.RequestEndBlock{}) + _, err = c.EndBlockSync(tmabci.RequestEndBlock{}) require.NoError(t, err) _, err = c.BeginRecheckTxSync(types.RequestBeginRecheckTx{}) @@ -97,15 +99,15 @@ func TestLocalClientCalls(t *testing.T) { _, err = c.EndRecheckTxSync(types.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(types.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(tmabci.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(types.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(tmabci.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(types.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{}) require.NoError(t, err) } diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 21b69482c..ab8cd355e 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -3,12 +3,13 @@ package mocks import ( - abcicli "github.com/line/ostracon/abci/client" - log "github.com/line/ostracon/libs/log" - mock "github.com/stretchr/testify/mock" - types "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + + abcicli "github.com/line/ostracon/abci/client" + abci "github.com/line/ostracon/abci/types" + log "github.com/line/ostracon/libs/log" ) // Client is an autogenerated mock type for the Client type @@ -17,11 +18,11 @@ type Client struct { } // ApplySnapshotChunkAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) ApplySnapshotChunkAsync(_a0 types.RequestApplySnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) ApplySnapshotChunkAsync(_a0 tmabci.RequestApplySnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -33,20 +34,20 @@ func (_m *Client) ApplySnapshotChunkAsync(_a0 types.RequestApplySnapshotChunk, _ } // ApplySnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *Client) ApplySnapshotChunkSync(_a0 types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { +func (_m *Client) ApplySnapshotChunkSync(_a0 tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *types.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { + var r0 *tmabci.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk) *tmabci.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*tmabci.ResponseApplySnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -56,11 +57,11 @@ func (_m *Client) ApplySnapshotChunkSync(_a0 types.RequestApplySnapshotChunk) (* } // BeginBlockAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) BeginBlockAsync(_a0 types.RequestBeginBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) BeginBlockAsync(_a0 abci.RequestBeginBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestBeginBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestBeginBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -72,20 +73,20 @@ func (_m *Client) BeginBlockAsync(_a0 types.RequestBeginBlock, _a1 abcicli.Respo } // BeginBlockSync provides a mock function with given fields: _a0 -func (_m *Client) BeginBlockSync(_a0 types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { +func (_m *Client) BeginBlockSync(_a0 abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { ret := _m.Called(_a0) - var r0 *types.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(types.RequestBeginBlock) *types.ResponseBeginBlock); ok { + var r0 *tmabci.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(abci.RequestBeginBlock) *tmabci.ResponseBeginBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseBeginBlock) + r0 = ret.Get(0).(*tmabci.ResponseBeginBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestBeginBlock) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestBeginBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -95,11 +96,11 @@ func (_m *Client) BeginBlockSync(_a0 types.RequestBeginBlock) (*types.ResponseBe } // BeginRecheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) BeginRecheckTxAsync(_a0 types.RequestBeginRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) BeginRecheckTxAsync(_a0 abci.RequestBeginRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestBeginRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestBeginRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -111,20 +112,20 @@ func (_m *Client) BeginRecheckTxAsync(_a0 types.RequestBeginRecheckTx, _a1 abcic } // BeginRecheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) BeginRecheckTxSync(_a0 types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) { +func (_m *Client) BeginRecheckTxSync(_a0 abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseBeginRecheckTx - if rf, ok := ret.Get(0).(func(types.RequestBeginRecheckTx) *types.ResponseBeginRecheckTx); ok { + var r0 *abci.ResponseBeginRecheckTx + if rf, ok := ret.Get(0).(func(abci.RequestBeginRecheckTx) *abci.ResponseBeginRecheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseBeginRecheckTx) + r0 = ret.Get(0).(*abci.ResponseBeginRecheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestBeginRecheckTx) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestBeginRecheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -134,11 +135,11 @@ func (_m *Client) BeginRecheckTxSync(_a0 types.RequestBeginRecheckTx) (*types.Re } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -150,20 +151,20 @@ func (_m *Client) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcicli.ResponseCal } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) CheckTxSync(_a0 types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (_m *Client) CheckTxSync(_a0 tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseCheckTx - if rf, ok := ret.Get(0).(func(types.RequestCheckTx) *types.ResponseCheckTx); ok { + var r0 *abci.ResponseCheckTx + if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx) *abci.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseCheckTx) + r0 = ret.Get(0).(*abci.ResponseCheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestCheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -189,15 +190,15 @@ func (_m *Client) CommitAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqRes { } // CommitSync provides a mock function with given fields: -func (_m *Client) CommitSync() (*types.ResponseCommit, error) { +func (_m *Client) CommitSync() (*tmabci.ResponseCommit, error) { ret := _m.Called() - var r0 *types.ResponseCommit - if rf, ok := ret.Get(0).(func() *types.ResponseCommit); ok { + var r0 *tmabci.ResponseCommit + if rf, ok := ret.Get(0).(func() *tmabci.ResponseCommit); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseCommit) + r0 = ret.Get(0).(*tmabci.ResponseCommit) } } @@ -212,11 +213,11 @@ func (_m *Client) CommitSync() (*types.ResponseCommit, error) { } // DeliverTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) DeliverTxAsync(_a0 types.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) DeliverTxAsync(_a0 tmabci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -228,20 +229,20 @@ func (_m *Client) DeliverTxAsync(_a0 types.RequestDeliverTx, _a1 abcicli.Respons } // DeliverTxSync provides a mock function with given fields: _a0 -func (_m *Client) DeliverTxSync(_a0 types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { +func (_m *Client) DeliverTxSync(_a0 tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseDeliverTx - if rf, ok := ret.Get(0).(func(types.RequestDeliverTx) *types.ResponseDeliverTx); ok { + var r0 *tmabci.ResponseDeliverTx + if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx) *tmabci.ResponseDeliverTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseDeliverTx) + r0 = ret.Get(0).(*tmabci.ResponseDeliverTx) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestDeliverTx) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestDeliverTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -267,15 +268,15 @@ func (_m *Client) EchoAsync(_a0 string, _a1 abcicli.ResponseCallback) *abcicli.R } // EchoSync provides a mock function with given fields: _a0 -func (_m *Client) EchoSync(_a0 string) (*types.ResponseEcho, error) { +func (_m *Client) EchoSync(_a0 string) (*tmabci.ResponseEcho, error) { ret := _m.Called(_a0) - var r0 *types.ResponseEcho - if rf, ok := ret.Get(0).(func(string) *types.ResponseEcho); ok { + var r0 *tmabci.ResponseEcho + if rf, ok := ret.Get(0).(func(string) *tmabci.ResponseEcho); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseEcho) + r0 = ret.Get(0).(*tmabci.ResponseEcho) } } @@ -290,11 +291,11 @@ func (_m *Client) EchoSync(_a0 string) (*types.ResponseEcho, error) { } // EndBlockAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) EndBlockAsync(_a0 types.RequestEndBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) EndBlockAsync(_a0 tmabci.RequestEndBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestEndBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -306,20 +307,20 @@ func (_m *Client) EndBlockAsync(_a0 types.RequestEndBlock, _a1 abcicli.ResponseC } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *Client) EndBlockSync(_a0 types.RequestEndBlock) (*types.ResponseEndBlock, error) { +func (_m *Client) EndBlockSync(_a0 tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *types.ResponseEndBlock - if rf, ok := ret.Get(0).(func(types.RequestEndBlock) *types.ResponseEndBlock); ok { + var r0 *abci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock) *abci.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseEndBlock) + r0 = ret.Get(0).(*abci.ResponseEndBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestEndBlock) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestEndBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -329,11 +330,11 @@ func (_m *Client) EndBlockSync(_a0 types.RequestEndBlock) (*types.ResponseEndBlo } // EndRecheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) EndRecheckTxAsync(_a0 types.RequestEndRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) EndRecheckTxAsync(_a0 abci.RequestEndRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestEndRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestEndRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -345,20 +346,20 @@ func (_m *Client) EndRecheckTxAsync(_a0 types.RequestEndRecheckTx, _a1 abcicli.R } // EndRecheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) EndRecheckTxSync(_a0 types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) { +func (_m *Client) EndRecheckTxSync(_a0 abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseEndRecheckTx - if rf, ok := ret.Get(0).(func(types.RequestEndRecheckTx) *types.ResponseEndRecheckTx); ok { + var r0 *abci.ResponseEndRecheckTx + if rf, ok := ret.Get(0).(func(abci.RequestEndRecheckTx) *abci.ResponseEndRecheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseEndRecheckTx) + r0 = ret.Get(0).(*abci.ResponseEndRecheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestEndRecheckTx) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestEndRecheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -398,15 +399,15 @@ func (_m *Client) FlushAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqRes { } // FlushSync provides a mock function with given fields: -func (_m *Client) FlushSync() (*types.ResponseFlush, error) { +func (_m *Client) FlushSync() (*tmabci.ResponseFlush, error) { ret := _m.Called() - var r0 *types.ResponseFlush - if rf, ok := ret.Get(0).(func() *types.ResponseFlush); ok { + var r0 *tmabci.ResponseFlush + if rf, ok := ret.Get(0).(func() *tmabci.ResponseFlush); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseFlush) + r0 = ret.Get(0).(*tmabci.ResponseFlush) } } @@ -437,11 +438,11 @@ func (_m *Client) GetGlobalCallback() abcicli.GlobalCallback { } // InfoAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) InfoAsync(_a0 types.RequestInfo, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) InfoAsync(_a0 tmabci.RequestInfo, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestInfo, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestInfo, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -453,20 +454,20 @@ func (_m *Client) InfoAsync(_a0 types.RequestInfo, _a1 abcicli.ResponseCallback) } // InfoSync provides a mock function with given fields: _a0 -func (_m *Client) InfoSync(_a0 types.RequestInfo) (*types.ResponseInfo, error) { +func (_m *Client) InfoSync(_a0 tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { ret := _m.Called(_a0) - var r0 *types.ResponseInfo - if rf, ok := ret.Get(0).(func(types.RequestInfo) *types.ResponseInfo); ok { + var r0 *tmabci.ResponseInfo + if rf, ok := ret.Get(0).(func(tmabci.RequestInfo) *tmabci.ResponseInfo); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseInfo) + r0 = ret.Get(0).(*tmabci.ResponseInfo) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestInfo) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -476,11 +477,11 @@ func (_m *Client) InfoSync(_a0 types.RequestInfo) (*types.ResponseInfo, error) { } // InitChainAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) InitChainAsync(_a0 types.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) InitChainAsync(_a0 abci.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -492,20 +493,20 @@ func (_m *Client) InitChainAsync(_a0 types.RequestInitChain, _a1 abcicli.Respons } // InitChainSync provides a mock function with given fields: _a0 -func (_m *Client) InitChainSync(_a0 types.RequestInitChain) (*types.ResponseInitChain, error) { +func (_m *Client) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *types.ResponseInitChain - if rf, ok := ret.Get(0).(func(types.RequestInitChain) *types.ResponseInitChain); ok { + var r0 *abci.ResponseInitChain + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseInitChain) + r0 = ret.Get(0).(*abci.ResponseInitChain) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -529,11 +530,11 @@ func (_m *Client) IsRunning() bool { } // ListSnapshotsAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) ListSnapshotsAsync(_a0 types.RequestListSnapshots, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) ListSnapshotsAsync(_a0 tmabci.RequestListSnapshots, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestListSnapshots, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -545,20 +546,20 @@ func (_m *Client) ListSnapshotsAsync(_a0 types.RequestListSnapshots, _a1 abcicli } // ListSnapshotsSync provides a mock function with given fields: _a0 -func (_m *Client) ListSnapshotsSync(_a0 types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (_m *Client) ListSnapshotsSync(_a0 tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { ret := _m.Called(_a0) - var r0 *types.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(types.RequestListSnapshots) *types.ResponseListSnapshots); ok { + var r0 *tmabci.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots) *tmabci.ResponseListSnapshots); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseListSnapshots) + r0 = ret.Get(0).(*tmabci.ResponseListSnapshots) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestListSnapshots) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -568,11 +569,11 @@ func (_m *Client) ListSnapshotsSync(_a0 types.RequestListSnapshots) (*types.Resp } // LoadSnapshotChunkAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) LoadSnapshotChunkAsync(_a0 types.RequestLoadSnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) LoadSnapshotChunkAsync(_a0 tmabci.RequestLoadSnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -584,20 +585,20 @@ func (_m *Client) LoadSnapshotChunkAsync(_a0 types.RequestLoadSnapshotChunk, _a1 } // LoadSnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *Client) LoadSnapshotChunkSync(_a0 types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { +func (_m *Client) LoadSnapshotChunkSync(_a0 tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *types.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { + var r0 *tmabci.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk) *tmabci.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*tmabci.ResponseLoadSnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -607,11 +608,11 @@ func (_m *Client) LoadSnapshotChunkSync(_a0 types.RequestLoadSnapshotChunk) (*ty } // OfferSnapshotAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) OfferSnapshotAsync(_a0 types.RequestOfferSnapshot, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) OfferSnapshotAsync(_a0 tmabci.RequestOfferSnapshot, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -623,20 +624,20 @@ func (_m *Client) OfferSnapshotAsync(_a0 types.RequestOfferSnapshot, _a1 abcicli } // OfferSnapshotSync provides a mock function with given fields: _a0 -func (_m *Client) OfferSnapshotSync(_a0 types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (_m *Client) OfferSnapshotSync(_a0 tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { ret := _m.Called(_a0) - var r0 *types.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { + var r0 *tmabci.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot) *tmabci.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseOfferSnapshot) + r0 = ret.Get(0).(*tmabci.ResponseOfferSnapshot) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestOfferSnapshot) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -679,11 +680,11 @@ func (_m *Client) OnStop() { } // QueryAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) QueryAsync(_a0 types.RequestQuery, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) QueryAsync(_a0 tmabci.RequestQuery, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestQuery, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestQuery, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -695,20 +696,20 @@ func (_m *Client) QueryAsync(_a0 types.RequestQuery, _a1 abcicli.ResponseCallbac } // QuerySync provides a mock function with given fields: _a0 -func (_m *Client) QuerySync(_a0 types.RequestQuery) (*types.ResponseQuery, error) { +func (_m *Client) QuerySync(_a0 tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { ret := _m.Called(_a0) - var r0 *types.ResponseQuery - if rf, ok := ret.Get(0).(func(types.RequestQuery) *types.ResponseQuery); ok { + var r0 *tmabci.ResponseQuery + if rf, ok := ret.Get(0).(func(tmabci.RequestQuery) *tmabci.ResponseQuery); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseQuery) + r0 = ret.Get(0).(*tmabci.ResponseQuery) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestQuery) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -758,11 +759,11 @@ func (_m *Client) SetLogger(_a0 log.Logger) { } // SetOptionAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) SetOptionAsync(_a0 types.RequestSetOption, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) SetOptionAsync(_a0 tmabci.RequestSetOption, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestSetOption, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestSetOption, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -774,20 +775,20 @@ func (_m *Client) SetOptionAsync(_a0 types.RequestSetOption, _a1 abcicli.Respons } // SetOptionSync provides a mock function with given fields: _a0 -func (_m *Client) SetOptionSync(_a0 types.RequestSetOption) (*types.ResponseSetOption, error) { +func (_m *Client) SetOptionSync(_a0 tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { ret := _m.Called(_a0) - var r0 *types.ResponseSetOption - if rf, ok := ret.Get(0).(func(types.RequestSetOption) *types.ResponseSetOption); ok { + var r0 *tmabci.ResponseSetOption + if rf, ok := ret.Get(0).(func(tmabci.RequestSetOption) *tmabci.ResponseSetOption); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseSetOption) + r0 = ret.Get(0).(*tmabci.ResponseSetOption) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestSetOption) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestSetOption) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index 4d63523db..aca2dc8d7 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -10,7 +10,9 @@ import ( "reflect" "time" - "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + + abci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" @@ -129,14 +131,14 @@ func (cli *socketClient) sendRequestsRoutine(conn io.Writer) { // cli.Logger.Debug("Sent request", "requestType", reflect.TypeOf(reqres.Request), "request", reqres.Request) cli.willSendReq(reqres) - err := types.WriteMessage(reqres.Request, w) + err := abci.WriteMessage(reqres.Request, w) if err != nil { cli.stopForError(fmt.Errorf("write to buffer: %w", err)) return } // If it's a flush request, flush the current buffer. - if _, ok := reqres.Request.Value.(*types.Request_Flush); ok { + if _, ok := reqres.Request.Value.(*abci.Request_Flush); ok { err = w.Flush() if err != nil { cli.stopForError(fmt.Errorf("flush buffer: %w", err)) @@ -145,7 +147,7 @@ func (cli *socketClient) sendRequestsRoutine(conn io.Writer) { } case <-cli.flushTimer.Ch: // flush queue select { - case cli.reqQueue <- NewReqRes(types.ToRequestFlush(), nil): + case cli.reqQueue <- NewReqRes(abci.ToRequestFlush(), nil): default: // Probably will fill the buffer, or retry later. } @@ -158,8 +160,8 @@ func (cli *socketClient) sendRequestsRoutine(conn io.Writer) { func (cli *socketClient) recvResponseRoutine(conn io.Reader) { r := bufio.NewReader(conn) for { - var res = &types.Response{} - err := types.ReadMessage(r, res) + var res = &abci.Response{} + err := abci.ReadMessage(r, res) if err != nil { cli.stopForError(fmt.Errorf("read message: %w", err)) return @@ -168,7 +170,7 @@ func (cli *socketClient) recvResponseRoutine(conn io.Reader) { // cli.Logger.Debug("Received response", "responseType", reflect.TypeOf(res), "response", res) switch r := res.Value.(type) { - case *types.Response_Exception: // app responded with error + case *abci.Response_Exception: // app responded with error // XXX After setting cli.err, release waiters (e.g. reqres.Done()) cli.stopForError(errors.New(r.Exception.Error)) return @@ -188,7 +190,7 @@ func (cli *socketClient) willSendReq(reqres *ReqRes) { cli.reqSent.PushBack(reqres) } -func (cli *socketClient) didRecvResponse(res *types.Response) error { +func (cli *socketClient) didRecvResponse(res *abci.Response) error { cli.mtx.Lock() defer cli.mtx.Unlock() @@ -225,77 +227,77 @@ func (cli *socketClient) didRecvResponse(res *types.Response) error { //---------------------------------------- func (cli *socketClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestEcho(msg), cb) + return cli.queueRequest(abci.ToRequestEcho(msg), cb) } func (cli *socketClient) FlushAsync(cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestFlush(), cb) + return cli.queueRequest(abci.ToRequestFlush(), cb) } -func (cli *socketClient) InfoAsync(req types.RequestInfo, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestInfo(req), cb) +func (cli *socketClient) InfoAsync(req tmabci.RequestInfo, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestInfo(req), cb) } -func (cli *socketClient) SetOptionAsync(req types.RequestSetOption, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestSetOption(req), cb) +func (cli *socketClient) SetOptionAsync(req tmabci.RequestSetOption, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestSetOption(req), cb) } -func (cli *socketClient) DeliverTxAsync(req types.RequestDeliverTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestDeliverTx(req), cb) +func (cli *socketClient) DeliverTxAsync(req tmabci.RequestDeliverTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestDeliverTx(req), cb) } -func (cli *socketClient) CheckTxAsync(req types.RequestCheckTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestCheckTx(req), cb) +func (cli *socketClient) CheckTxAsync(req tmabci.RequestCheckTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestCheckTx(req), cb) } -func (cli *socketClient) QueryAsync(req types.RequestQuery, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestQuery(req), cb) +func (cli *socketClient) QueryAsync(req tmabci.RequestQuery, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestQuery(req), cb) } func (cli *socketClient) CommitAsync(cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestCommit(), cb) + return cli.queueRequest(abci.ToRequestCommit(), cb) } -func (cli *socketClient) InitChainAsync(req types.RequestInitChain, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestInitChain(req), cb) +func (cli *socketClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestInitChain(req), cb) } -func (cli *socketClient) BeginBlockAsync(req types.RequestBeginBlock, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestBeginBlock(req), cb) +func (cli *socketClient) BeginBlockAsync(req abci.RequestBeginBlock, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestBeginBlock(req), cb) } -func (cli *socketClient) EndBlockAsync(req types.RequestEndBlock, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestEndBlock(req), cb) +func (cli *socketClient) EndBlockAsync(req tmabci.RequestEndBlock, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestEndBlock(req), cb) } -func (cli *socketClient) BeginRecheckTxAsync(req types.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestBeginRecheckTx(req), cb) +func (cli *socketClient) BeginRecheckTxAsync(req abci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestBeginRecheckTx(req), cb) } -func (cli *socketClient) EndRecheckTxAsync(req types.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestEndRecheckTx(req), cb) +func (cli *socketClient) EndRecheckTxAsync(req abci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestEndRecheckTx(req), cb) } -func (cli *socketClient) ListSnapshotsAsync(req types.RequestListSnapshots, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestListSnapshots(req), cb) +func (cli *socketClient) ListSnapshotsAsync(req tmabci.RequestListSnapshots, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestListSnapshots(req), cb) } -func (cli *socketClient) OfferSnapshotAsync(req types.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestOfferSnapshot(req), cb) +func (cli *socketClient) OfferSnapshotAsync(req tmabci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestOfferSnapshot(req), cb) } -func (cli *socketClient) LoadSnapshotChunkAsync(req types.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestLoadSnapshotChunk(req), cb) +func (cli *socketClient) LoadSnapshotChunkAsync(req tmabci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestLoadSnapshotChunk(req), cb) } -func (cli *socketClient) ApplySnapshotChunkAsync(req types.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { - return cli.queueRequest(types.ToRequestApplySnapshotChunk(req), cb) +func (cli *socketClient) ApplySnapshotChunkAsync(req tmabci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { + return cli.queueRequest(abci.ToRequestApplySnapshotChunk(req), cb) } //---------------------------------------- -func (cli *socketClient) FlushSync() (*types.ResponseFlush, error) { - reqRes := cli.queueRequest(types.ToRequestFlush(), nil) +func (cli *socketClient) FlushSync() (*tmabci.ResponseFlush, error) { + reqRes := cli.queueRequest(abci.ToRequestFlush(), nil) if err := cli.Error(); err != nil { return nil, err } @@ -303,8 +305,8 @@ func (cli *socketClient) FlushSync() (*types.ResponseFlush, error) { return reqRes.Response.GetFlush(), cli.Error() } -func (cli *socketClient) EchoSync(msg string) (*types.ResponseEcho, error) { - reqres := cli.queueRequest(types.ToRequestEcho(msg), nil) +func (cli *socketClient) EchoSync(msg string) (*tmabci.ResponseEcho, error) { + reqres := cli.queueRequest(abci.ToRequestEcho(msg), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -312,8 +314,8 @@ func (cli *socketClient) EchoSync(msg string) (*types.ResponseEcho, error) { return reqres.Response.GetEcho(), cli.Error() } -func (cli *socketClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { - reqres := cli.queueRequest(types.ToRequestInfo(req), nil) +func (cli *socketClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { + reqres := cli.queueRequest(abci.ToRequestInfo(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -321,8 +323,8 @@ func (cli *socketClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, e return reqres.Response.GetInfo(), cli.Error() } -func (cli *socketClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { - reqres := cli.queueRequest(types.ToRequestSetOption(req), nil) +func (cli *socketClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { + reqres := cli.queueRequest(abci.ToRequestSetOption(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -330,8 +332,8 @@ func (cli *socketClient) SetOptionSync(req types.RequestSetOption) (*types.Respo return reqres.Response.GetSetOption(), cli.Error() } -func (cli *socketClient) DeliverTxSync(req types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { - reqres := cli.queueRequest(types.ToRequestDeliverTx(req), nil) +func (cli *socketClient) DeliverTxSync(req tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { + reqres := cli.queueRequest(abci.ToRequestDeliverTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -339,8 +341,8 @@ func (cli *socketClient) DeliverTxSync(req types.RequestDeliverTx) (*types.Respo return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *socketClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) { - reqres := cli.queueRequest(types.ToRequestCheckTx(req), nil) +func (cli *socketClient) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { + reqres := cli.queueRequest(abci.ToRequestCheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -348,8 +350,8 @@ func (cli *socketClient) CheckTxSync(req types.RequestCheckTx) (*types.ResponseC return reqres.Response.GetCheckTx(), cli.Error() } -func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { - reqres := cli.queueRequest(types.ToRequestQuery(req), nil) +func (cli *socketClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { + reqres := cli.queueRequest(abci.ToRequestQuery(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -357,8 +359,8 @@ func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery return reqres.Response.GetQuery(), cli.Error() } -func (cli *socketClient) CommitSync() (*types.ResponseCommit, error) { - reqres := cli.queueRequest(types.ToRequestCommit(), nil) +func (cli *socketClient) CommitSync() (*tmabci.ResponseCommit, error) { + reqres := cli.queueRequest(abci.ToRequestCommit(), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -366,8 +368,8 @@ func (cli *socketClient) CommitSync() (*types.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *socketClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { - reqres := cli.queueRequest(types.ToRequestInitChain(req), nil) +func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { + reqres := cli.queueRequest(abci.ToRequestInitChain(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -375,8 +377,8 @@ func (cli *socketClient) InitChainSync(req types.RequestInitChain) (*types.Respo return reqres.Response.GetInitChain(), cli.Error() } -func (cli *socketClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { - reqres := cli.queueRequest(types.ToRequestBeginBlock(req), nil) +func (cli *socketClient) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { + reqres := cli.queueRequest(abci.ToRequestBeginBlock(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -384,8 +386,8 @@ func (cli *socketClient) BeginBlockSync(req types.RequestBeginBlock) (*types.Res return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *socketClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { - reqres := cli.queueRequest(types.ToRequestEndBlock(req), nil) +func (cli *socketClient) EndBlockSync(req tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { + reqres := cli.queueRequest(abci.ToRequestEndBlock(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -393,8 +395,8 @@ func (cli *socketClient) EndBlockSync(req types.RequestEndBlock) (*types.Respons return reqres.Response.GetEndBlock(), cli.Error() } -func (cli *socketClient) BeginRecheckTxSync(req types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) { - reqres := cli.queueRequest(types.ToRequestBeginRecheckTx(req), nil) +func (cli *socketClient) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { + reqres := cli.queueRequest(abci.ToRequestBeginRecheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -402,8 +404,8 @@ func (cli *socketClient) BeginRecheckTxSync(req types.RequestBeginRecheckTx) (*t return reqres.Response.GetBeginRecheckTx(), cli.Error() } -func (cli *socketClient) EndRecheckTxSync(req types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) { - reqres := cli.queueRequest(types.ToRequestEndRecheckTx(req), nil) +func (cli *socketClient) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { + reqres := cli.queueRequest(abci.ToRequestEndRecheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -411,8 +413,8 @@ func (cli *socketClient) EndRecheckTxSync(req types.RequestEndRecheckTx) (*types return reqres.Response.GetEndRecheckTx(), cli.Error() } -func (cli *socketClient) ListSnapshotsSync(req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { - reqres := cli.queueRequest(types.ToRequestListSnapshots(req), nil) +func (cli *socketClient) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { + reqres := cli.queueRequest(abci.ToRequestListSnapshots(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -420,8 +422,8 @@ func (cli *socketClient) ListSnapshotsSync(req types.RequestListSnapshots) (*typ return reqres.Response.GetListSnapshots(), cli.Error() } -func (cli *socketClient) OfferSnapshotSync(req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { - reqres := cli.queueRequest(types.ToRequestOfferSnapshot(req), nil) +func (cli *socketClient) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { + reqres := cli.queueRequest(abci.ToRequestOfferSnapshot(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -430,8 +432,8 @@ func (cli *socketClient) OfferSnapshotSync(req types.RequestOfferSnapshot) (*typ } func (cli *socketClient) LoadSnapshotChunkSync( - req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { - reqres := cli.queueRequest(types.ToRequestLoadSnapshotChunk(req), nil) + req tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { + reqres := cli.queueRequest(abci.ToRequestLoadSnapshotChunk(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -440,8 +442,8 @@ func (cli *socketClient) LoadSnapshotChunkSync( } func (cli *socketClient) ApplySnapshotChunkSync( - req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { - reqres := cli.queueRequest(types.ToRequestApplySnapshotChunk(req), nil) + req tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { + reqres := cli.queueRequest(abci.ToRequestApplySnapshotChunk(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -450,7 +452,7 @@ func (cli *socketClient) ApplySnapshotChunkSync( //---------------------------------------- -func (cli *socketClient) queueRequest(req *types.Request, cb ResponseCallback) *ReqRes { +func (cli *socketClient) queueRequest(req *abci.Request, cb ResponseCallback) *ReqRes { reqres := NewReqRes(req, cb) // TODO: set cli.err if reqQueue times out @@ -458,7 +460,7 @@ func (cli *socketClient) queueRequest(req *types.Request, cb ResponseCallback) * // Maybe auto-flush, or unset auto-flush switch req.Value.(type) { - case *types.Request_Flush: + case *abci.Request_Flush: cli.flushTimer.Unset() default: cli.flushTimer.Set() @@ -491,42 +493,42 @@ LOOP: //---------------------------------------- -func resMatchesReq(req *types.Request, res *types.Response) (ok bool) { +func resMatchesReq(req *abci.Request, res *abci.Response) (ok bool) { switch req.Value.(type) { - case *types.Request_Echo: - _, ok = res.Value.(*types.Response_Echo) - case *types.Request_Flush: - _, ok = res.Value.(*types.Response_Flush) - case *types.Request_Info: - _, ok = res.Value.(*types.Response_Info) - case *types.Request_SetOption: - _, ok = res.Value.(*types.Response_SetOption) - case *types.Request_DeliverTx: - _, ok = res.Value.(*types.Response_DeliverTx) - case *types.Request_CheckTx: - _, ok = res.Value.(*types.Response_CheckTx) - case *types.Request_Commit: - _, ok = res.Value.(*types.Response_Commit) - case *types.Request_Query: - _, ok = res.Value.(*types.Response_Query) - case *types.Request_InitChain: - _, ok = res.Value.(*types.Response_InitChain) - case *types.Request_BeginBlock: - _, ok = res.Value.(*types.Response_BeginBlock) - case *types.Request_EndBlock: - _, ok = res.Value.(*types.Response_EndBlock) - case *types.Request_BeginRecheckTx: - _, ok = res.Value.(*types.Response_BeginRecheckTx) - case *types.Request_EndRecheckTx: - _, ok = res.Value.(*types.Response_EndRecheckTx) - case *types.Request_ApplySnapshotChunk: - _, ok = res.Value.(*types.Response_ApplySnapshotChunk) - case *types.Request_LoadSnapshotChunk: - _, ok = res.Value.(*types.Response_LoadSnapshotChunk) - case *types.Request_ListSnapshots: - _, ok = res.Value.(*types.Response_ListSnapshots) - case *types.Request_OfferSnapshot: - _, ok = res.Value.(*types.Response_OfferSnapshot) + case *abci.Request_Echo: + _, ok = res.Value.(*abci.Response_Echo) + case *abci.Request_Flush: + _, ok = res.Value.(*abci.Response_Flush) + case *abci.Request_Info: + _, ok = res.Value.(*abci.Response_Info) + case *abci.Request_SetOption: + _, ok = res.Value.(*abci.Response_SetOption) + case *abci.Request_DeliverTx: + _, ok = res.Value.(*abci.Response_DeliverTx) + case *abci.Request_CheckTx: + _, ok = res.Value.(*abci.Response_CheckTx) + case *abci.Request_Commit: + _, ok = res.Value.(*abci.Response_Commit) + case *abci.Request_Query: + _, ok = res.Value.(*abci.Response_Query) + case *abci.Request_InitChain: + _, ok = res.Value.(*abci.Response_InitChain) + case *abci.Request_BeginBlock: + _, ok = res.Value.(*abci.Response_BeginBlock) + case *abci.Request_EndBlock: + _, ok = res.Value.(*abci.Response_EndBlock) + case *abci.Request_BeginRecheckTx: + _, ok = res.Value.(*abci.Response_BeginRecheckTx) + case *abci.Request_EndRecheckTx: + _, ok = res.Value.(*abci.Response_EndRecheckTx) + case *abci.Request_ApplySnapshotChunk: + _, ok = res.Value.(*abci.Response_ApplySnapshotChunk) + case *abci.Request_LoadSnapshotChunk: + _, ok = res.Value.(*abci.Response_LoadSnapshotChunk) + case *abci.Request_ListSnapshots: + _, ok = res.Value.(*abci.Response_ListSnapshots) + case *abci.Request_OfferSnapshot: + _, ok = res.Value.(*abci.Response_OfferSnapshot) } return ok } diff --git a/abci/client/socket_client_test.go b/abci/client/socket_client_test.go index 1d7de4d97..c5b32a062 100644 --- a/abci/client/socket_client_test.go +++ b/abci/client/socket_client_test.go @@ -8,9 +8,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/server" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/libs/service" ) @@ -33,7 +35,7 @@ func TestProperSyncCalls(t *testing.T) { resp := make(chan error, 1) go func() { // This is BeginBlockSync unrolled.... - reqres := c.BeginBlockAsync(types.RequestBeginBlock{}, nil) + reqres := c.BeginBlockAsync(abci.RequestBeginBlock{}, nil) _, err := c.FlushSync() require.NoError(t, err) res := reqres.Response.GetBeginBlock() @@ -68,7 +70,7 @@ func TestHangingSyncCalls(t *testing.T) { resp := make(chan error, 1) go func() { // Start BeginBlock and flush it - reqres := c.BeginBlockAsync(types.RequestBeginBlock{}, nil) + reqres := c.BeginBlockAsync(abci.RequestBeginBlock{}, nil) flush := c.FlushAsync(nil) // wait 20 ms for all events to travel socket, but // no response yet from server @@ -92,7 +94,7 @@ func TestHangingSyncCalls(t *testing.T) { } } -func setupClientServer(t *testing.T, app types.Application) ( +func setupClientServer(t *testing.T, app abci.Application) ( service.Service, abcicli.Client) { // some port between 20k and 30k port := 20000 + tmrand.Int32()%10000 @@ -111,12 +113,12 @@ func setupClientServer(t *testing.T, app types.Application) ( } type slowApp struct { - types.BaseApplication + abci.BaseApplication } -func (slowApp) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock { +func (slowApp) BeginBlock(req abci.RequestBeginBlock) tmabci.ResponseBeginBlock { time.Sleep(200 * time.Millisecond) - return types.ResponseBeginBlock{} + return tmabci.ResponseBeginBlock{} } func TestSockerClientCalls(t *testing.T) { @@ -134,26 +136,26 @@ func TestSockerClientCalls(t *testing.T) { } }) - c.SetGlobalCallback(func(*types.Request, *types.Response) { + c.SetGlobalCallback(func(*abci.Request, *abci.Response) { }) c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(types.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(types.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(types.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(types.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(types.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(tmabci.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(tmabci.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(tmabci.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(tmabci.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(tmabci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(types.RequestInitChain{}, getResponseCallback(t)) - c.BeginBlockAsync(types.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(types.RequestEndBlock{}, getResponseCallback(t)) - c.BeginRecheckTxAsync(types.RequestBeginRecheckTx{}, getResponseCallback(t)) - c.EndRecheckTxAsync(types.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(types.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(types.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) + c.BeginBlockAsync(abci.RequestBeginBlock{}, getResponseCallback(t)) + c.EndBlockAsync(tmabci.RequestEndBlock{}, getResponseCallback(t)) + c.BeginRecheckTxAsync(abci.RequestBeginRecheckTx{}, getResponseCallback(t)) + c.EndRecheckTxAsync(abci.RequestEndRecheckTx{}, getResponseCallback(t)) + c.ListSnapshotsAsync(tmabci.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(tmabci.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -161,54 +163,54 @@ func TestSockerClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(types.RequestInfo{}) + _, err = c.InfoSync(tmabci.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(types.RequestSetOption{}) + _, err = c.SetOptionSync(tmabci.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(types.RequestDeliverTx{}) + _, err = c.DeliverTxSync(tmabci.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(types.RequestCheckTx{}) + _, err = c.CheckTxSync(tmabci.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(types.RequestQuery{}) + _, err = c.QuerySync(tmabci.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(types.RequestInitChain{}) + _, err = c.InitChainSync(abci.RequestInitChain{}) require.NoError(t, err) - _, err = c.BeginBlockSync(types.RequestBeginBlock{}) + _, err = c.BeginBlockSync(abci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(types.RequestEndBlock{}) + _, err = c.EndBlockSync(tmabci.RequestEndBlock{}) require.NoError(t, err) - _, err = c.BeginRecheckTxSync(types.RequestBeginRecheckTx{}) + _, err = c.BeginRecheckTxSync(abci.RequestBeginRecheckTx{}) require.NoError(t, err) - _, err = c.EndRecheckTxSync(types.RequestEndRecheckTx{}) + _, err = c.EndRecheckTxSync(abci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(types.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(tmabci.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(types.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(tmabci.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(types.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{}) require.NoError(t, err) } type sampleApp struct { - types.BaseApplication + abci.BaseApplication } func newDoneChan(t *testing.T) chan struct{} { @@ -226,7 +228,7 @@ func newDoneChan(t *testing.T) chan struct{} { func getResponseCallback(t *testing.T) abcicli.ResponseCallback { doneChan := newDoneChan(t) - return func(res *types.Response) { + return func(res *abci.Response) { require.NotNil(t, res) doneChan <- struct{}{} } diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 134c04219..4ee8535c7 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -12,6 +12,8 @@ import ( "strings" "github.com/spf13/cobra" + + tmabci "github.com/tendermint/tendermint/abci/types" tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" abcicli "github.com/line/ostracon/abci/client" @@ -20,7 +22,7 @@ import ( "github.com/line/ostracon/abci/example/kvstore" "github.com/line/ostracon/abci/server" servertest "github.com/line/ostracon/abci/tests/server" - "github.com/line/ostracon/abci/types" + types "github.com/line/ostracon/abci/types" "github.com/line/ostracon/abci/version" "github.com/line/ostracon/config" "github.com/line/ostracon/crypto/encoding" @@ -517,7 +519,7 @@ func cmdInfo(cmd *cobra.Command, args []string) error { if len(args) == 1 { version = args[0] } - res, err := client.InfoSync(types.RequestInfo{Version: version}) + res, err := client.InfoSync(tmabci.RequestInfo{Version: version}) if err != nil { return err } @@ -540,7 +542,7 @@ func cmdSetOption(cmd *cobra.Command, args []string) error { } key, val := args[0], args[1] - _, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: val}) + _, err := client.SetOptionSync(tmabci.RequestSetOption{Key: key, Value: val}) if err != nil { return err } @@ -561,7 +563,7 @@ func cmdDeliverTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes}) + res, err := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) if err != nil { return err } @@ -587,7 +589,7 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res, err := client.CheckTxSync(types.RequestCheckTx{Tx: txBytes}) + res, err := client.CheckTxSync(tmabci.RequestCheckTx{Tx: txBytes}) if err != nil { return err } @@ -627,7 +629,7 @@ func cmdQuery(cmd *cobra.Command, args []string) error { return err } - resQuery, err := client.QuerySync(types.RequestQuery{ + resQuery, err := client.QuerySync(tmabci.RequestQuery{ Data: queryBytes, Path: flagPath, Height: int64(flagHeight), @@ -732,7 +734,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro pubStr, tx := kvstore.MakeValSetChangeTxAndMore(publicKey, flagVotingPower) { fmt.Printf("DeliverTxSync: data=%s, tx=%s\n", pubStr, tx) - res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: []byte(tx)}) + res, err := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: []byte(tx)}) if err != nil { return err } @@ -745,7 +747,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro } { fmt.Printf("QuerySync: data=%s\n", pubStr) - res, err := client.QuerySync(types.RequestQuery{Path: "/val", Data: []byte(pubStr)}) + res, err := client.QuerySync(tmabci.RequestQuery{Path: "/val", Data: []byte(pubStr)}) if err != nil { return err } diff --git a/abci/example/counter/counter.go b/abci/example/counter/counter.go index 3c9225e0e..e8953c6a1 100644 --- a/abci/example/counter/counter.go +++ b/abci/example/counter/counter.go @@ -4,12 +4,14 @@ import ( "encoding/binary" "fmt" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/abci/example/code" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" ) type Application struct { - types.BaseApplication + abci.BaseApplication hashCount int txCount int @@ -20,11 +22,11 @@ func NewApplication(serial bool) *Application { return &Application{serial: serial} } -func (app *Application) Info(req types.RequestInfo) types.ResponseInfo { - return types.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} +func (app *Application) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { + return tmabci.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } -func (app *Application) SetOption(req types.RequestSetOption) types.ResponseSetOption { +func (app *Application) SetOption(req tmabci.RequestSetOption) tmabci.ResponseSetOption { key, value := req.Key, req.Value if key == "serial" && value == "on" { app.serial = true @@ -32,20 +34,20 @@ func (app *Application) SetOption(req types.RequestSetOption) types.ResponseSetO /* TODO Panic and have the ABCI server pass an exception. The client can call SetOptionSync() and get an `error`. - return types.ResponseSetOption{ + return abci.ResponseSetOption{ Error: fmt.Sprintf("Unknown key (%s) or value (%s)", key, value), } */ - return types.ResponseSetOption{} + return tmabci.ResponseSetOption{} } - return types.ResponseSetOption{} + return tmabci.ResponseSetOption{} } -func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { +func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { if app.serial { if len(req.Tx) > 8 { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))} } @@ -53,27 +55,27 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli copy(tx8[len(tx8)-len(req.Tx):], req.Tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } } app.txCount++ - return types.ResponseDeliverTx{Code: code.CodeTypeOK} + return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} } -func (app *Application) CheckTxSync(req types.RequestCheckTx) types.ResponseCheckTx { +func (app *Application) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { return app.checkTx(req) } -func (app *Application) CheckTxAsync(req types.RequestCheckTx, callback types.CheckTxCallback) { +func (app *Application) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *Application) checkTx(req types.RequestCheckTx) types.ResponseCheckTx { +func (app *Application) checkTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { if app.serial { if len(req.Tx) > 8 { - return types.ResponseCheckTx{ + return abci.ResponseCheckTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))} } @@ -81,31 +83,31 @@ func (app *Application) checkTx(req types.RequestCheckTx) types.ResponseCheckTx copy(tx8[len(tx8)-len(req.Tx):], req.Tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return types.ResponseCheckTx{ + return abci.ResponseCheckTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return types.ResponseCheckTx{Code: code.CodeTypeOK} + return abci.ResponseCheckTx{Code: code.CodeTypeOK} } -func (app *Application) Commit() (resp types.ResponseCommit) { +func (app *Application) Commit() (resp tmabci.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return types.ResponseCommit{} + return tmabci.ResponseCommit{} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return types.ResponseCommit{Data: hash} + return tmabci.ResponseCommit{Data: hash} } -func (app *Application) Query(reqQuery types.RequestQuery) types.ResponseQuery { +func (app *Application) Query(reqQuery tmabci.RequestQuery) tmabci.ResponseQuery { switch reqQuery.Path { case "hash": - return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))} + return tmabci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))} case "tx": - return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))} + return tmabci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))} default: - return types.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} + return tmabci.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } diff --git a/abci/example/example_test.go b/abci/example/example_test.go index a7b98a30c..6753bafd2 100644 --- a/abci/example/example_test.go +++ b/abci/example/example_test.go @@ -15,6 +15,8 @@ import ( "golang.org/x/net/context" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" @@ -22,7 +24,7 @@ import ( "github.com/line/ostracon/abci/example/code" "github.com/line/ostracon/abci/example/kvstore" abciserver "github.com/line/ostracon/abci/server" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" ) func init() { @@ -36,15 +38,15 @@ func TestKVStore(t *testing.T) { func TestBaseApp(t *testing.T) { fmt.Println("### Testing BaseApp") - testStream(t, types.NewBaseApplication()) + testStream(t, abci.NewBaseApplication()) } func TestGRPC(t *testing.T) { fmt.Println("### Testing GRPC") - testGRPCSync(t, types.NewGRPCApplication(types.NewBaseApplication())) + testGRPCSync(t, abci.NewGRPCApplication(abci.NewBaseApplication())) } -func testStream(t *testing.T, app types.Application) { +func testStream(t *testing.T, app abci.Application) { numDeliverTxs := 20000 socketFile := fmt.Sprintf("test-%08x.sock", rand.Int31n(1<<30)) defer os.Remove(socketFile) @@ -76,10 +78,10 @@ func testStream(t *testing.T, app types.Application) { done := make(chan struct{}) counter := 0 - client.SetGlobalCallback(func(req *types.Request, res *types.Response) { + client.SetGlobalCallback(func(req *abci.Request, res *abci.Response) { // Process response switch r := res.Value.(type) { - case *types.Response_DeliverTx: + case *abci.Response_DeliverTx: counter++ if r.DeliverTx.Code != code.CodeTypeOK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) @@ -94,7 +96,7 @@ func testStream(t *testing.T, app types.Application) { }() return } - case *types.Response_Flush: + case *abci.Response_Flush: // ignore default: t.Error("Unexpected response type", reflect.TypeOf(res.Value)) @@ -104,7 +106,7 @@ func testStream(t *testing.T, app types.Application) { // Write requests for counter := 0; counter < numDeliverTxs; counter++ { // Send request - reqRes := client.DeliverTxAsync(types.RequestDeliverTx{Tx: []byte("test")}, nil) + reqRes := client.DeliverTxAsync(tmabci.RequestDeliverTx{Tx: []byte("test")}, nil) _ = reqRes // check err ? @@ -128,7 +130,7 @@ func dialerFunc(ctx context.Context, addr string) (net.Conn, error) { return tmnet.Connect(addr) } -func testGRPCSync(t *testing.T, app types.ABCIApplicationServer) { +func testGRPCSync(t *testing.T, app abci.ABCIApplicationServer) { numDeliverTxs := 2000 socketFile := fmt.Sprintf("/tmp/test-%08x.sock", rand.Int31n(1<<30)) defer os.Remove(socketFile) @@ -160,12 +162,12 @@ func testGRPCSync(t *testing.T, app types.ABCIApplicationServer) { } }) - client := types.NewABCIApplicationClient(conn) + client := abci.NewABCIApplicationClient(conn) // Write requests for counter := 0; counter < numDeliverTxs; counter++ { // Send request - response, err := client.DeliverTx(context.Background(), &types.RequestDeliverTx{Tx: []byte("test")}) + response, err := client.DeliverTx(context.Background(), &tmabci.RequestDeliverTx{Tx: []byte("test")}) if err != nil { t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } diff --git a/abci/example/kvstore/helpers.go b/abci/example/kvstore/helpers.go index 91fe03d37..6bf229814 100644 --- a/abci/example/kvstore/helpers.go +++ b/abci/example/kvstore/helpers.go @@ -2,6 +2,8 @@ package kvstore import ( "fmt" + "os" + "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -9,7 +11,6 @@ import ( tmos "github.com/line/ostracon/libs/os" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/privval" - "os" ) // LoadPrivValidatorKeyFile Load private key for use in an example or test. diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 884d32c60..4e9a93665 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -6,10 +6,11 @@ import ( "encoding/json" "fmt" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/version" ) @@ -61,10 +62,10 @@ func prefixKey(key []byte) []byte { //--------------------------------------------------- -var _ types.Application = (*Application)(nil) +var _ abci.Application = (*Application)(nil) type Application struct { - types.BaseApplication + abci.BaseApplication state State RetainBlocks int64 // blocks to retain after commit (via ResponseCommit.RetainHeight) @@ -75,8 +76,8 @@ func NewApplication() *Application { return &Application{state: state} } -func (app *Application) Info(req types.RequestInfo) (resInfo types.ResponseInfo) { - return types.ResponseInfo{ +func (app *Application) Info(req tmabci.RequestInfo) (resInfo tmabci.ResponseInfo) { + return tmabci.ResponseInfo{ Data: fmt.Sprintf("{\"size\":%v}", app.state.Size), Version: version.ABCIVersion, AppVersion: ProtocolVersion, @@ -86,7 +87,7 @@ func (app *Application) Info(req types.RequestInfo) (resInfo types.ResponseInfo) } // tx is either "key=value" or just arbitrary bytes -func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { +func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { var key, value []byte parts := bytes.Split(req.Tx, []byte("=")) if len(parts) == 2 { @@ -101,10 +102,10 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli } app.state.Size++ - events := []types.Event{ + events := []tmabci.Event{ { Type: "app", - Attributes: []types.EventAttribute{ + Attributes: []tmabci.EventAttribute{ {Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko"), Index: true}, {Key: []byte("key"), Value: key, Index: true}, {Key: []byte("index_key"), Value: []byte("index is working"), Index: true}, @@ -113,22 +114,22 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli }, } - return types.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events} + return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events} } -func (app *Application) CheckTxSync(req types.RequestCheckTx) types.ResponseCheckTx { +func (app *Application) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { return app.checkTx(req) } -func (app *Application) CheckTxAsync(req types.RequestCheckTx, callback types.CheckTxCallback) { +func (app *Application) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *Application) checkTx(req types.RequestCheckTx) types.ResponseCheckTx { - return types.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} +func (app *Application) checkTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { + return abci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} } -func (app *Application) Commit() types.ResponseCommit { +func (app *Application) Commit() tmabci.ResponseCommit { // Using a memdb - just return the big endian size of the db appHash := make([]byte, 8) binary.PutVarint(appHash, app.state.Size) @@ -136,7 +137,7 @@ func (app *Application) Commit() types.ResponseCommit { app.state.Height++ saveState(app.state) - resp := types.ResponseCommit{Data: appHash} + resp := tmabci.ResponseCommit{Data: appHash} if app.RetainBlocks > 0 && app.state.Height >= app.RetainBlocks { resp.RetainHeight = app.state.Height - app.RetainBlocks + 1 } @@ -144,7 +145,7 @@ func (app *Application) Commit() types.ResponseCommit { } // Returns an associated value or nil if missing. -func (app *Application) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { +func (app *Application) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { if reqQuery.Prove { value, err := app.state.db.Get(prefixKey(reqQuery.Data)) if err != nil { diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index f641ef30f..8b4242afb 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -9,6 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/code" abciserver "github.com/line/ostracon/abci/server" @@ -24,7 +26,7 @@ const ( ) func testKVStore(t *testing.T, app types.Application, tx []byte, key, value string) { - req := types.RequestDeliverTx{Tx: tx} + req := tmabci.RequestDeliverTx{Tx: tx} ar := app.DeliverTx(req) require.False(t, ar.IsErr(), ar) // repeating tx doesn't raise error @@ -33,11 +35,11 @@ func testKVStore(t *testing.T, app types.Application, tx []byte, key, value stri // commit app.Commit() - info := app.Info(types.RequestInfo{}) + info := app.Info(tmabci.RequestInfo{}) require.NotZero(t, info.LastBlockHeight) // make sure query is fine - resQuery := app.Query(types.RequestQuery{ + resQuery := app.Query(tmabci.RequestQuery{ Path: "/store", Data: []byte(key), }) @@ -47,7 +49,7 @@ func testKVStore(t *testing.T, app types.Application, tx []byte, key, value stri require.EqualValues(t, info.LastBlockHeight, resQuery.Height) // make sure proof is fine - resQuery = app.Query(types.RequestQuery{ + resQuery = app.Query(tmabci.RequestQuery{ Path: "/store", Data: []byte(key), Prove: true, @@ -95,7 +97,7 @@ func TestPersistentKVStoreInfo(t *testing.T) { InitKVStore(kvstore) height := int64(0) - resInfo := kvstore.Info(types.RequestInfo{}) + resInfo := kvstore.Info(tmabci.RequestInfo{}) if resInfo.LastBlockHeight != height { t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } @@ -107,10 +109,10 @@ func TestPersistentKVStoreInfo(t *testing.T) { Height: height, } kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header}) - kvstore.EndBlock(types.RequestEndBlock{Height: header.Height}) + kvstore.EndBlock(tmabci.RequestEndBlock{Height: header.Height}) kvstore.Commit() - resInfo = kvstore.Info(types.RequestInfo{}) + resInfo = kvstore.Info(tmabci.RequestInfo{}) if resInfo.LastBlockHeight != height { t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } @@ -202,11 +204,11 @@ func makeApplyBlock( kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header}) for _, tx := range txs { - if r := kvstore.DeliverTx(types.RequestDeliverTx{Tx: tx}); r.IsErr() { + if r := kvstore.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}); r.IsErr() { t.Fatal(r) } } - resEndBlock := kvstore.EndBlock(types.RequestEndBlock{Height: header.Height}) + resEndBlock := kvstore.EndBlock(tmabci.RequestEndBlock{Height: header.Height}) kvstore.Commit() valsEqual(t, diff, resEndBlock.ValidatorUpdates) @@ -216,19 +218,19 @@ func makeApplyBlock( func existInPersistStore(t *testing.T, kvstore types.Application, v types.ValidatorUpdate) { // success pubkeyStr, _ := MakeValSetChangeTxAndMore(v.PubKey, v.Power) - resQuery := kvstore.Query(types.RequestQuery{Path: "/val", Data: []byte(pubkeyStr)}) + resQuery := kvstore.Query(tmabci.RequestQuery{Path: "/val", Data: []byte(pubkeyStr)}) assert.False(t, resQuery.IsErr(), resQuery) assert.Equal(t, "", resQuery.Log) // failures { // default Query: does not exist - r := kvstore.Query(types.RequestQuery{Path: "/val_", Data: []byte(pubkeyStr)}) + r := kvstore.Query(tmabci.RequestQuery{Path: "/val_", Data: []byte(pubkeyStr)}) assert.False(t, r.IsErr(), r) assert.Contains(t, r.Log, "does not exist") } { // Query: does not exist - r := kvstore.Query(types.RequestQuery{Path: "/val", Data: []byte{}}) + r := kvstore.Query(tmabci.RequestQuery{Path: "/val", Data: []byte{}}) assert.False(t, r.IsErr(), r) assert.Equal(t, "", resQuery.Log) } @@ -347,23 +349,23 @@ func runClientTests(t *testing.T, client abcicli.Client) { } func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) { - ar, err := app.DeliverTxSync(types.RequestDeliverTx{Tx: tx}) + ar, err := app.DeliverTxSync(tmabci.RequestDeliverTx{Tx: tx}) require.NoError(t, err) require.False(t, ar.IsErr(), ar) // repeating tx doesn't raise error - ar, err = app.DeliverTxSync(types.RequestDeliverTx{Tx: tx}) + ar, err = app.DeliverTxSync(tmabci.RequestDeliverTx{Tx: tx}) require.NoError(t, err) require.False(t, ar.IsErr(), ar) // commit _, err = app.CommitSync() require.NoError(t, err) - info, err := app.InfoSync(types.RequestInfo{}) + info, err := app.InfoSync(tmabci.RequestInfo{}) require.NoError(t, err) require.NotZero(t, info.LastBlockHeight) // make sure query is fine - resQuery, err := app.QuerySync(types.RequestQuery{ + resQuery, err := app.QuerySync(tmabci.RequestQuery{ Path: "/store", Data: []byte(key), }) @@ -374,7 +376,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) require.EqualValues(t, info.LastBlockHeight, resQuery.Height) // make sure proof is fine - resQuery, err = app.QuerySync(types.RequestQuery{ + resQuery, err = app.QuerySync(tmabci.RequestQuery{ Path: "/store", Data: []byte(key), Prove: true, diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index f62dfcb7e..9b9f7867b 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -7,6 +7,7 @@ import ( "strconv" "strings" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" @@ -55,19 +56,19 @@ func (app *PersistentKVStoreApplication) SetLogger(l log.Logger) { app.logger = l } -func (app *PersistentKVStoreApplication) Info(req types.RequestInfo) types.ResponseInfo { +func (app *PersistentKVStoreApplication) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { res := app.app.Info(req) res.LastBlockHeight = app.app.state.Height res.LastBlockAppHash = app.app.state.AppHash return res } -func (app *PersistentKVStoreApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption { +func (app *PersistentKVStoreApplication) SetOption(req tmabci.RequestSetOption) tmabci.ResponseSetOption { return app.app.SetOption(req) } // tx is either "val:pubkey!power" or "key=value" or just arbitrary bytes -func (app *PersistentKVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { // if it starts with "val:", update the validator set // format is "val:pubkey!power" if isValidatorTx(req.Tx) { @@ -80,11 +81,11 @@ func (app *PersistentKVStoreApplication) DeliverTx(req types.RequestDeliverTx) t return app.app.DeliverTx(req) } -func (app *PersistentKVStoreApplication) CheckTxSync(req types.RequestCheckTx) types.ResponseCheckTx { +func (app *PersistentKVStoreApplication) CheckTxSync(req tmabci.RequestCheckTx) types.ResponseCheckTx { return app.app.CheckTxSync(req) } -func (app *PersistentKVStoreApplication) CheckTxAsync(req types.RequestCheckTx, callback types.CheckTxCallback) { +func (app *PersistentKVStoreApplication) CheckTxAsync(req tmabci.RequestCheckTx, callback types.CheckTxCallback) { app.app.CheckTxAsync(req, callback) } @@ -97,13 +98,13 @@ func (app *PersistentKVStoreApplication) EndRecheckTx(req types.RequestEndRechec } // Commit will panic if InitChain was not called -func (app *PersistentKVStoreApplication) Commit() types.ResponseCommit { +func (app *PersistentKVStoreApplication) Commit() tmabci.ResponseCommit { return app.app.Commit() } // When path=/val and data={validator address}, returns the validator update (types.ValidatorUpdate) varint encoded. // For any other path, returns an associated value or nil if missing. -func (app *PersistentKVStoreApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { +func (app *PersistentKVStoreApplication) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { switch reqQuery.Path { case "/val": key := []byte("val:" + string(reqQuery.Data)) @@ -132,13 +133,13 @@ func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) t } // Track the block hash and header information -func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock { +func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) tmabci.ResponseBeginBlock { // reset valset changes app.ValUpdates = make([]types.ValidatorUpdate, 0) // Punish validators who committed equivocation. for _, ev := range req.ByzantineValidators { - if ev.Type == types.EvidenceType_DUPLICATE_VOTE { + if ev.Type == tmabci.EvidenceType_DUPLICATE_VOTE { addr := string(ev.Validator.Address) if pubKey, ok := app.valAddrToPubKeyMap[addr]; ok { app.updateValidator(types.ValidatorUpdate{ @@ -154,32 +155,32 @@ func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) } } - return types.ResponseBeginBlock{} + return tmabci.ResponseBeginBlock{} } // Update the validator set -func (app *PersistentKVStoreApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock { +func (app *PersistentKVStoreApplication) EndBlock(req tmabci.RequestEndBlock) types.ResponseEndBlock { return types.ResponseEndBlock{ValidatorUpdates: app.ValUpdates} } func (app *PersistentKVStoreApplication) ListSnapshots( - req types.RequestListSnapshots) types.ResponseListSnapshots { - return types.ResponseListSnapshots{} + req tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { + return tmabci.ResponseListSnapshots{} } func (app *PersistentKVStoreApplication) LoadSnapshotChunk( - req types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk { - return types.ResponseLoadSnapshotChunk{} + req tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { + return tmabci.ResponseLoadSnapshotChunk{} } func (app *PersistentKVStoreApplication) OfferSnapshot( - req types.RequestOfferSnapshot) types.ResponseOfferSnapshot { - return types.ResponseOfferSnapshot{Result: types.ResponseOfferSnapshot_ABORT} + req tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { + return tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ABORT} } func (app *PersistentKVStoreApplication) ApplySnapshotChunk( - req types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk { - return types.ResponseApplySnapshotChunk{Result: types.ResponseApplySnapshotChunk_ABORT} + req tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { + return tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ABORT} } //--------------------------------------------- @@ -227,13 +228,13 @@ func isValidatorTx(tx []byte) bool { // format is "val:pubkey!power" // pubkey is a base64-encoded proto.ostracon.crypto.PublicKey bytes // See MakeValSetChangeTx -func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) tmabci.ResponseDeliverTx { tx = tx[len(ValidatorSetChangePrefix):] // get the pubkey and power pubKeyAndPower := strings.Split(string(tx), "!") if len(pubKeyAndPower) != 2 { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Expected 'pubkey!power'. Got %v", pubKeyAndPower)} } @@ -242,20 +243,20 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon // decode the pubkey pkBytes, err := base64.StdEncoding.DecodeString(pubkeyS) if err != nil { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pubkeyS (%s) is invalid base64", pubkeyS)} } var pkProto pc.PublicKey err = pkProto.Unmarshal(pkBytes) if err != nil { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pkBytes (%x) is invalid binary", pkBytes)} } pubkey, err := cryptoenc.PubKeyFromProto(&pkProto) if err != nil { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pkProto (%s) is invalid binary", pkProto)} } @@ -263,7 +264,7 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon // decode the power power, err := strconv.ParseInt(powerS, 10, 64) if err != nil { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Power (%s) is not an int", powerS)} } @@ -274,10 +275,10 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon // add, update, or remove a validator // See MakeValSetChangeTx -func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate) types.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate) tmabci.ResponseDeliverTx { pubkey, err := cryptoenc.PubKeyFromProto(&v.PubKey) if err != nil { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding Public Key: %s", err)} } @@ -291,7 +292,7 @@ func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate panic(err) } if !hasKey { - return types.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeUnauthorized, Log: fmt.Sprintf("Cannot remove non-existent validator %s", pubStr)} } @@ -302,8 +303,8 @@ func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate } else { // add or update validator value := bytes.NewBuffer(make([]byte, 0)) - if err := types.WriteMessage(&v, value); err != nil { - return types.ResponseDeliverTx{ + if err := tmabci.WriteMessage(&v, value); err != nil { + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding validator: %v", err)} } @@ -316,5 +317,5 @@ func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate // we only update the changes array if we successfully updated the tree app.ValUpdates = append(app.ValUpdates, v) - return types.ResponseDeliverTx{Code: code.CodeTypeOK} + return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} } diff --git a/abci/server/grpc_server.go b/abci/server/grpc_server.go index 50b32410c..162c44c45 100644 --- a/abci/server/grpc_server.go +++ b/abci/server/grpc_server.go @@ -5,7 +5,7 @@ import ( "google.golang.org/grpc" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" ) @@ -18,11 +18,11 @@ type GRPCServer struct { listener net.Listener server *grpc.Server - app types.ABCIApplicationServer + app abci.ABCIApplicationServer } // NewGRPCServer returns a new gRPC ABCI server -func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) service.Service { +func NewGRPCServer(protoAddr string, app abci.ABCIApplicationServer) service.Service { proto, addr := tmnet.ProtocolAndAddress(protoAddr) s := &GRPCServer{ proto: proto, @@ -44,7 +44,7 @@ func (s *GRPCServer) OnStart() error { s.listener = ln s.server = grpc.NewServer() - types.RegisterABCIApplicationServer(s.server, s.app) + abci.RegisterABCIApplicationServer(s.server, s.app) s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr) go func() { diff --git a/abci/server/server.go b/abci/server/server.go index 31f03af6c..2f8e897f3 100644 --- a/abci/server/server.go +++ b/abci/server/server.go @@ -11,18 +11,18 @@ package server import ( "fmt" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" ) -func NewServer(protoAddr, transport string, app types.Application) (service.Service, error) { +func NewServer(protoAddr, transport string, app abci.Application) (service.Service, error) { var s service.Service var err error switch transport { case "socket": s = NewSocketServer(protoAddr, app) case "grpc": - s = NewGRPCServer(protoAddr, types.NewGRPCApplication(app)) + s = NewGRPCServer(protoAddr, abci.NewGRPCApplication(app)) default: err = fmt.Errorf("unknown server type %s", transport) } diff --git a/abci/server/socket_server.go b/abci/server/socket_server.go index 42e7b6ad1..d3c6f8ed9 100644 --- a/abci/server/socket_server.go +++ b/abci/server/socket_server.go @@ -8,7 +8,7 @@ import ( "os" "runtime" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" tmlog "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" @@ -30,10 +30,10 @@ type SocketServer struct { nextConnID int appMtx tmsync.Mutex - app types.Application + app abci.Application } -func NewSocketServer(protoAddr string, app types.Application) service.Service { +func NewSocketServer(protoAddr string, app abci.Application) service.Service { proto, addr := tmnet.ProtocolAndAddress(protoAddr) s := &SocketServer{ proto: proto, @@ -120,8 +120,8 @@ func (s *SocketServer) acceptConnectionsRoutine() { connID := s.addConn(conn) - closeConn := make(chan error, 2) // Push to signal connection closed - responses := make(chan *types.Response, 1000) // A channel to buffer responses + closeConn := make(chan error, 2) // Push to signal connection closed + responses := make(chan *abci.Response, 1000) // A channel to buffer responses // Read requests from conn and deal with them go s.handleRequests(closeConn, conn, responses) @@ -152,7 +152,7 @@ func (s *SocketServer) waitForClose(closeConn chan error, connID int) { } // Read requests from conn and deal with them -func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *types.Response) { +func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *abci.Response) { var count int var bufReader = bufio.NewReader(conn) @@ -174,8 +174,8 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp for { - var req = &types.Request{} - err := types.ReadMessage(bufReader, req) + var req = &abci.Request{} + err := abci.ReadMessage(bufReader, req) if err != nil { if err == io.EOF { closeConn <- err @@ -191,74 +191,74 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp } } -func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types.Response) { +func (s *SocketServer) handleRequest(req *abci.Request, responses chan<- *abci.Response) { switch r := req.Value.(type) { - case *types.Request_Echo: - responses <- types.ToResponseEcho(r.Echo.Message) - case *types.Request_Flush: - responses <- types.ToResponseFlush() - case *types.Request_Info: + case *abci.Request_Echo: + responses <- abci.ToResponseEcho(r.Echo.Message) + case *abci.Request_Flush: + responses <- abci.ToResponseFlush() + case *abci.Request_Info: res := s.app.Info(*r.Info) - responses <- types.ToResponseInfo(res) - case *types.Request_SetOption: + responses <- abci.ToResponseInfo(res) + case *abci.Request_SetOption: res := s.app.SetOption(*r.SetOption) - responses <- types.ToResponseSetOption(res) - case *types.Request_DeliverTx: + responses <- abci.ToResponseSetOption(res) + case *abci.Request_DeliverTx: res := s.app.DeliverTx(*r.DeliverTx) - responses <- types.ToResponseDeliverTx(res) - case *types.Request_CheckTx: + responses <- abci.ToResponseDeliverTx(res) + case *abci.Request_CheckTx: res := s.app.CheckTxSync(*r.CheckTx) - responses <- types.ToResponseCheckTx(res) - case *types.Request_Commit: + responses <- abci.ToResponseCheckTx(res) + case *abci.Request_Commit: res := s.app.Commit() - responses <- types.ToResponseCommit(res) - case *types.Request_Query: + responses <- abci.ToResponseCommit(res) + case *abci.Request_Query: res := s.app.Query(*r.Query) - responses <- types.ToResponseQuery(res) - case *types.Request_InitChain: + responses <- abci.ToResponseQuery(res) + case *abci.Request_InitChain: res := s.app.InitChain(*r.InitChain) - responses <- types.ToResponseInitChain(res) - case *types.Request_BeginBlock: + responses <- abci.ToResponseInitChain(res) + case *abci.Request_BeginBlock: res := s.app.BeginBlock(*r.BeginBlock) - responses <- types.ToResponseBeginBlock(res) - case *types.Request_EndBlock: + responses <- abci.ToResponseBeginBlock(res) + case *abci.Request_EndBlock: res := s.app.EndBlock(*r.EndBlock) - responses <- types.ToResponseEndBlock(res) - case *types.Request_BeginRecheckTx: + responses <- abci.ToResponseEndBlock(res) + case *abci.Request_BeginRecheckTx: res := s.app.BeginRecheckTx(*r.BeginRecheckTx) - responses <- types.ToResponseBeginRecheckTx(res) - case *types.Request_EndRecheckTx: + responses <- abci.ToResponseBeginRecheckTx(res) + case *abci.Request_EndRecheckTx: res := s.app.EndRecheckTx(*r.EndRecheckTx) - responses <- types.ToResponseEndRecheckTx(res) - case *types.Request_ListSnapshots: + responses <- abci.ToResponseEndRecheckTx(res) + case *abci.Request_ListSnapshots: res := s.app.ListSnapshots(*r.ListSnapshots) - responses <- types.ToResponseListSnapshots(res) - case *types.Request_OfferSnapshot: + responses <- abci.ToResponseListSnapshots(res) + case *abci.Request_OfferSnapshot: res := s.app.OfferSnapshot(*r.OfferSnapshot) - responses <- types.ToResponseOfferSnapshot(res) - case *types.Request_LoadSnapshotChunk: + responses <- abci.ToResponseOfferSnapshot(res) + case *abci.Request_LoadSnapshotChunk: res := s.app.LoadSnapshotChunk(*r.LoadSnapshotChunk) - responses <- types.ToResponseLoadSnapshotChunk(res) - case *types.Request_ApplySnapshotChunk: + responses <- abci.ToResponseLoadSnapshotChunk(res) + case *abci.Request_ApplySnapshotChunk: res := s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk) - responses <- types.ToResponseApplySnapshotChunk(res) + responses <- abci.ToResponseApplySnapshotChunk(res) default: - responses <- types.ToResponseException("Unknown request") + responses <- abci.ToResponseException("Unknown request") } } // Pull responses from 'responses' and write them to conn. -func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *types.Response) { +func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *abci.Response) { var count int var bufWriter = bufio.NewWriter(conn) for { var res = <-responses - err := types.WriteMessage(res, bufWriter) + err := abci.WriteMessage(res, bufWriter) if err != nil { closeConn <- fmt.Errorf("error writing message: %w", err) return } - if _, ok := res.Value.(*types.Response_Flush); ok { + if _, ok := res.Value.(*abci.Response_Flush); ok { err = bufWriter.Flush() if err != nil { closeConn <- fmt.Errorf("error flushing write buffer: %w", err) diff --git a/abci/tests/benchmarks/parallel/parallel.go b/abci/tests/benchmarks/parallel/parallel.go index 5f7f21517..2c3bc24aa 100644 --- a/abci/tests/benchmarks/parallel/parallel.go +++ b/abci/tests/benchmarks/parallel/parallel.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/line/ostracon/abci/types" + types "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" ) diff --git a/abci/tests/benchmarks/simple/simple.go b/abci/tests/benchmarks/simple/simple.go index 98fd5cd79..cc9751900 100644 --- a/abci/tests/benchmarks/simple/simple.go +++ b/abci/tests/benchmarks/simple/simple.go @@ -7,7 +7,7 @@ import ( "log" "reflect" - "github.com/line/ostracon/abci/types" + types "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" ) diff --git a/abci/tests/server/client.go b/abci/tests/server/client.go index 118a130a9..96bb5d50e 100644 --- a/abci/tests/server/client.go +++ b/abci/tests/server/client.go @@ -5,9 +5,11 @@ import ( "errors" "fmt" + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" - "github.com/line/ostracon/abci/types" + types "github.com/line/ostracon/abci/types" tmrand "github.com/line/ostracon/libs/rand" ) @@ -31,7 +33,7 @@ func InitChain(client abcicli.Client) error { } func SetOption(client abcicli.Client, key, value string) error { - _, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: value}) + _, err := client.SetOptionSync(tmabci.RequestSetOption{Key: key, Value: value}) if err != nil { fmt.Println("Failed test: SetOption") fmt.Printf("error while setting %v=%v: \nerror: %v\n", key, value, err) @@ -59,7 +61,7 @@ func Commit(client abcicli.Client, hashExp []byte) error { } func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { - res, _ := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes}) + res, _ := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: DeliverTx") @@ -78,7 +80,7 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp [] } func CheckTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { - res, _ := client.CheckTxSync(types.RequestCheckTx{Tx: txBytes}) + res, _ := client.CheckTxSync(tmabci.RequestCheckTx{Tx: txBytes}) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: CheckTx") diff --git a/abci/tests/test_app/app.go b/abci/tests/test_app/app.go index 946096f0e..a1bbb2111 100644 --- a/abci/tests/test_app/app.go +++ b/abci/tests/test_app/app.go @@ -5,8 +5,9 @@ import ( "fmt" "os" + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" - "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" ) @@ -26,7 +27,7 @@ func startClient(abciType string) abcicli.Client { } func setOption(client abcicli.Client, key, value string) { - _, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: value}) + _, err := client.SetOptionSync(tmabci.RequestSetOption{Key: key, Value: value}) if err != nil { panicf("setting %v=%v: \nerr: %v", key, value, err) } @@ -43,7 +44,7 @@ func commit(client abcicli.Client, hashExp []byte) { } func deliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) { - res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes}) + res, err := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) if err != nil { panicf("client error: %v", err) } diff --git a/abci/tests/test_app/main.go b/abci/tests/test_app/main.go index a1a8723e5..f49d16cc1 100644 --- a/abci/tests/test_app/main.go +++ b/abci/tests/test_app/main.go @@ -8,7 +8,7 @@ import ( "time" "github.com/line/ostracon/abci/example/code" - "github.com/line/ostracon/abci/types" + types "github.com/line/ostracon/abci/types" ) var abciType string diff --git a/abci/types/application.go b/abci/types/application.go index 2e85344f0..c792a9daf 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -2,6 +2,8 @@ package types import ( context "golang.org/x/net/context" + + tmabci "github.com/tendermint/tendermint/abci/types" ) //go:generate mockery --case underscore --name Application @@ -14,28 +16,28 @@ type CheckTxCallback func(ResponseCheckTx) // except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing. type Application interface { // Info/Query Connection - Info(RequestInfo) ResponseInfo // Return application info - SetOption(RequestSetOption) ResponseSetOption // Set application option - Query(RequestQuery) ResponseQuery // Query for state + Info(tmabci.RequestInfo) tmabci.ResponseInfo // Return application info + SetOption(tmabci.RequestSetOption) tmabci.ResponseSetOption // Set application option + Query(tmabci.RequestQuery) tmabci.ResponseQuery // Query for state // Mempool Connection - CheckTxSync(RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool - CheckTxAsync(RequestCheckTx, CheckTxCallback) // Asynchronously validate a tx for the mempool + CheckTxSync(tmabci.RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool + CheckTxAsync(tmabci.RequestCheckTx, CheckTxCallback) // Asynchronously validate a tx for the mempool BeginRecheckTx(RequestBeginRecheckTx) ResponseBeginRecheckTx // Signals the beginning of rechecking EndRecheckTx(RequestEndRecheckTx) ResponseEndRecheckTx // Signals the end of rechecking // Consensus Connection - InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore - BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block - DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing - EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set - Commit() ResponseCommit // Commit the state and return the application Merkle root hash + InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore + BeginBlock(RequestBeginBlock) tmabci.ResponseBeginBlock // Signals the beginning of a block + DeliverTx(tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx // Deliver a tx for full processing + EndBlock(tmabci.RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set + Commit() tmabci.ResponseCommit // Commit the state and return the application Merkle root hash // State Sync Connection - ListSnapshots(RequestListSnapshots) ResponseListSnapshots // List available snapshots - OfferSnapshot(RequestOfferSnapshot) ResponseOfferSnapshot // Offer a snapshot to the application - LoadSnapshotChunk(RequestLoadSnapshotChunk) ResponseLoadSnapshotChunk // Load a snapshot chunk - ApplySnapshotChunk(RequestApplySnapshotChunk) ResponseApplySnapshotChunk // Apply a shapshot chunk + ListSnapshots(tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots // List available snapshots + OfferSnapshot(tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot // Offer a snapshot to the application + LoadSnapshotChunk(tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk // Load a snapshot chunk + ApplySnapshotChunk(tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk // Apply a shapshot chunk } //------------------------------------------------------- @@ -50,23 +52,23 @@ func NewBaseApplication() *BaseApplication { return &BaseApplication{} } -func (BaseApplication) Info(req RequestInfo) ResponseInfo { - return ResponseInfo{} +func (BaseApplication) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { + return tmabci.ResponseInfo{} } -func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption { - return ResponseSetOption{} +func (BaseApplication) SetOption(req tmabci.RequestSetOption) tmabci.ResponseSetOption { + return tmabci.ResponseSetOption{} } -func (BaseApplication) DeliverTx(req RequestDeliverTx) ResponseDeliverTx { - return ResponseDeliverTx{Code: CodeTypeOK} +func (BaseApplication) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { + return tmabci.ResponseDeliverTx{Code: CodeTypeOK} } -func (BaseApplication) CheckTxSync(req RequestCheckTx) ResponseCheckTx { +func (BaseApplication) CheckTxSync(req tmabci.RequestCheckTx) ResponseCheckTx { return ResponseCheckTx{Code: CodeTypeOK} } -func (BaseApplication) CheckTxAsync(req RequestCheckTx, callback CheckTxCallback) { +func (BaseApplication) CheckTxAsync(req tmabci.RequestCheckTx, callback CheckTxCallback) { callback(ResponseCheckTx{Code: CodeTypeOK}) } @@ -78,40 +80,40 @@ func (BaseApplication) EndRecheckTx(req RequestEndRecheckTx) ResponseEndRecheckT return ResponseEndRecheckTx{Code: CodeTypeOK} } -func (BaseApplication) Commit() ResponseCommit { - return ResponseCommit{} +func (BaseApplication) Commit() tmabci.ResponseCommit { + return tmabci.ResponseCommit{} } -func (BaseApplication) Query(req RequestQuery) ResponseQuery { - return ResponseQuery{Code: CodeTypeOK} +func (BaseApplication) Query(req tmabci.RequestQuery) tmabci.ResponseQuery { + return tmabci.ResponseQuery{Code: CodeTypeOK} } func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { return ResponseInitChain{} } -func (BaseApplication) BeginBlock(req RequestBeginBlock) ResponseBeginBlock { - return ResponseBeginBlock{} +func (BaseApplication) BeginBlock(req RequestBeginBlock) tmabci.ResponseBeginBlock { + return tmabci.ResponseBeginBlock{} } -func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock { +func (BaseApplication) EndBlock(req tmabci.RequestEndBlock) ResponseEndBlock { return ResponseEndBlock{} } -func (BaseApplication) ListSnapshots(req RequestListSnapshots) ResponseListSnapshots { - return ResponseListSnapshots{} +func (BaseApplication) ListSnapshots(req tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { + return tmabci.ResponseListSnapshots{} } -func (BaseApplication) OfferSnapshot(req RequestOfferSnapshot) ResponseOfferSnapshot { - return ResponseOfferSnapshot{} +func (BaseApplication) OfferSnapshot(req tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { + return tmabci.ResponseOfferSnapshot{} } -func (BaseApplication) LoadSnapshotChunk(req RequestLoadSnapshotChunk) ResponseLoadSnapshotChunk { - return ResponseLoadSnapshotChunk{} +func (BaseApplication) LoadSnapshotChunk(req tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { + return tmabci.ResponseLoadSnapshotChunk{} } -func (BaseApplication) ApplySnapshotChunk(req RequestApplySnapshotChunk) ResponseApplySnapshotChunk { - return ResponseApplySnapshotChunk{} +func (BaseApplication) ApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { + return tmabci.ResponseApplySnapshotChunk{} } //------------------------------------------------------- @@ -125,30 +127,30 @@ func NewGRPCApplication(app Application) *GRPCApplication { return &GRPCApplication{app} } -func (app *GRPCApplication) Echo(ctx context.Context, req *RequestEcho) (*ResponseEcho, error) { - return &ResponseEcho{Message: req.Message}, nil +func (app *GRPCApplication) Echo(ctx context.Context, req *tmabci.RequestEcho) (*tmabci.ResponseEcho, error) { + return &tmabci.ResponseEcho{Message: req.Message}, nil } -func (app *GRPCApplication) Flush(ctx context.Context, req *RequestFlush) (*ResponseFlush, error) { - return &ResponseFlush{}, nil +func (app *GRPCApplication) Flush(ctx context.Context, req *tmabci.RequestFlush) (*tmabci.ResponseFlush, error) { + return &tmabci.ResponseFlush{}, nil } -func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) { +func (app *GRPCApplication) Info(ctx context.Context, req *tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { res := app.app.Info(*req) return &res, nil } -func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption) (*ResponseSetOption, error) { +func (app *GRPCApplication) SetOption(ctx context.Context, req *tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { res := app.app.SetOption(*req) return &res, nil } -func (app *GRPCApplication) DeliverTx(ctx context.Context, req *RequestDeliverTx) (*ResponseDeliverTx, error) { +func (app *GRPCApplication) DeliverTx(ctx context.Context, req *tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { res := app.app.DeliverTx(*req) return &res, nil } -func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) { +func (app *GRPCApplication) CheckTx(ctx context.Context, req *tmabci.RequestCheckTx) (*ResponseCheckTx, error) { res := app.app.CheckTxSync(*req) return &res, nil } @@ -164,12 +166,12 @@ func (app *GRPCApplication) EndRecheckTx(ctx context.Context, req *RequestEndRec return &res, nil } -func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) { +func (app *GRPCApplication) Query(ctx context.Context, req *tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { res := app.app.Query(*req) return &res, nil } -func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*ResponseCommit, error) { +func (app *GRPCApplication) Commit(ctx context.Context, req *tmabci.RequestCommit) (*tmabci.ResponseCommit, error) { res := app.app.Commit() return &res, nil } @@ -179,36 +181,36 @@ func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain return &res, nil } -func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { +func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { res := app.app.BeginBlock(*req) return &res, nil } -func (app *GRPCApplication) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) { +func (app *GRPCApplication) EndBlock(ctx context.Context, req *tmabci.RequestEndBlock) (*ResponseEndBlock, error) { res := app.app.EndBlock(*req) return &res, nil } func (app *GRPCApplication) ListSnapshots( - ctx context.Context, req *RequestListSnapshots) (*ResponseListSnapshots, error) { + ctx context.Context, req *tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { res := app.app.ListSnapshots(*req) return &res, nil } func (app *GRPCApplication) OfferSnapshot( - ctx context.Context, req *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) { + ctx context.Context, req *tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { res := app.app.OfferSnapshot(*req) return &res, nil } func (app *GRPCApplication) LoadSnapshotChunk( - ctx context.Context, req *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) { + ctx context.Context, req *tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { res := app.app.LoadSnapshotChunk(*req) return &res, nil } func (app *GRPCApplication) ApplySnapshotChunk( - ctx context.Context, req *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) { + ctx context.Context, req *tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { res := app.app.ApplySnapshotChunk(*req) return &res, nil } diff --git a/abci/types/messages.go b/abci/types/messages.go index e617f8593..ae0c59400 100644 --- a/abci/types/messages.go +++ b/abci/types/messages.go @@ -6,6 +6,8 @@ import ( "io" "github.com/gogo/protobuf/proto" + + tmabci "github.com/tendermint/tendermint/abci/types" ) const ( @@ -71,35 +73,35 @@ func encodeVarint(w io.Writer, i int64) (err error) { func ToRequestEcho(message string) *Request { return &Request{ - Value: &Request_Echo{&RequestEcho{Message: message}}, + Value: &Request_Echo{&tmabci.RequestEcho{Message: message}}, } } func ToRequestFlush() *Request { return &Request{ - Value: &Request_Flush{&RequestFlush{}}, + Value: &Request_Flush{&tmabci.RequestFlush{}}, } } -func ToRequestInfo(req RequestInfo) *Request { +func ToRequestInfo(req tmabci.RequestInfo) *Request { return &Request{ Value: &Request_Info{&req}, } } -func ToRequestSetOption(req RequestSetOption) *Request { +func ToRequestSetOption(req tmabci.RequestSetOption) *Request { return &Request{ Value: &Request_SetOption{&req}, } } -func ToRequestDeliverTx(req RequestDeliverTx) *Request { +func ToRequestDeliverTx(req tmabci.RequestDeliverTx) *Request { return &Request{ Value: &Request_DeliverTx{&req}, } } -func ToRequestCheckTx(req RequestCheckTx) *Request { +func ToRequestCheckTx(req tmabci.RequestCheckTx) *Request { return &Request{ Value: &Request_CheckTx{&req}, } @@ -107,11 +109,11 @@ func ToRequestCheckTx(req RequestCheckTx) *Request { func ToRequestCommit() *Request { return &Request{ - Value: &Request_Commit{&RequestCommit{}}, + Value: &Request_Commit{&tmabci.RequestCommit{}}, } } -func ToRequestQuery(req RequestQuery) *Request { +func ToRequestQuery(req tmabci.RequestQuery) *Request { return &Request{ Value: &Request_Query{&req}, } @@ -129,7 +131,7 @@ func ToRequestBeginBlock(req RequestBeginBlock) *Request { } } -func ToRequestEndBlock(req RequestEndBlock) *Request { +func ToRequestEndBlock(req tmabci.RequestEndBlock) *Request { return &Request{ Value: &Request_EndBlock{&req}, } @@ -147,25 +149,25 @@ func ToRequestEndRecheckTx(req RequestEndRecheckTx) *Request { } } -func ToRequestListSnapshots(req RequestListSnapshots) *Request { +func ToRequestListSnapshots(req tmabci.RequestListSnapshots) *Request { return &Request{ Value: &Request_ListSnapshots{&req}, } } -func ToRequestOfferSnapshot(req RequestOfferSnapshot) *Request { +func ToRequestOfferSnapshot(req tmabci.RequestOfferSnapshot) *Request { return &Request{ Value: &Request_OfferSnapshot{&req}, } } -func ToRequestLoadSnapshotChunk(req RequestLoadSnapshotChunk) *Request { +func ToRequestLoadSnapshotChunk(req tmabci.RequestLoadSnapshotChunk) *Request { return &Request{ Value: &Request_LoadSnapshotChunk{&req}, } } -func ToRequestApplySnapshotChunk(req RequestApplySnapshotChunk) *Request { +func ToRequestApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) *Request { return &Request{ Value: &Request_ApplySnapshotChunk{&req}, } @@ -175,35 +177,35 @@ func ToRequestApplySnapshotChunk(req RequestApplySnapshotChunk) *Request { func ToResponseException(errStr string) *Response { return &Response{ - Value: &Response_Exception{&ResponseException{Error: errStr}}, + Value: &Response_Exception{&tmabci.ResponseException{Error: errStr}}, } } func ToResponseEcho(message string) *Response { return &Response{ - Value: &Response_Echo{&ResponseEcho{Message: message}}, + Value: &Response_Echo{&tmabci.ResponseEcho{Message: message}}, } } func ToResponseFlush() *Response { return &Response{ - Value: &Response_Flush{&ResponseFlush{}}, + Value: &Response_Flush{&tmabci.ResponseFlush{}}, } } -func ToResponseInfo(res ResponseInfo) *Response { +func ToResponseInfo(res tmabci.ResponseInfo) *Response { return &Response{ Value: &Response_Info{&res}, } } -func ToResponseSetOption(res ResponseSetOption) *Response { +func ToResponseSetOption(res tmabci.ResponseSetOption) *Response { return &Response{ Value: &Response_SetOption{&res}, } } -func ToResponseDeliverTx(res ResponseDeliverTx) *Response { +func ToResponseDeliverTx(res tmabci.ResponseDeliverTx) *Response { return &Response{ Value: &Response_DeliverTx{&res}, } @@ -215,13 +217,13 @@ func ToResponseCheckTx(res ResponseCheckTx) *Response { } } -func ToResponseCommit(res ResponseCommit) *Response { +func ToResponseCommit(res tmabci.ResponseCommit) *Response { return &Response{ Value: &Response_Commit{&res}, } } -func ToResponseQuery(res ResponseQuery) *Response { +func ToResponseQuery(res tmabci.ResponseQuery) *Response { return &Response{ Value: &Response_Query{&res}, } @@ -233,7 +235,7 @@ func ToResponseInitChain(res ResponseInitChain) *Response { } } -func ToResponseBeginBlock(res ResponseBeginBlock) *Response { +func ToResponseBeginBlock(res tmabci.ResponseBeginBlock) *Response { return &Response{ Value: &Response_BeginBlock{&res}, } @@ -257,25 +259,25 @@ func ToResponseEndRecheckTx(res ResponseEndRecheckTx) *Response { } } -func ToResponseListSnapshots(res ResponseListSnapshots) *Response { +func ToResponseListSnapshots(res tmabci.ResponseListSnapshots) *Response { return &Response{ Value: &Response_ListSnapshots{&res}, } } -func ToResponseOfferSnapshot(res ResponseOfferSnapshot) *Response { +func ToResponseOfferSnapshot(res tmabci.ResponseOfferSnapshot) *Response { return &Response{ Value: &Response_OfferSnapshot{&res}, } } -func ToResponseLoadSnapshotChunk(res ResponseLoadSnapshotChunk) *Response { +func ToResponseLoadSnapshotChunk(res tmabci.ResponseLoadSnapshotChunk) *Response { return &Response{ Value: &Response_LoadSnapshotChunk{&res}, } } -func ToResponseApplySnapshotChunk(res ResponseApplySnapshotChunk) *Response { +func ToResponseApplySnapshotChunk(res tmabci.ResponseApplySnapshotChunk) *Response { return &Response{ Value: &Response_ApplySnapshotChunk{&res}, } diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index f5d488ae7..ce2c5db61 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -9,11 +9,13 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" + tmabci "github.com/tendermint/tendermint/abci/types" + ocproto "github.com/line/ostracon/proto/ostracon/types" ) func TestMarshalJSON(t *testing.T) { - b, err := json.Marshal(&ResponseDeliverTx{}) + b, err := json.Marshal(&tmabci.ResponseDeliverTx{}) assert.Nil(t, err) // include empty fields. assert.True(t, strings.Contains(string(b), "code")) @@ -21,10 +23,10 @@ func TestMarshalJSON(t *testing.T) { Code: 1, Data: []byte("hello"), GasWanted: 43, - Events: []Event{ + Events: []tmabci.Event{ { Type: "testEvent", - Attributes: []EventAttribute{ + Attributes: []tmabci.EventAttribute{ {Key: []byte("pho"), Value: []byte("bo")}, }, }, @@ -41,7 +43,7 @@ func TestMarshalJSON(t *testing.T) { func TestWriteReadMessageSimple(t *testing.T) { cases := []proto.Message{ - &RequestEcho{ + &tmabci.RequestEcho{ Message: "Hello", }, } @@ -51,7 +53,7 @@ func TestWriteReadMessageSimple(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(RequestEcho) + msg := new(tmabci.RequestEcho) err = ReadMessage(buf, msg) assert.Nil(t, err) @@ -88,10 +90,10 @@ func TestWriteReadMessage2(t *testing.T) { Data: []byte(phrase), Log: phrase, GasWanted: 10, - Events: []Event{ + Events: []tmabci.Event{ { Type: "testEvent", - Attributes: []EventAttribute{ + Attributes: []tmabci.EventAttribute{ {Key: []byte("abc"), Value: []byte("def")}, }, }, diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index e52f07266..bbbae4e53 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -3,6 +3,8 @@ package mocks import ( + tmabci "github.com/tendermint/tendermint/abci/types" + types "github.com/line/ostracon/abci/types" mock "github.com/stretchr/testify/mock" ) @@ -13,28 +15,28 @@ type Application struct { } // ApplySnapshotChunk provides a mock function with given fields: _a0 -func (_m *Application) ApplySnapshotChunk(_a0 types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk { +func (_m *Application) ApplySnapshotChunk(_a0 tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { ret := _m.Called(_a0) - var r0 types.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk); ok { + var r0 tmabci.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(tmabci.ResponseApplySnapshotChunk) } return r0 } // BeginBlock provides a mock function with given fields: _a0 -func (_m *Application) BeginBlock(_a0 types.RequestBeginBlock) types.ResponseBeginBlock { +func (_m *Application) BeginBlock(_a0 types.RequestBeginBlock) tmabci.ResponseBeginBlock { ret := _m.Called(_a0) - var r0 types.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(types.RequestBeginBlock) types.ResponseBeginBlock); ok { + var r0 tmabci.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(types.RequestBeginBlock) tmabci.ResponseBeginBlock); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseBeginBlock) + r0 = ret.Get(0).(tmabci.ResponseBeginBlock) } return r0 @@ -55,16 +57,16 @@ func (_m *Application) BeginRecheckTx(_a0 types.RequestBeginRecheckTx) types.Res } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Application) CheckTxAsync(_a0 types.RequestCheckTx, _a1 types.CheckTxCallback) { +func (_m *Application) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 types.CheckTxCallback) { _m.Called(_a0, _a1) } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Application) CheckTxSync(_a0 types.RequestCheckTx) types.ResponseCheckTx { +func (_m *Application) CheckTxSync(_a0 tmabci.RequestCheckTx) types.ResponseCheckTx { ret := _m.Called(_a0) var r0 types.ResponseCheckTx - if rf, ok := ret.Get(0).(func(types.RequestCheckTx) types.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx) types.ResponseCheckTx); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(types.ResponseCheckTx) @@ -74,39 +76,39 @@ func (_m *Application) CheckTxSync(_a0 types.RequestCheckTx) types.ResponseCheck } // Commit provides a mock function with given fields: -func (_m *Application) Commit() types.ResponseCommit { +func (_m *Application) Commit() tmabci.ResponseCommit { ret := _m.Called() - var r0 types.ResponseCommit - if rf, ok := ret.Get(0).(func() types.ResponseCommit); ok { + var r0 tmabci.ResponseCommit + if rf, ok := ret.Get(0).(func() tmabci.ResponseCommit); ok { r0 = rf() } else { - r0 = ret.Get(0).(types.ResponseCommit) + r0 = ret.Get(0).(tmabci.ResponseCommit) } return r0 } // DeliverTx provides a mock function with given fields: _a0 -func (_m *Application) DeliverTx(_a0 types.RequestDeliverTx) types.ResponseDeliverTx { +func (_m *Application) DeliverTx(_a0 tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { ret := _m.Called(_a0) - var r0 types.ResponseDeliverTx - if rf, ok := ret.Get(0).(func(types.RequestDeliverTx) types.ResponseDeliverTx); ok { + var r0 tmabci.ResponseDeliverTx + if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseDeliverTx) + r0 = ret.Get(0).(tmabci.ResponseDeliverTx) } return r0 } // EndBlock provides a mock function with given fields: _a0 -func (_m *Application) EndBlock(_a0 types.RequestEndBlock) types.ResponseEndBlock { +func (_m *Application) EndBlock(_a0 tmabci.RequestEndBlock) types.ResponseEndBlock { ret := _m.Called(_a0) var r0 types.ResponseEndBlock - if rf, ok := ret.Get(0).(func(types.RequestEndBlock) types.ResponseEndBlock); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock) types.ResponseEndBlock); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(types.ResponseEndBlock) @@ -130,14 +132,14 @@ func (_m *Application) EndRecheckTx(_a0 types.RequestEndRecheckTx) types.Respons } // Info provides a mock function with given fields: _a0 -func (_m *Application) Info(_a0 types.RequestInfo) types.ResponseInfo { +func (_m *Application) Info(_a0 tmabci.RequestInfo) tmabci.ResponseInfo { ret := _m.Called(_a0) - var r0 types.ResponseInfo - if rf, ok := ret.Get(0).(func(types.RequestInfo) types.ResponseInfo); ok { + var r0 tmabci.ResponseInfo + if rf, ok := ret.Get(0).(func(tmabci.RequestInfo) tmabci.ResponseInfo); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseInfo) + r0 = ret.Get(0).(tmabci.ResponseInfo) } return r0 @@ -158,70 +160,70 @@ func (_m *Application) InitChain(_a0 types.RequestInitChain) types.ResponseInitC } // ListSnapshots provides a mock function with given fields: _a0 -func (_m *Application) ListSnapshots(_a0 types.RequestListSnapshots) types.ResponseListSnapshots { +func (_m *Application) ListSnapshots(_a0 tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { ret := _m.Called(_a0) - var r0 types.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(types.RequestListSnapshots) types.ResponseListSnapshots); ok { + var r0 tmabci.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseListSnapshots) + r0 = ret.Get(0).(tmabci.ResponseListSnapshots) } return r0 } // LoadSnapshotChunk provides a mock function with given fields: _a0 -func (_m *Application) LoadSnapshotChunk(_a0 types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk { +func (_m *Application) LoadSnapshotChunk(_a0 tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { ret := _m.Called(_a0) - var r0 types.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk); ok { + var r0 tmabci.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(tmabci.ResponseLoadSnapshotChunk) } return r0 } // OfferSnapshot provides a mock function with given fields: _a0 -func (_m *Application) OfferSnapshot(_a0 types.RequestOfferSnapshot) types.ResponseOfferSnapshot { +func (_m *Application) OfferSnapshot(_a0 tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { ret := _m.Called(_a0) - var r0 types.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot) types.ResponseOfferSnapshot); ok { + var r0 tmabci.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseOfferSnapshot) + r0 = ret.Get(0).(tmabci.ResponseOfferSnapshot) } return r0 } // Query provides a mock function with given fields: _a0 -func (_m *Application) Query(_a0 types.RequestQuery) types.ResponseQuery { +func (_m *Application) Query(_a0 tmabci.RequestQuery) tmabci.ResponseQuery { ret := _m.Called(_a0) - var r0 types.ResponseQuery - if rf, ok := ret.Get(0).(func(types.RequestQuery) types.ResponseQuery); ok { + var r0 tmabci.ResponseQuery + if rf, ok := ret.Get(0).(func(tmabci.RequestQuery) tmabci.ResponseQuery); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseQuery) + r0 = ret.Get(0).(tmabci.ResponseQuery) } return r0 } // SetOption provides a mock function with given fields: _a0 -func (_m *Application) SetOption(_a0 types.RequestSetOption) types.ResponseSetOption { +func (_m *Application) SetOption(_a0 tmabci.RequestSetOption) tmabci.ResponseSetOption { ret := _m.Called(_a0) - var r0 types.ResponseSetOption - if rf, ok := ret.Get(0).(func(types.RequestSetOption) types.ResponseSetOption); ok { + var r0 tmabci.ResponseSetOption + if rf, ok := ret.Get(0).(func(tmabci.RequestSetOption) tmabci.ResponseSetOption); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseSetOption) + r0 = ret.Get(0).(tmabci.ResponseSetOption) } return r0 diff --git a/abci/types/result.go b/abci/types/result.go index 53acdb906..cb7bec4ba 100644 --- a/abci/types/result.go +++ b/abci/types/result.go @@ -3,7 +3,6 @@ package types import ( "bytes" "encoding/json" - "github.com/gogo/protobuf/jsonpb" ) @@ -21,26 +20,6 @@ func (r ResponseCheckTx) IsErr() bool { return r.Code != CodeTypeOK } -// IsOK returns true if Code is OK. -func (r ResponseDeliverTx) IsOK() bool { - return r.Code == CodeTypeOK -} - -// IsErr returns true if Code is something other than OK. -func (r ResponseDeliverTx) IsErr() bool { - return r.Code != CodeTypeOK -} - -// IsOK returns true if Code is OK. -func (r ResponseQuery) IsOK() bool { - return r.Code == CodeTypeOK -} - -// IsErr returns true if Code is something other than OK. -func (r ResponseQuery) IsErr() bool { - return r.Code != CodeTypeOK -} - //--------------------------------------------------------------------------- // override JSON marshaling so we emit defaults (ie. disable omitempty) @@ -52,16 +31,6 @@ var ( jsonpbUnmarshaller = jsonpb.Unmarshaler{} ) -func (r *ResponseSetOption) MarshalJSON() ([]byte, error) { - s, err := jsonpbMarshaller.MarshalToString(r) - return []byte(s), err -} - -func (r *ResponseSetOption) UnmarshalJSON(b []byte) error { - reader := bytes.NewBuffer(b) - return jsonpbUnmarshaller.Unmarshal(reader, r) -} - func (r *ResponseCheckTx) MarshalJSON() ([]byte, error) { s, err := jsonpbMarshaller.MarshalToString(r) return []byte(s), err @@ -72,46 +41,6 @@ func (r *ResponseCheckTx) UnmarshalJSON(b []byte) error { return jsonpbUnmarshaller.Unmarshal(reader, r) } -func (r *ResponseDeliverTx) MarshalJSON() ([]byte, error) { - s, err := jsonpbMarshaller.MarshalToString(r) - return []byte(s), err -} - -func (r *ResponseDeliverTx) UnmarshalJSON(b []byte) error { - reader := bytes.NewBuffer(b) - return jsonpbUnmarshaller.Unmarshal(reader, r) -} - -func (r *ResponseQuery) MarshalJSON() ([]byte, error) { - s, err := jsonpbMarshaller.MarshalToString(r) - return []byte(s), err -} - -func (r *ResponseQuery) UnmarshalJSON(b []byte) error { - reader := bytes.NewBuffer(b) - return jsonpbUnmarshaller.Unmarshal(reader, r) -} - -func (r *ResponseCommit) MarshalJSON() ([]byte, error) { - s, err := jsonpbMarshaller.MarshalToString(r) - return []byte(s), err -} - -func (r *ResponseCommit) UnmarshalJSON(b []byte) error { - reader := bytes.NewBuffer(b) - return jsonpbUnmarshaller.Unmarshal(reader, r) -} - -func (r *EventAttribute) MarshalJSON() ([]byte, error) { - s, err := jsonpbMarshaller.MarshalToString(r) - return []byte(s), err -} - -func (r *EventAttribute) UnmarshalJSON(b []byte) error { - reader := bytes.NewBuffer(b) - return jsonpbUnmarshaller.Unmarshal(reader, r) -} - // Some compile time assertions to ensure we don't // have accidental runtime surprises later on. @@ -122,10 +51,4 @@ type jsonRoundTripper interface { json.Unmarshaler } -var _ jsonRoundTripper = (*ResponseCommit)(nil) -var _ jsonRoundTripper = (*ResponseQuery)(nil) -var _ jsonRoundTripper = (*ResponseDeliverTx)(nil) var _ jsonRoundTripper = (*ResponseCheckTx)(nil) -var _ jsonRoundTripper = (*ResponseSetOption)(nil) - -var _ jsonRoundTripper = (*EventAttribute)(nil) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 8fdd2d64a..4ec9e2e4f 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -10,10 +10,11 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - crypto1 "github.com/line/ostracon/proto/ostracon/crypto" - types1 "github.com/line/ostracon/proto/ostracon/types" - crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" - types2 "github.com/tendermint/tendermint/proto/tendermint/types" + crypto "github.com/line/ostracon/proto/ostracon/crypto" + types2 "github.com/line/ostracon/proto/ostracon/types" + types "github.com/tendermint/tendermint/abci/types" + _ "github.com/tendermint/tendermint/proto/tendermint/crypto" + _ "github.com/tendermint/tendermint/proto/tendermint/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -35,133 +36,6 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type CheckTxType int32 - -const ( - CheckTxType_New CheckTxType = 0 - CheckTxType_Recheck CheckTxType = 1 -) - -var CheckTxType_name = map[int32]string{ - 0: "NEW", - 1: "RECHECK", -} - -var CheckTxType_value = map[string]int32{ - "NEW": 0, - "RECHECK": 1, -} - -func (x CheckTxType) String() string { - return proto.EnumName(CheckTxType_name, int32(x)) -} - -func (CheckTxType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{0} -} - -type EvidenceType int32 - -const ( - EvidenceType_UNKNOWN EvidenceType = 0 - EvidenceType_DUPLICATE_VOTE EvidenceType = 1 - EvidenceType_LIGHT_CLIENT_ATTACK EvidenceType = 2 -) - -var EvidenceType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "DUPLICATE_VOTE", - 2: "LIGHT_CLIENT_ATTACK", -} - -var EvidenceType_value = map[string]int32{ - "UNKNOWN": 0, - "DUPLICATE_VOTE": 1, - "LIGHT_CLIENT_ATTACK": 2, -} - -func (x EvidenceType) String() string { - return proto.EnumName(EvidenceType_name, int32(x)) -} - -func (EvidenceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{1} -} - -type ResponseOfferSnapshot_Result int32 - -const ( - ResponseOfferSnapshot_UNKNOWN ResponseOfferSnapshot_Result = 0 - ResponseOfferSnapshot_ACCEPT ResponseOfferSnapshot_Result = 1 - ResponseOfferSnapshot_ABORT ResponseOfferSnapshot_Result = 2 - ResponseOfferSnapshot_REJECT ResponseOfferSnapshot_Result = 3 - ResponseOfferSnapshot_REJECT_FORMAT ResponseOfferSnapshot_Result = 4 - ResponseOfferSnapshot_REJECT_SENDER ResponseOfferSnapshot_Result = 5 -) - -var ResponseOfferSnapshot_Result_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ACCEPT", - 2: "ABORT", - 3: "REJECT", - 4: "REJECT_FORMAT", - 5: "REJECT_SENDER", -} - -var ResponseOfferSnapshot_Result_value = map[string]int32{ - "UNKNOWN": 0, - "ACCEPT": 1, - "ABORT": 2, - "REJECT": 3, - "REJECT_FORMAT": 4, - "REJECT_SENDER": 5, -} - -func (x ResponseOfferSnapshot_Result) String() string { - return proto.EnumName(ResponseOfferSnapshot_Result_name, int32(x)) -} - -func (ResponseOfferSnapshot_Result) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{32, 0} -} - -type ResponseApplySnapshotChunk_Result int32 - -const ( - ResponseApplySnapshotChunk_UNKNOWN ResponseApplySnapshotChunk_Result = 0 - ResponseApplySnapshotChunk_ACCEPT ResponseApplySnapshotChunk_Result = 1 - ResponseApplySnapshotChunk_ABORT ResponseApplySnapshotChunk_Result = 2 - ResponseApplySnapshotChunk_RETRY ResponseApplySnapshotChunk_Result = 3 - ResponseApplySnapshotChunk_RETRY_SNAPSHOT ResponseApplySnapshotChunk_Result = 4 - ResponseApplySnapshotChunk_REJECT_SNAPSHOT ResponseApplySnapshotChunk_Result = 5 -) - -var ResponseApplySnapshotChunk_Result_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ACCEPT", - 2: "ABORT", - 3: "RETRY", - 4: "RETRY_SNAPSHOT", - 5: "REJECT_SNAPSHOT", -} - -var ResponseApplySnapshotChunk_Result_value = map[string]int32{ - "UNKNOWN": 0, - "ACCEPT": 1, - "ABORT": 2, - "RETRY": 3, - "RETRY_SNAPSHOT": 4, - "REJECT_SNAPSHOT": 5, -} - -func (x ResponseApplySnapshotChunk_Result) String() string { - return proto.EnumName(ResponseApplySnapshotChunk_Result_name, int32(x)) -} - -func (ResponseApplySnapshotChunk_Result) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{34, 0} -} - type Request struct { // Types that are valid to be assigned to Value: // *Request_Echo @@ -224,49 +98,49 @@ type isRequest_Value interface { } type Request_Echo struct { - Echo *RequestEcho `protobuf:"bytes,1,opt,name=echo,proto3,oneof" json:"echo,omitempty"` + Echo *types.RequestEcho `protobuf:"bytes,1,opt,name=echo,proto3,oneof" json:"echo,omitempty"` } type Request_Flush struct { - Flush *RequestFlush `protobuf:"bytes,2,opt,name=flush,proto3,oneof" json:"flush,omitempty"` + Flush *types.RequestFlush `protobuf:"bytes,2,opt,name=flush,proto3,oneof" json:"flush,omitempty"` } type Request_Info struct { - Info *RequestInfo `protobuf:"bytes,3,opt,name=info,proto3,oneof" json:"info,omitempty"` + Info *types.RequestInfo `protobuf:"bytes,3,opt,name=info,proto3,oneof" json:"info,omitempty"` } type Request_SetOption struct { - SetOption *RequestSetOption `protobuf:"bytes,4,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` + SetOption *types.RequestSetOption `protobuf:"bytes,4,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` } type Request_InitChain struct { InitChain *RequestInitChain `protobuf:"bytes,5,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } type Request_Query struct { - Query *RequestQuery `protobuf:"bytes,6,opt,name=query,proto3,oneof" json:"query,omitempty"` + Query *types.RequestQuery `protobuf:"bytes,6,opt,name=query,proto3,oneof" json:"query,omitempty"` } type Request_BeginBlock struct { BeginBlock *RequestBeginBlock `protobuf:"bytes,7,opt,name=begin_block,json=beginBlock,proto3,oneof" json:"begin_block,omitempty"` } type Request_CheckTx struct { - CheckTx *RequestCheckTx `protobuf:"bytes,8,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` + CheckTx *types.RequestCheckTx `protobuf:"bytes,8,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` } type Request_DeliverTx struct { - DeliverTx *RequestDeliverTx `protobuf:"bytes,9,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` + DeliverTx *types.RequestDeliverTx `protobuf:"bytes,9,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` } type Request_EndBlock struct { - EndBlock *RequestEndBlock `protobuf:"bytes,10,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` + EndBlock *types.RequestEndBlock `protobuf:"bytes,10,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` } type Request_Commit struct { - Commit *RequestCommit `protobuf:"bytes,11,opt,name=commit,proto3,oneof" json:"commit,omitempty"` + Commit *types.RequestCommit `protobuf:"bytes,11,opt,name=commit,proto3,oneof" json:"commit,omitempty"` } type Request_ListSnapshots struct { - ListSnapshots *RequestListSnapshots `protobuf:"bytes,12,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` + ListSnapshots *types.RequestListSnapshots `protobuf:"bytes,12,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` } type Request_OfferSnapshot struct { - OfferSnapshot *RequestOfferSnapshot `protobuf:"bytes,13,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` + OfferSnapshot *types.RequestOfferSnapshot `protobuf:"bytes,13,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` } type Request_LoadSnapshotChunk struct { - LoadSnapshotChunk *RequestLoadSnapshotChunk `protobuf:"bytes,14,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` + LoadSnapshotChunk *types.RequestLoadSnapshotChunk `protobuf:"bytes,14,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` } type Request_ApplySnapshotChunk struct { - ApplySnapshotChunk *RequestApplySnapshotChunk `protobuf:"bytes,15,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` + ApplySnapshotChunk *types.RequestApplySnapshotChunk `protobuf:"bytes,15,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` } type Request_BeginRecheckTx struct { BeginRecheckTx *RequestBeginRecheckTx `protobuf:"bytes,1000,opt,name=begin_recheck_tx,json=beginRecheckTx,proto3,oneof" json:"begin_recheck_tx,omitempty"` @@ -300,28 +174,28 @@ func (m *Request) GetValue() isRequest_Value { return nil } -func (m *Request) GetEcho() *RequestEcho { +func (m *Request) GetEcho() *types.RequestEcho { if x, ok := m.GetValue().(*Request_Echo); ok { return x.Echo } return nil } -func (m *Request) GetFlush() *RequestFlush { +func (m *Request) GetFlush() *types.RequestFlush { if x, ok := m.GetValue().(*Request_Flush); ok { return x.Flush } return nil } -func (m *Request) GetInfo() *RequestInfo { +func (m *Request) GetInfo() *types.RequestInfo { if x, ok := m.GetValue().(*Request_Info); ok { return x.Info } return nil } -func (m *Request) GetSetOption() *RequestSetOption { +func (m *Request) GetSetOption() *types.RequestSetOption { if x, ok := m.GetValue().(*Request_SetOption); ok { return x.SetOption } @@ -335,7 +209,7 @@ func (m *Request) GetInitChain() *RequestInitChain { return nil } -func (m *Request) GetQuery() *RequestQuery { +func (m *Request) GetQuery() *types.RequestQuery { if x, ok := m.GetValue().(*Request_Query); ok { return x.Query } @@ -349,56 +223,56 @@ func (m *Request) GetBeginBlock() *RequestBeginBlock { return nil } -func (m *Request) GetCheckTx() *RequestCheckTx { +func (m *Request) GetCheckTx() *types.RequestCheckTx { if x, ok := m.GetValue().(*Request_CheckTx); ok { return x.CheckTx } return nil } -func (m *Request) GetDeliverTx() *RequestDeliverTx { +func (m *Request) GetDeliverTx() *types.RequestDeliverTx { if x, ok := m.GetValue().(*Request_DeliverTx); ok { return x.DeliverTx } return nil } -func (m *Request) GetEndBlock() *RequestEndBlock { +func (m *Request) GetEndBlock() *types.RequestEndBlock { if x, ok := m.GetValue().(*Request_EndBlock); ok { return x.EndBlock } return nil } -func (m *Request) GetCommit() *RequestCommit { +func (m *Request) GetCommit() *types.RequestCommit { if x, ok := m.GetValue().(*Request_Commit); ok { return x.Commit } return nil } -func (m *Request) GetListSnapshots() *RequestListSnapshots { +func (m *Request) GetListSnapshots() *types.RequestListSnapshots { if x, ok := m.GetValue().(*Request_ListSnapshots); ok { return x.ListSnapshots } return nil } -func (m *Request) GetOfferSnapshot() *RequestOfferSnapshot { +func (m *Request) GetOfferSnapshot() *types.RequestOfferSnapshot { if x, ok := m.GetValue().(*Request_OfferSnapshot); ok { return x.OfferSnapshot } return nil } -func (m *Request) GetLoadSnapshotChunk() *RequestLoadSnapshotChunk { +func (m *Request) GetLoadSnapshotChunk() *types.RequestLoadSnapshotChunk { if x, ok := m.GetValue().(*Request_LoadSnapshotChunk); ok { return x.LoadSnapshotChunk } return nil } -func (m *Request) GetApplySnapshotChunk() *RequestApplySnapshotChunk { +func (m *Request) GetApplySnapshotChunk() *types.RequestApplySnapshotChunk { if x, ok := m.GetValue().(*Request_ApplySnapshotChunk); ok { return x.ApplySnapshotChunk } @@ -442,213 +316,20 @@ func (*Request) XXX_OneofWrappers() []interface{} { } } -type RequestEcho struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *RequestEcho) Reset() { *m = RequestEcho{} } -func (m *RequestEcho) String() string { return proto.CompactTextString(m) } -func (*RequestEcho) ProtoMessage() {} -func (*RequestEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{1} -} -func (m *RequestEcho) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestEcho) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestEcho.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestEcho) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestEcho.Merge(m, src) -} -func (m *RequestEcho) XXX_Size() int { - return m.Size() -} -func (m *RequestEcho) XXX_DiscardUnknown() { - xxx_messageInfo_RequestEcho.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestEcho proto.InternalMessageInfo - -func (m *RequestEcho) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type RequestFlush struct { -} - -func (m *RequestFlush) Reset() { *m = RequestFlush{} } -func (m *RequestFlush) String() string { return proto.CompactTextString(m) } -func (*RequestFlush) ProtoMessage() {} -func (*RequestFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{2} -} -func (m *RequestFlush) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestFlush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestFlush.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestFlush) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestFlush.Merge(m, src) -} -func (m *RequestFlush) XXX_Size() int { - return m.Size() -} -func (m *RequestFlush) XXX_DiscardUnknown() { - xxx_messageInfo_RequestFlush.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestFlush proto.InternalMessageInfo - -type RequestInfo struct { - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - BlockVersion uint64 `protobuf:"varint,2,opt,name=block_version,json=blockVersion,proto3" json:"block_version,omitempty"` - P2PVersion uint64 `protobuf:"varint,3,opt,name=p2p_version,json=p2pVersion,proto3" json:"p2p_version,omitempty"` -} - -func (m *RequestInfo) Reset() { *m = RequestInfo{} } -func (m *RequestInfo) String() string { return proto.CompactTextString(m) } -func (*RequestInfo) ProtoMessage() {} -func (*RequestInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{3} -} -func (m *RequestInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestInfo.Merge(m, src) -} -func (m *RequestInfo) XXX_Size() int { - return m.Size() -} -func (m *RequestInfo) XXX_DiscardUnknown() { - xxx_messageInfo_RequestInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestInfo proto.InternalMessageInfo - -func (m *RequestInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *RequestInfo) GetBlockVersion() uint64 { - if m != nil { - return m.BlockVersion - } - return 0 -} - -func (m *RequestInfo) GetP2PVersion() uint64 { - if m != nil { - return m.P2PVersion - } - return 0 -} - -// nondeterministic -type RequestSetOption struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } -func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } -func (*RequestSetOption) ProtoMessage() {} -func (*RequestSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{4} -} -func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestSetOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestSetOption.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestSetOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestSetOption.Merge(m, src) -} -func (m *RequestSetOption) XXX_Size() int { - return m.Size() -} -func (m *RequestSetOption) XXX_DiscardUnknown() { - xxx_messageInfo_RequestSetOption.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestSetOption proto.InternalMessageInfo - -func (m *RequestSetOption) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *RequestSetOption) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - type RequestInitChain struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` - Validators []ValidatorUpdate `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators"` - AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` - InitialHeight int64 `protobuf:"varint,6,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` + Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsensusParams *types.ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators"` + AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` + InitialHeight int64 `protobuf:"varint,6,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` } func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{5} + return fileDescriptor_addf585b2317eb36, []int{1} } func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -691,7 +372,7 @@ func (m *RequestInitChain) GetChainId() string { return "" } -func (m *RequestInitChain) GetConsensusParams() *ConsensusParams { +func (m *RequestInitChain) GetConsensusParams() *types.ConsensusParams { if m != nil { return m.ConsensusParams } @@ -719,77 +400,9 @@ func (m *RequestInitChain) GetInitialHeight() int64 { return 0 } -type RequestQuery struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` -} - -func (m *RequestQuery) Reset() { *m = RequestQuery{} } -func (m *RequestQuery) String() string { return proto.CompactTextString(m) } -func (*RequestQuery) ProtoMessage() {} -func (*RequestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{6} -} -func (m *RequestQuery) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestQuery.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestQuery.Merge(m, src) -} -func (m *RequestQuery) XXX_Size() int { - return m.Size() -} -func (m *RequestQuery) XXX_DiscardUnknown() { - xxx_messageInfo_RequestQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestQuery proto.InternalMessageInfo - -func (m *RequestQuery) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *RequestQuery) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *RequestQuery) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *RequestQuery) GetProve() bool { - if m != nil { - return m.Prove - } - return false -} - type RequestBeginBlock struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Header types1.Header `protobuf:"bytes,2,opt,name=header,proto3" json:"header"` + Header types2.Header `protobuf:"bytes,2,opt,name=header,proto3" json:"header"` LastCommitInfo LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo,proto3" json:"last_commit_info"` ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators"` } @@ -798,7 +411,7 @@ func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{7} + return fileDescriptor_addf585b2317eb36, []int{2} } func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -834,11 +447,11 @@ func (m *RequestBeginBlock) GetHash() []byte { return nil } -func (m *RequestBeginBlock) GetHeader() types1.Header { +func (m *RequestBeginBlock) GetHeader() types2.Header { if m != nil { return m.Header } - return types1.Header{} + return types2.Header{} } func (m *RequestBeginBlock) GetLastCommitInfo() LastCommitInfo { @@ -855,23 +468,22 @@ func (m *RequestBeginBlock) GetByzantineValidators() []Evidence { return nil } -type RequestCheckTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` - Type CheckTxType `protobuf:"varint,2,opt,name=type,proto3,enum=ostracon.abci.CheckTxType" json:"type,omitempty"` +type RequestBeginRecheckTx struct { + Header types2.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` } -func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } -func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } -func (*RequestCheckTx) ProtoMessage() {} -func (*RequestCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{8} +func (m *RequestBeginRecheckTx) Reset() { *m = RequestBeginRecheckTx{} } +func (m *RequestBeginRecheckTx) String() string { return proto.CompactTextString(m) } +func (*RequestBeginRecheckTx) ProtoMessage() {} +func (*RequestBeginRecheckTx) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{3} } -func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { +func (m *RequestBeginRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RequestBeginRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestCheckTx.Marshal(b, m, deterministic) + return xxx_messageInfo_RequestBeginRecheckTx.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -881,48 +493,41 @@ func (m *RequestCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *RequestCheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestCheckTx.Merge(m, src) +func (m *RequestBeginRecheckTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestBeginRecheckTx.Merge(m, src) } -func (m *RequestCheckTx) XXX_Size() int { +func (m *RequestBeginRecheckTx) XXX_Size() int { return m.Size() } -func (m *RequestCheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestCheckTx.DiscardUnknown(m) +func (m *RequestBeginRecheckTx) XXX_DiscardUnknown() { + xxx_messageInfo_RequestBeginRecheckTx.DiscardUnknown(m) } -var xxx_messageInfo_RequestCheckTx proto.InternalMessageInfo - -func (m *RequestCheckTx) GetTx() []byte { - if m != nil { - return m.Tx - } - return nil -} +var xxx_messageInfo_RequestBeginRecheckTx proto.InternalMessageInfo -func (m *RequestCheckTx) GetType() CheckTxType { +func (m *RequestBeginRecheckTx) GetHeader() types2.Header { if m != nil { - return m.Type + return m.Header } - return CheckTxType_New + return types2.Header{} } -type RequestDeliverTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` +type RequestEndRecheckTx struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` } -func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } -func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } -func (*RequestDeliverTx) ProtoMessage() {} -func (*RequestDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{9} +func (m *RequestEndRecheckTx) Reset() { *m = RequestEndRecheckTx{} } +func (m *RequestEndRecheckTx) String() string { return proto.CompactTextString(m) } +func (*RequestEndRecheckTx) ProtoMessage() {} +func (*RequestEndRecheckTx) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{4} } -func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { +func (m *RequestEndRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestDeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RequestEndRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestDeliverTx.Marshal(b, m, deterministic) + return xxx_messageInfo_RequestEndRecheckTx.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -932,41 +537,60 @@ func (m *RequestDeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *RequestDeliverTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestDeliverTx.Merge(m, src) +func (m *RequestEndRecheckTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestEndRecheckTx.Merge(m, src) } -func (m *RequestDeliverTx) XXX_Size() int { +func (m *RequestEndRecheckTx) XXX_Size() int { return m.Size() } -func (m *RequestDeliverTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestDeliverTx.DiscardUnknown(m) +func (m *RequestEndRecheckTx) XXX_DiscardUnknown() { + xxx_messageInfo_RequestEndRecheckTx.DiscardUnknown(m) } -var xxx_messageInfo_RequestDeliverTx proto.InternalMessageInfo +var xxx_messageInfo_RequestEndRecheckTx proto.InternalMessageInfo -func (m *RequestDeliverTx) GetTx() []byte { +func (m *RequestEndRecheckTx) GetHeight() int64 { if m != nil { - return m.Tx + return m.Height } - return nil + return 0 } -type RequestEndBlock struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +type Response struct { + // Types that are valid to be assigned to Value: + // *Response_Exception + // *Response_Echo + // *Response_Flush + // *Response_Info + // *Response_SetOption + // *Response_InitChain + // *Response_Query + // *Response_BeginBlock + // *Response_CheckTx + // *Response_DeliverTx + // *Response_EndBlock + // *Response_Commit + // *Response_ListSnapshots + // *Response_OfferSnapshot + // *Response_LoadSnapshotChunk + // *Response_ApplySnapshotChunk + // *Response_BeginRecheckTx + // *Response_EndRecheckTx + Value isResponse_Value `protobuf_oneof:"value"` } -func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } -func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } -func (*RequestEndBlock) ProtoMessage() {} -func (*RequestEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{10} +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{5} } -func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { +func (m *Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestEndBlock.Marshal(b, m, deterministic) + return xxx_messageInfo_Response.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -976,289 +600,273 @@ func (m *RequestEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *RequestEndBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestEndBlock.Merge(m, src) +func (m *Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_Response.Merge(m, src) } -func (m *RequestEndBlock) XXX_Size() int { +func (m *Response) XXX_Size() int { return m.Size() } -func (m *RequestEndBlock) XXX_DiscardUnknown() { - xxx_messageInfo_RequestEndBlock.DiscardUnknown(m) +func (m *Response) XXX_DiscardUnknown() { + xxx_messageInfo_Response.DiscardUnknown(m) } -var xxx_messageInfo_RequestEndBlock proto.InternalMessageInfo - -func (m *RequestEndBlock) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} +var xxx_messageInfo_Response proto.InternalMessageInfo -type RequestCommit struct { +type isResponse_Value interface { + isResponse_Value() + MarshalTo([]byte) (int, error) + Size() int } -func (m *RequestCommit) Reset() { *m = RequestCommit{} } -func (m *RequestCommit) String() string { return proto.CompactTextString(m) } -func (*RequestCommit) ProtoMessage() {} -func (*RequestCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{11} -} -func (m *RequestCommit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestCommit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +type Response_Exception struct { + Exception *types.ResponseException `protobuf:"bytes,1,opt,name=exception,proto3,oneof" json:"exception,omitempty"` } -func (m *RequestCommit) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestCommit.Merge(m, src) +type Response_Echo struct { + Echo *types.ResponseEcho `protobuf:"bytes,2,opt,name=echo,proto3,oneof" json:"echo,omitempty"` } -func (m *RequestCommit) XXX_Size() int { - return m.Size() +type Response_Flush struct { + Flush *types.ResponseFlush `protobuf:"bytes,3,opt,name=flush,proto3,oneof" json:"flush,omitempty"` } -func (m *RequestCommit) XXX_DiscardUnknown() { - xxx_messageInfo_RequestCommit.DiscardUnknown(m) +type Response_Info struct { + Info *types.ResponseInfo `protobuf:"bytes,4,opt,name=info,proto3,oneof" json:"info,omitempty"` } - -var xxx_messageInfo_RequestCommit proto.InternalMessageInfo - -// lists available snapshots -type RequestListSnapshots struct { +type Response_SetOption struct { + SetOption *types.ResponseSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` } - -func (m *RequestListSnapshots) Reset() { *m = RequestListSnapshots{} } -func (m *RequestListSnapshots) String() string { return proto.CompactTextString(m) } -func (*RequestListSnapshots) ProtoMessage() {} -func (*RequestListSnapshots) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{12} +type Response_InitChain struct { + InitChain *ResponseInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } -func (m *RequestListSnapshots) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +type Response_Query struct { + Query *types.ResponseQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof" json:"query,omitempty"` } -func (m *RequestListSnapshots) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestListSnapshots.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +type Response_BeginBlock struct { + BeginBlock *types.ResponseBeginBlock `protobuf:"bytes,8,opt,name=begin_block,json=beginBlock,proto3,oneof" json:"begin_block,omitempty"` } -func (m *RequestListSnapshots) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestListSnapshots.Merge(m, src) +type Response_CheckTx struct { + CheckTx *ResponseCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` } -func (m *RequestListSnapshots) XXX_Size() int { - return m.Size() +type Response_DeliverTx struct { + DeliverTx *types.ResponseDeliverTx `protobuf:"bytes,10,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` } -func (m *RequestListSnapshots) XXX_DiscardUnknown() { - xxx_messageInfo_RequestListSnapshots.DiscardUnknown(m) +type Response_EndBlock struct { + EndBlock *ResponseEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` } - -var xxx_messageInfo_RequestListSnapshots proto.InternalMessageInfo - -// offers a snapshot to the application -type RequestOfferSnapshot struct { - Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` - AppHash []byte `protobuf:"bytes,2,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +type Response_Commit struct { + Commit *types.ResponseCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof" json:"commit,omitempty"` } - -func (m *RequestOfferSnapshot) Reset() { *m = RequestOfferSnapshot{} } -func (m *RequestOfferSnapshot) String() string { return proto.CompactTextString(m) } -func (*RequestOfferSnapshot) ProtoMessage() {} -func (*RequestOfferSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{13} +type Response_ListSnapshots struct { + ListSnapshots *types.ResponseListSnapshots `protobuf:"bytes,13,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` } -func (m *RequestOfferSnapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +type Response_OfferSnapshot struct { + OfferSnapshot *types.ResponseOfferSnapshot `protobuf:"bytes,14,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` } -func (m *RequestOfferSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestOfferSnapshot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +type Response_LoadSnapshotChunk struct { + LoadSnapshotChunk *types.ResponseLoadSnapshotChunk `protobuf:"bytes,15,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` } -func (m *RequestOfferSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestOfferSnapshot.Merge(m, src) +type Response_ApplySnapshotChunk struct { + ApplySnapshotChunk *types.ResponseApplySnapshotChunk `protobuf:"bytes,16,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` } -func (m *RequestOfferSnapshot) XXX_Size() int { - return m.Size() +type Response_BeginRecheckTx struct { + BeginRecheckTx *ResponseBeginRecheckTx `protobuf:"bytes,1000,opt,name=begin_recheck_tx,json=beginRecheckTx,proto3,oneof" json:"begin_recheck_tx,omitempty"` } -func (m *RequestOfferSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_RequestOfferSnapshot.DiscardUnknown(m) +type Response_EndRecheckTx struct { + EndRecheckTx *ResponseEndRecheckTx `protobuf:"bytes,1001,opt,name=end_recheck_tx,json=endRecheckTx,proto3,oneof" json:"end_recheck_tx,omitempty"` } -var xxx_messageInfo_RequestOfferSnapshot proto.InternalMessageInfo +func (*Response_Exception) isResponse_Value() {} +func (*Response_Echo) isResponse_Value() {} +func (*Response_Flush) isResponse_Value() {} +func (*Response_Info) isResponse_Value() {} +func (*Response_SetOption) isResponse_Value() {} +func (*Response_InitChain) isResponse_Value() {} +func (*Response_Query) isResponse_Value() {} +func (*Response_BeginBlock) isResponse_Value() {} +func (*Response_CheckTx) isResponse_Value() {} +func (*Response_DeliverTx) isResponse_Value() {} +func (*Response_EndBlock) isResponse_Value() {} +func (*Response_Commit) isResponse_Value() {} +func (*Response_ListSnapshots) isResponse_Value() {} +func (*Response_OfferSnapshot) isResponse_Value() {} +func (*Response_LoadSnapshotChunk) isResponse_Value() {} +func (*Response_ApplySnapshotChunk) isResponse_Value() {} +func (*Response_BeginRecheckTx) isResponse_Value() {} +func (*Response_EndRecheckTx) isResponse_Value() {} -func (m *RequestOfferSnapshot) GetSnapshot() *Snapshot { +func (m *Response) GetValue() isResponse_Value { if m != nil { - return m.Snapshot + return m.Value } return nil } -func (m *RequestOfferSnapshot) GetAppHash() []byte { - if m != nil { - return m.AppHash +func (m *Response) GetException() *types.ResponseException { + if x, ok := m.GetValue().(*Response_Exception); ok { + return x.Exception } return nil } -// loads a snapshot chunk -type RequestLoadSnapshotChunk struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunk uint32 `protobuf:"varint,3,opt,name=chunk,proto3" json:"chunk,omitempty"` +func (m *Response) GetEcho() *types.ResponseEcho { + if x, ok := m.GetValue().(*Response_Echo); ok { + return x.Echo + } + return nil } -func (m *RequestLoadSnapshotChunk) Reset() { *m = RequestLoadSnapshotChunk{} } -func (m *RequestLoadSnapshotChunk) String() string { return proto.CompactTextString(m) } -func (*RequestLoadSnapshotChunk) ProtoMessage() {} -func (*RequestLoadSnapshotChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{14} -} -func (m *RequestLoadSnapshotChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestLoadSnapshotChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestLoadSnapshotChunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *Response) GetFlush() *types.ResponseFlush { + if x, ok := m.GetValue().(*Response_Flush); ok { + return x.Flush } -} -func (m *RequestLoadSnapshotChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestLoadSnapshotChunk.Merge(m, src) -} -func (m *RequestLoadSnapshotChunk) XXX_Size() int { - return m.Size() -} -func (m *RequestLoadSnapshotChunk) XXX_DiscardUnknown() { - xxx_messageInfo_RequestLoadSnapshotChunk.DiscardUnknown(m) + return nil } -var xxx_messageInfo_RequestLoadSnapshotChunk proto.InternalMessageInfo - -func (m *RequestLoadSnapshotChunk) GetHeight() uint64 { - if m != nil { - return m.Height +func (m *Response) GetInfo() *types.ResponseInfo { + if x, ok := m.GetValue().(*Response_Info); ok { + return x.Info } - return 0 + return nil } -func (m *RequestLoadSnapshotChunk) GetFormat() uint32 { - if m != nil { - return m.Format +func (m *Response) GetSetOption() *types.ResponseSetOption { + if x, ok := m.GetValue().(*Response_SetOption); ok { + return x.SetOption } - return 0 + return nil } -func (m *RequestLoadSnapshotChunk) GetChunk() uint32 { - if m != nil { - return m.Chunk +func (m *Response) GetInitChain() *ResponseInitChain { + if x, ok := m.GetValue().(*Response_InitChain); ok { + return x.InitChain } - return 0 + return nil } -// Applies a snapshot chunk -type RequestApplySnapshotChunk struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` - Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` +func (m *Response) GetQuery() *types.ResponseQuery { + if x, ok := m.GetValue().(*Response_Query); ok { + return x.Query + } + return nil } -func (m *RequestApplySnapshotChunk) Reset() { *m = RequestApplySnapshotChunk{} } -func (m *RequestApplySnapshotChunk) String() string { return proto.CompactTextString(m) } -func (*RequestApplySnapshotChunk) ProtoMessage() {} -func (*RequestApplySnapshotChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{15} -} -func (m *RequestApplySnapshotChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *Response) GetBeginBlock() *types.ResponseBeginBlock { + if x, ok := m.GetValue().(*Response_BeginBlock); ok { + return x.BeginBlock + } + return nil } -func (m *RequestApplySnapshotChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestApplySnapshotChunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func (m *Response) GetCheckTx() *ResponseCheckTx { + if x, ok := m.GetValue().(*Response_CheckTx); ok { + return x.CheckTx } + return nil } -func (m *RequestApplySnapshotChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestApplySnapshotChunk.Merge(m, src) + +func (m *Response) GetDeliverTx() *types.ResponseDeliverTx { + if x, ok := m.GetValue().(*Response_DeliverTx); ok { + return x.DeliverTx + } + return nil } -func (m *RequestApplySnapshotChunk) XXX_Size() int { - return m.Size() + +func (m *Response) GetEndBlock() *ResponseEndBlock { + if x, ok := m.GetValue().(*Response_EndBlock); ok { + return x.EndBlock + } + return nil } -func (m *RequestApplySnapshotChunk) XXX_DiscardUnknown() { - xxx_messageInfo_RequestApplySnapshotChunk.DiscardUnknown(m) + +func (m *Response) GetCommit() *types.ResponseCommit { + if x, ok := m.GetValue().(*Response_Commit); ok { + return x.Commit + } + return nil } -var xxx_messageInfo_RequestApplySnapshotChunk proto.InternalMessageInfo +func (m *Response) GetListSnapshots() *types.ResponseListSnapshots { + if x, ok := m.GetValue().(*Response_ListSnapshots); ok { + return x.ListSnapshots + } + return nil +} -func (m *RequestApplySnapshotChunk) GetIndex() uint32 { - if m != nil { - return m.Index +func (m *Response) GetOfferSnapshot() *types.ResponseOfferSnapshot { + if x, ok := m.GetValue().(*Response_OfferSnapshot); ok { + return x.OfferSnapshot } - return 0 + return nil } -func (m *RequestApplySnapshotChunk) GetChunk() []byte { - if m != nil { - return m.Chunk +func (m *Response) GetLoadSnapshotChunk() *types.ResponseLoadSnapshotChunk { + if x, ok := m.GetValue().(*Response_LoadSnapshotChunk); ok { + return x.LoadSnapshotChunk } return nil } -func (m *RequestApplySnapshotChunk) GetSender() string { - if m != nil { - return m.Sender +func (m *Response) GetApplySnapshotChunk() *types.ResponseApplySnapshotChunk { + if x, ok := m.GetValue().(*Response_ApplySnapshotChunk); ok { + return x.ApplySnapshotChunk } - return "" + return nil } -type RequestBeginRecheckTx struct { - Header types1.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` +func (m *Response) GetBeginRecheckTx() *ResponseBeginRecheckTx { + if x, ok := m.GetValue().(*Response_BeginRecheckTx); ok { + return x.BeginRecheckTx + } + return nil } -func (m *RequestBeginRecheckTx) Reset() { *m = RequestBeginRecheckTx{} } -func (m *RequestBeginRecheckTx) String() string { return proto.CompactTextString(m) } -func (*RequestBeginRecheckTx) ProtoMessage() {} -func (*RequestBeginRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{16} +func (m *Response) GetEndRecheckTx() *ResponseEndRecheckTx { + if x, ok := m.GetValue().(*Response_EndRecheckTx); ok { + return x.EndRecheckTx + } + return nil } -func (m *RequestBeginRecheckTx) XXX_Unmarshal(b []byte) error { + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Response) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Response_Exception)(nil), + (*Response_Echo)(nil), + (*Response_Flush)(nil), + (*Response_Info)(nil), + (*Response_SetOption)(nil), + (*Response_InitChain)(nil), + (*Response_Query)(nil), + (*Response_BeginBlock)(nil), + (*Response_CheckTx)(nil), + (*Response_DeliverTx)(nil), + (*Response_EndBlock)(nil), + (*Response_Commit)(nil), + (*Response_ListSnapshots)(nil), + (*Response_OfferSnapshot)(nil), + (*Response_LoadSnapshotChunk)(nil), + (*Response_ApplySnapshotChunk)(nil), + (*Response_BeginRecheckTx)(nil), + (*Response_EndRecheckTx)(nil), + } +} + +type ResponseInitChain struct { + ConsensusParams *types.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"` + AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +} + +func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } +func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } +func (*ResponseInitChain) ProtoMessage() {} +func (*ResponseInitChain) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{6} +} +func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestBeginRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResponseInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestBeginRecheckTx.Marshal(b, m, deterministic) + return xxx_messageInfo_ResponseInitChain.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1268,41 +876,67 @@ func (m *RequestBeginRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *RequestBeginRecheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestBeginRecheckTx.Merge(m, src) +func (m *ResponseInitChain) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseInitChain.Merge(m, src) } -func (m *RequestBeginRecheckTx) XXX_Size() int { +func (m *ResponseInitChain) XXX_Size() int { return m.Size() } -func (m *RequestBeginRecheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestBeginRecheckTx.DiscardUnknown(m) +func (m *ResponseInitChain) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseInitChain.DiscardUnknown(m) } -var xxx_messageInfo_RequestBeginRecheckTx proto.InternalMessageInfo +var xxx_messageInfo_ResponseInitChain proto.InternalMessageInfo -func (m *RequestBeginRecheckTx) GetHeader() types1.Header { +func (m *ResponseInitChain) GetConsensusParams() *types.ConsensusParams { if m != nil { - return m.Header + return m.ConsensusParams } - return types1.Header{} + return nil } -type RequestEndRecheckTx struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +func (m *ResponseInitChain) GetValidators() []ValidatorUpdate { + if m != nil { + return m.Validators + } + return nil } -func (m *RequestEndRecheckTx) Reset() { *m = RequestEndRecheckTx{} } -func (m *RequestEndRecheckTx) String() string { return proto.CompactTextString(m) } -func (*RequestEndRecheckTx) ProtoMessage() {} -func (*RequestEndRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{17} +func (m *ResponseInitChain) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil } -func (m *RequestEndRecheckTx) XXX_Unmarshal(b []byte) error { + +type ResponseCheckTx struct { + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,proto3" json:"gas_used,omitempty"` + Events []types.Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` + Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` + Sender string `protobuf:"bytes,9,opt,name=sender,proto3" json:"sender,omitempty"` + Priority int64 `protobuf:"varint,10,opt,name=priority,proto3" json:"priority,omitempty"` + // mempool_error is set by Ostracon. + // ABCI applictions creating a ResponseCheckTX should not set mempool_error. + MempoolError string `protobuf:"bytes,11,opt,name=mempool_error,json=mempoolError,proto3" json:"mempool_error,omitempty"` +} + +func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } +func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } +func (*ResponseCheckTx) ProtoMessage() {} +func (*ResponseCheckTx) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{7} +} +func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RequestEndRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResponseCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RequestEndRecheckTx.Marshal(b, m, deterministic) + return xxx_messageInfo_ResponseCheckTx.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1312,60 +946,113 @@ func (m *RequestEndRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *RequestEndRecheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestEndRecheckTx.Merge(m, src) +func (m *ResponseCheckTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseCheckTx.Merge(m, src) } -func (m *RequestEndRecheckTx) XXX_Size() int { +func (m *ResponseCheckTx) XXX_Size() int { return m.Size() } -func (m *RequestEndRecheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestEndRecheckTx.DiscardUnknown(m) +func (m *ResponseCheckTx) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseCheckTx.DiscardUnknown(m) } -var xxx_messageInfo_RequestEndRecheckTx proto.InternalMessageInfo +var xxx_messageInfo_ResponseCheckTx proto.InternalMessageInfo -func (m *RequestEndRecheckTx) GetHeight() int64 { +func (m *ResponseCheckTx) GetCode() uint32 { if m != nil { - return m.Height + return m.Code } return 0 } -type Response struct { - // Types that are valid to be assigned to Value: - // *Response_Exception - // *Response_Echo - // *Response_Flush - // *Response_Info - // *Response_SetOption - // *Response_InitChain - // *Response_Query - // *Response_BeginBlock - // *Response_CheckTx - // *Response_DeliverTx - // *Response_EndBlock - // *Response_Commit - // *Response_ListSnapshots - // *Response_OfferSnapshot - // *Response_LoadSnapshotChunk - // *Response_ApplySnapshotChunk - // *Response_BeginRecheckTx - // *Response_EndRecheckTx - Value isResponse_Value `protobuf_oneof:"value"` +func (m *ResponseCheckTx) GetData() []byte { + if m != nil { + return m.Data + } + return nil } -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{18} +func (m *ResponseCheckTx) GetLog() string { + if m != nil { + return m.Log + } + return "" } -func (m *Response) XXX_Unmarshal(b []byte) error { + +func (m *ResponseCheckTx) GetInfo() string { + if m != nil { + return m.Info + } + return "" +} + +func (m *ResponseCheckTx) GetGasWanted() int64 { + if m != nil { + return m.GasWanted + } + return 0 +} + +func (m *ResponseCheckTx) GetGasUsed() int64 { + if m != nil { + return m.GasUsed + } + return 0 +} + +func (m *ResponseCheckTx) GetEvents() []types.Event { + if m != nil { + return m.Events + } + return nil +} + +func (m *ResponseCheckTx) GetCodespace() string { + if m != nil { + return m.Codespace + } + return "" +} + +func (m *ResponseCheckTx) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *ResponseCheckTx) GetPriority() int64 { + if m != nil { + return m.Priority + } + return 0 +} + +func (m *ResponseCheckTx) GetMempoolError() string { + if m != nil { + return m.MempoolError + } + return "" +} + +type ResponseEndBlock struct { + ValidatorUpdates []ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates"` + ConsensusParamUpdates *types.ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` + Events []types.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"` +} + +func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } +func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } +func (*ResponseEndBlock) ProtoMessage() {} +func (*ResponseEndBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{8} +} +func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResponseEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) + return xxx_messageInfo_ResponseEndBlock.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1375,272 +1062,55 @@ func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) +func (m *ResponseEndBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseEndBlock.Merge(m, src) } -func (m *Response) XXX_Size() int { +func (m *ResponseEndBlock) XXX_Size() int { return m.Size() } -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) +func (m *ResponseEndBlock) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseEndBlock.DiscardUnknown(m) } -var xxx_messageInfo_Response proto.InternalMessageInfo +var xxx_messageInfo_ResponseEndBlock proto.InternalMessageInfo -type isResponse_Value interface { - isResponse_Value() - MarshalTo([]byte) (int, error) - Size() int +func (m *ResponseEndBlock) GetValidatorUpdates() []ValidatorUpdate { + if m != nil { + return m.ValidatorUpdates + } + return nil } -type Response_Exception struct { - Exception *ResponseException `protobuf:"bytes,1,opt,name=exception,proto3,oneof" json:"exception,omitempty"` -} -type Response_Echo struct { - Echo *ResponseEcho `protobuf:"bytes,2,opt,name=echo,proto3,oneof" json:"echo,omitempty"` +func (m *ResponseEndBlock) GetConsensusParamUpdates() *types.ConsensusParams { + if m != nil { + return m.ConsensusParamUpdates + } + return nil } -type Response_Flush struct { - Flush *ResponseFlush `protobuf:"bytes,3,opt,name=flush,proto3,oneof" json:"flush,omitempty"` + +func (m *ResponseEndBlock) GetEvents() []types.Event { + if m != nil { + return m.Events + } + return nil } -type Response_Info struct { - Info *ResponseInfo `protobuf:"bytes,4,opt,name=info,proto3,oneof" json:"info,omitempty"` + +type ResponseBeginRecheckTx struct { + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` } -type Response_SetOption struct { - SetOption *ResponseSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` + +func (m *ResponseBeginRecheckTx) Reset() { *m = ResponseBeginRecheckTx{} } +func (m *ResponseBeginRecheckTx) String() string { return proto.CompactTextString(m) } +func (*ResponseBeginRecheckTx) ProtoMessage() {} +func (*ResponseBeginRecheckTx) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{9} } -type Response_InitChain struct { - InitChain *ResponseInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` -} -type Response_Query struct { - Query *ResponseQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof" json:"query,omitempty"` -} -type Response_BeginBlock struct { - BeginBlock *ResponseBeginBlock `protobuf:"bytes,8,opt,name=begin_block,json=beginBlock,proto3,oneof" json:"begin_block,omitempty"` -} -type Response_CheckTx struct { - CheckTx *ResponseCheckTx `protobuf:"bytes,9,opt,name=check_tx,json=checkTx,proto3,oneof" json:"check_tx,omitempty"` -} -type Response_DeliverTx struct { - DeliverTx *ResponseDeliverTx `protobuf:"bytes,10,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` -} -type Response_EndBlock struct { - EndBlock *ResponseEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` -} -type Response_Commit struct { - Commit *ResponseCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof" json:"commit,omitempty"` -} -type Response_ListSnapshots struct { - ListSnapshots *ResponseListSnapshots `protobuf:"bytes,13,opt,name=list_snapshots,json=listSnapshots,proto3,oneof" json:"list_snapshots,omitempty"` -} -type Response_OfferSnapshot struct { - OfferSnapshot *ResponseOfferSnapshot `protobuf:"bytes,14,opt,name=offer_snapshot,json=offerSnapshot,proto3,oneof" json:"offer_snapshot,omitempty"` -} -type Response_LoadSnapshotChunk struct { - LoadSnapshotChunk *ResponseLoadSnapshotChunk `protobuf:"bytes,15,opt,name=load_snapshot_chunk,json=loadSnapshotChunk,proto3,oneof" json:"load_snapshot_chunk,omitempty"` -} -type Response_ApplySnapshotChunk struct { - ApplySnapshotChunk *ResponseApplySnapshotChunk `protobuf:"bytes,16,opt,name=apply_snapshot_chunk,json=applySnapshotChunk,proto3,oneof" json:"apply_snapshot_chunk,omitempty"` -} -type Response_BeginRecheckTx struct { - BeginRecheckTx *ResponseBeginRecheckTx `protobuf:"bytes,1000,opt,name=begin_recheck_tx,json=beginRecheckTx,proto3,oneof" json:"begin_recheck_tx,omitempty"` -} -type Response_EndRecheckTx struct { - EndRecheckTx *ResponseEndRecheckTx `protobuf:"bytes,1001,opt,name=end_recheck_tx,json=endRecheckTx,proto3,oneof" json:"end_recheck_tx,omitempty"` -} - -func (*Response_Exception) isResponse_Value() {} -func (*Response_Echo) isResponse_Value() {} -func (*Response_Flush) isResponse_Value() {} -func (*Response_Info) isResponse_Value() {} -func (*Response_SetOption) isResponse_Value() {} -func (*Response_InitChain) isResponse_Value() {} -func (*Response_Query) isResponse_Value() {} -func (*Response_BeginBlock) isResponse_Value() {} -func (*Response_CheckTx) isResponse_Value() {} -func (*Response_DeliverTx) isResponse_Value() {} -func (*Response_EndBlock) isResponse_Value() {} -func (*Response_Commit) isResponse_Value() {} -func (*Response_ListSnapshots) isResponse_Value() {} -func (*Response_OfferSnapshot) isResponse_Value() {} -func (*Response_LoadSnapshotChunk) isResponse_Value() {} -func (*Response_ApplySnapshotChunk) isResponse_Value() {} -func (*Response_BeginRecheckTx) isResponse_Value() {} -func (*Response_EndRecheckTx) isResponse_Value() {} - -func (m *Response) GetValue() isResponse_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *Response) GetException() *ResponseException { - if x, ok := m.GetValue().(*Response_Exception); ok { - return x.Exception - } - return nil -} - -func (m *Response) GetEcho() *ResponseEcho { - if x, ok := m.GetValue().(*Response_Echo); ok { - return x.Echo - } - return nil -} - -func (m *Response) GetFlush() *ResponseFlush { - if x, ok := m.GetValue().(*Response_Flush); ok { - return x.Flush - } - return nil -} - -func (m *Response) GetInfo() *ResponseInfo { - if x, ok := m.GetValue().(*Response_Info); ok { - return x.Info - } - return nil -} - -func (m *Response) GetSetOption() *ResponseSetOption { - if x, ok := m.GetValue().(*Response_SetOption); ok { - return x.SetOption - } - return nil -} - -func (m *Response) GetInitChain() *ResponseInitChain { - if x, ok := m.GetValue().(*Response_InitChain); ok { - return x.InitChain - } - return nil -} - -func (m *Response) GetQuery() *ResponseQuery { - if x, ok := m.GetValue().(*Response_Query); ok { - return x.Query - } - return nil -} - -func (m *Response) GetBeginBlock() *ResponseBeginBlock { - if x, ok := m.GetValue().(*Response_BeginBlock); ok { - return x.BeginBlock - } - return nil -} - -func (m *Response) GetCheckTx() *ResponseCheckTx { - if x, ok := m.GetValue().(*Response_CheckTx); ok { - return x.CheckTx - } - return nil -} - -func (m *Response) GetDeliverTx() *ResponseDeliverTx { - if x, ok := m.GetValue().(*Response_DeliverTx); ok { - return x.DeliverTx - } - return nil -} - -func (m *Response) GetEndBlock() *ResponseEndBlock { - if x, ok := m.GetValue().(*Response_EndBlock); ok { - return x.EndBlock - } - return nil -} - -func (m *Response) GetCommit() *ResponseCommit { - if x, ok := m.GetValue().(*Response_Commit); ok { - return x.Commit - } - return nil -} - -func (m *Response) GetListSnapshots() *ResponseListSnapshots { - if x, ok := m.GetValue().(*Response_ListSnapshots); ok { - return x.ListSnapshots - } - return nil -} - -func (m *Response) GetOfferSnapshot() *ResponseOfferSnapshot { - if x, ok := m.GetValue().(*Response_OfferSnapshot); ok { - return x.OfferSnapshot - } - return nil -} - -func (m *Response) GetLoadSnapshotChunk() *ResponseLoadSnapshotChunk { - if x, ok := m.GetValue().(*Response_LoadSnapshotChunk); ok { - return x.LoadSnapshotChunk - } - return nil -} - -func (m *Response) GetApplySnapshotChunk() *ResponseApplySnapshotChunk { - if x, ok := m.GetValue().(*Response_ApplySnapshotChunk); ok { - return x.ApplySnapshotChunk - } - return nil -} - -func (m *Response) GetBeginRecheckTx() *ResponseBeginRecheckTx { - if x, ok := m.GetValue().(*Response_BeginRecheckTx); ok { - return x.BeginRecheckTx - } - return nil -} - -func (m *Response) GetEndRecheckTx() *ResponseEndRecheckTx { - if x, ok := m.GetValue().(*Response_EndRecheckTx); ok { - return x.EndRecheckTx - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Response) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Response_Exception)(nil), - (*Response_Echo)(nil), - (*Response_Flush)(nil), - (*Response_Info)(nil), - (*Response_SetOption)(nil), - (*Response_InitChain)(nil), - (*Response_Query)(nil), - (*Response_BeginBlock)(nil), - (*Response_CheckTx)(nil), - (*Response_DeliverTx)(nil), - (*Response_EndBlock)(nil), - (*Response_Commit)(nil), - (*Response_ListSnapshots)(nil), - (*Response_OfferSnapshot)(nil), - (*Response_LoadSnapshotChunk)(nil), - (*Response_ApplySnapshotChunk)(nil), - (*Response_BeginRecheckTx)(nil), - (*Response_EndRecheckTx)(nil), - } -} - -// nondeterministic -type ResponseException struct { - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *ResponseException) Reset() { *m = ResponseException{} } -func (m *ResponseException) String() string { return proto.CompactTextString(m) } -func (*ResponseException) ProtoMessage() {} -func (*ResponseException) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{19} -} -func (m *ResponseException) XXX_Unmarshal(b []byte) error { +func (m *ResponseBeginRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseException) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResponseBeginRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseException.Marshal(b, m, deterministic) + return xxx_messageInfo_ResponseBeginRecheckTx.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1650,41 +1120,41 @@ func (m *ResponseException) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *ResponseException) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseException.Merge(m, src) +func (m *ResponseBeginRecheckTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseBeginRecheckTx.Merge(m, src) } -func (m *ResponseException) XXX_Size() int { +func (m *ResponseBeginRecheckTx) XXX_Size() int { return m.Size() } -func (m *ResponseException) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseException.DiscardUnknown(m) +func (m *ResponseBeginRecheckTx) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseBeginRecheckTx.DiscardUnknown(m) } -var xxx_messageInfo_ResponseException proto.InternalMessageInfo +var xxx_messageInfo_ResponseBeginRecheckTx proto.InternalMessageInfo -func (m *ResponseException) GetError() string { +func (m *ResponseBeginRecheckTx) GetCode() uint32 { if m != nil { - return m.Error + return m.Code } - return "" + return 0 } -type ResponseEcho struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +type ResponseEndRecheckTx struct { + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` } -func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } -func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } -func (*ResponseEcho) ProtoMessage() {} -func (*ResponseEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{20} +func (m *ResponseEndRecheckTx) Reset() { *m = ResponseEndRecheckTx{} } +func (m *ResponseEndRecheckTx) String() string { return proto.CompactTextString(m) } +func (*ResponseEndRecheckTx) ProtoMessage() {} +func (*ResponseEndRecheckTx) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{10} } -func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { +func (m *ResponseEndRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseEcho) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResponseEndRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseEcho.Marshal(b, m, deterministic) + return xxx_messageInfo_ResponseEndRecheckTx.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1694,40 +1164,42 @@ func (m *ResponseEcho) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *ResponseEcho) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseEcho.Merge(m, src) +func (m *ResponseEndRecheckTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseEndRecheckTx.Merge(m, src) } -func (m *ResponseEcho) XXX_Size() int { +func (m *ResponseEndRecheckTx) XXX_Size() int { return m.Size() } -func (m *ResponseEcho) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseEcho.DiscardUnknown(m) +func (m *ResponseEndRecheckTx) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseEndRecheckTx.DiscardUnknown(m) } -var xxx_messageInfo_ResponseEcho proto.InternalMessageInfo +var xxx_messageInfo_ResponseEndRecheckTx proto.InternalMessageInfo -func (m *ResponseEcho) GetMessage() string { +func (m *ResponseEndRecheckTx) GetCode() uint32 { if m != nil { - return m.Message + return m.Code } - return "" + return 0 } -type ResponseFlush struct { +type LastCommitInfo struct { + Round int32 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Votes []VoteInfo `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes"` } -func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } -func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } -func (*ResponseFlush) ProtoMessage() {} -func (*ResponseFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{21} +func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } +func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } +func (*LastCommitInfo) ProtoMessage() {} +func (*LastCommitInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{11} } -func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { +func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseFlush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *LastCommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseFlush.Marshal(b, m, deterministic) + return xxx_messageInfo_LastCommitInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1737,38 +1209,51 @@ func (m *ResponseFlush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *ResponseFlush) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseFlush.Merge(m, src) +func (m *LastCommitInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_LastCommitInfo.Merge(m, src) } -func (m *ResponseFlush) XXX_Size() int { +func (m *LastCommitInfo) XXX_Size() int { return m.Size() } -func (m *ResponseFlush) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseFlush.DiscardUnknown(m) +func (m *LastCommitInfo) XXX_DiscardUnknown() { + xxx_messageInfo_LastCommitInfo.DiscardUnknown(m) } -var xxx_messageInfo_ResponseFlush proto.InternalMessageInfo +var xxx_messageInfo_LastCommitInfo proto.InternalMessageInfo -type ResponseInfo struct { - Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - AppVersion uint64 `protobuf:"varint,3,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` - LastBlockHeight int64 `protobuf:"varint,4,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockAppHash []byte `protobuf:"bytes,5,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` +func (m *LastCommitInfo) GetRound() int32 { + if m != nil { + return m.Round + } + return 0 } -func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } -func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } -func (*ResponseInfo) ProtoMessage() {} -func (*ResponseInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{22} -} -func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *LastCommitInfo) GetVotes() []VoteInfo { + if m != nil { + return m.Votes + } + return nil +} + +// Validator +type Validator struct { + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; + Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` +} + +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{12} +} +func (m *Validator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_Validator.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1778,73 +1263,50 @@ func (m *ResponseInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *ResponseInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseInfo.Merge(m, src) +func (m *Validator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validator.Merge(m, src) } -func (m *ResponseInfo) XXX_Size() int { +func (m *Validator) XXX_Size() int { return m.Size() } -func (m *ResponseInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseInfo proto.InternalMessageInfo - -func (m *ResponseInfo) GetData() string { - if m != nil { - return m.Data - } - return "" +func (m *Validator) XXX_DiscardUnknown() { + xxx_messageInfo_Validator.DiscardUnknown(m) } -func (m *ResponseInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} +var xxx_messageInfo_Validator proto.InternalMessageInfo -func (m *ResponseInfo) GetAppVersion() uint64 { +func (m *Validator) GetAddress() []byte { if m != nil { - return m.AppVersion + return m.Address } - return 0 + return nil } -func (m *ResponseInfo) GetLastBlockHeight() int64 { +func (m *Validator) GetPower() int64 { if m != nil { - return m.LastBlockHeight + return m.Power } return 0 } -func (m *ResponseInfo) GetLastBlockAppHash() []byte { - if m != nil { - return m.LastBlockAppHash - } - return nil -} - -// nondeterministic -type ResponseSetOption struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - // bytes data = 2; - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` +// ValidatorUpdate +type ValidatorUpdate struct { + PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` + Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` } -func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } -func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } -func (*ResponseSetOption) ProtoMessage() {} -func (*ResponseSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{23} +func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } +func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } +func (*ValidatorUpdate) ProtoMessage() {} +func (*ValidatorUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{13} } -func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { +func (m *ValidatorUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseSetOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ValidatorUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseSetOption.Marshal(b, m, deterministic) + return xxx_messageInfo_ValidatorUpdate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1854,57 +1316,50 @@ func (m *ResponseSetOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *ResponseSetOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseSetOption.Merge(m, src) +func (m *ValidatorUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorUpdate.Merge(m, src) } -func (m *ResponseSetOption) XXX_Size() int { +func (m *ValidatorUpdate) XXX_Size() int { return m.Size() } -func (m *ResponseSetOption) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseSetOption.DiscardUnknown(m) +func (m *ValidatorUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorUpdate.DiscardUnknown(m) } -var xxx_messageInfo_ResponseSetOption proto.InternalMessageInfo - -func (m *ResponseSetOption) GetCode() uint32 { - if m != nil { - return m.Code - } - return 0 -} +var xxx_messageInfo_ValidatorUpdate proto.InternalMessageInfo -func (m *ResponseSetOption) GetLog() string { +func (m *ValidatorUpdate) GetPubKey() crypto.PublicKey { if m != nil { - return m.Log + return m.PubKey } - return "" + return crypto.PublicKey{} } -func (m *ResponseSetOption) GetInfo() string { +func (m *ValidatorUpdate) GetPower() int64 { if m != nil { - return m.Info + return m.Power } - return "" + return 0 } -type ResponseInitChain struct { - ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` - Validators []ValidatorUpdate `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"` - AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +// VoteInfo +type VoteInfo struct { + Validator Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` + SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` } -func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } -func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } -func (*ResponseInitChain) ProtoMessage() {} -func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{24} +func (m *VoteInfo) Reset() { *m = VoteInfo{} } +func (m *VoteInfo) String() string { return proto.CompactTextString(m) } +func (*VoteInfo) ProtoMessage() {} +func (*VoteInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{14} } -func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { +func (m *VoteInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *VoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseInitChain.Marshal(b, m, deterministic) + return xxx_messageInfo_VoteInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1914,64 +1369,58 @@ func (m *ResponseInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *ResponseInitChain) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseInitChain.Merge(m, src) +func (m *VoteInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_VoteInfo.Merge(m, src) } -func (m *ResponseInitChain) XXX_Size() int { +func (m *VoteInfo) XXX_Size() int { return m.Size() } -func (m *ResponseInitChain) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseInitChain.DiscardUnknown(m) +func (m *VoteInfo) XXX_DiscardUnknown() { + xxx_messageInfo_VoteInfo.DiscardUnknown(m) } -var xxx_messageInfo_ResponseInitChain proto.InternalMessageInfo +var xxx_messageInfo_VoteInfo proto.InternalMessageInfo -func (m *ResponseInitChain) GetConsensusParams() *ConsensusParams { +func (m *VoteInfo) GetValidator() Validator { if m != nil { - return m.ConsensusParams + return m.Validator } - return nil + return Validator{} } -func (m *ResponseInitChain) GetValidators() []ValidatorUpdate { +func (m *VoteInfo) GetSignedLastBlock() bool { if m != nil { - return m.Validators + return m.SignedLastBlock } - return nil + return false } -func (m *ResponseInitChain) GetAppHash() []byte { - if m != nil { - return m.AppHash - } - return nil +type Evidence struct { + Type types.EvidenceType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.abci.EvidenceType" json:"type,omitempty"` + // The offending validator + Validator Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator"` + // The height when the offense occurred + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + // The corresponding time where the offense occurred + Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` + // Total voting power of the validator set in case the ABCI application does + // not store historical validators. + // https://github.com/tendermint/tendermint/issues/4581 + TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` } -type ResponseQuery struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - // bytes data = 2; // use "value" instead. - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` - Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` - ProofOps *crypto.ProofOps `protobuf:"bytes,8,opt,name=proof_ops,json=proofOps,proto3" json:"proof_ops,omitempty"` - Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` - Codespace string `protobuf:"bytes,10,opt,name=codespace,proto3" json:"codespace,omitempty"` -} - -func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } -func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } -func (*ResponseQuery) ProtoMessage() {} -func (*ResponseQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{25} -} -func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { +func (m *Evidence) Reset() { *m = Evidence{} } +func (m *Evidence) String() string { return proto.CompactTextString(m) } +func (*Evidence) ProtoMessage() {} +func (*Evidence) Descriptor() ([]byte, []int) { + return fileDescriptor_addf585b2317eb36, []int{15} +} +func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResponseQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ResponseQuery.Marshal(b, m, deterministic) + return xxx_messageInfo_Evidence.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1981,2327 +1430,2138 @@ func (m *ResponseQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *ResponseQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseQuery.Merge(m, src) +func (m *Evidence) XXX_Merge(src proto.Message) { + xxx_messageInfo_Evidence.Merge(m, src) } -func (m *ResponseQuery) XXX_Size() int { +func (m *Evidence) XXX_Size() int { return m.Size() } -func (m *ResponseQuery) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseQuery.DiscardUnknown(m) +func (m *Evidence) XXX_DiscardUnknown() { + xxx_messageInfo_Evidence.DiscardUnknown(m) } -var xxx_messageInfo_ResponseQuery proto.InternalMessageInfo - -func (m *ResponseQuery) GetCode() uint32 { - if m != nil { - return m.Code - } - return 0 -} +var xxx_messageInfo_Evidence proto.InternalMessageInfo -func (m *ResponseQuery) GetLog() string { +func (m *Evidence) GetType() types.EvidenceType { if m != nil { - return m.Log + return m.Type } - return "" + return types.EvidenceType_UNKNOWN } -func (m *ResponseQuery) GetInfo() string { +func (m *Evidence) GetValidator() Validator { if m != nil { - return m.Info + return m.Validator } - return "" + return Validator{} } -func (m *ResponseQuery) GetIndex() int64 { +func (m *Evidence) GetHeight() int64 { if m != nil { - return m.Index + return m.Height } return 0 } -func (m *ResponseQuery) GetKey() []byte { +func (m *Evidence) GetTime() time.Time { if m != nil { - return m.Key + return m.Time } - return nil + return time.Time{} } -func (m *ResponseQuery) GetValue() []byte { +func (m *Evidence) GetTotalVotingPower() int64 { if m != nil { - return m.Value + return m.TotalVotingPower } - return nil + return 0 } -func (m *ResponseQuery) GetProofOps() *crypto.ProofOps { - if m != nil { - return m.ProofOps - } - return nil +func init() { + proto.RegisterType((*Request)(nil), "ostracon.abci.Request") + proto.RegisterType((*RequestInitChain)(nil), "ostracon.abci.RequestInitChain") + proto.RegisterType((*RequestBeginBlock)(nil), "ostracon.abci.RequestBeginBlock") + proto.RegisterType((*RequestBeginRecheckTx)(nil), "ostracon.abci.RequestBeginRecheckTx") + proto.RegisterType((*RequestEndRecheckTx)(nil), "ostracon.abci.RequestEndRecheckTx") + proto.RegisterType((*Response)(nil), "ostracon.abci.Response") + proto.RegisterType((*ResponseInitChain)(nil), "ostracon.abci.ResponseInitChain") + proto.RegisterType((*ResponseCheckTx)(nil), "ostracon.abci.ResponseCheckTx") + proto.RegisterType((*ResponseEndBlock)(nil), "ostracon.abci.ResponseEndBlock") + proto.RegisterType((*ResponseBeginRecheckTx)(nil), "ostracon.abci.ResponseBeginRecheckTx") + proto.RegisterType((*ResponseEndRecheckTx)(nil), "ostracon.abci.ResponseEndRecheckTx") + proto.RegisterType((*LastCommitInfo)(nil), "ostracon.abci.LastCommitInfo") + proto.RegisterType((*Validator)(nil), "ostracon.abci.Validator") + proto.RegisterType((*ValidatorUpdate)(nil), "ostracon.abci.ValidatorUpdate") + proto.RegisterType((*VoteInfo)(nil), "ostracon.abci.VoteInfo") + proto.RegisterType((*Evidence)(nil), "ostracon.abci.Evidence") } -func (m *ResponseQuery) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} +func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_addf585b2317eb36) } -func (m *ResponseQuery) GetCodespace() string { - if m != nil { - return m.Codespace - } - return "" +var fileDescriptor_addf585b2317eb36 = []byte{ + // 1904 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x59, 0x4f, 0x93, 0xdb, 0x48, + 0x15, 0xb7, 0xc7, 0x9e, 0xb1, 0xf5, 0x66, 0xc6, 0x33, 0xf3, 0x32, 0x9b, 0x75, 0xc4, 0x66, 0x26, + 0x38, 0x64, 0x0b, 0x42, 0xb0, 0x8b, 0x04, 0xb6, 0x76, 0x6b, 0x97, 0x3f, 0xb1, 0x77, 0x52, 0x0e, + 0x49, 0x36, 0x89, 0x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 0x77, 0x3e, 0x15, 0x87, 0xe1, 0x49, 0x02, 0x7f, 0x27, 0x22, 0xf0, 0x5a, 0x6e, 0x3d, 0x0e, + 0xa2, 0x96, 0x18, 0xfc, 0x4e, 0xc8, 0xe0, 0xf5, 0x82, 0xc1, 0x52, 0x14, 0x3e, 0x48, 0x51, 0xf8, + 0x66, 0xc1, 0x32, 0x73, 0x38, 0xfc, 0x6e, 0x8a, 0xc3, 0xb7, 0x72, 0x98, 0x34, 0x1a, 0x3d, 0x93, + 0xc4, 0xdf, 0x89, 0x48, 0xbc, 0x51, 0xb0, 0xe8, 0x25, 0x16, 0xbf, 0x97, 0x66, 0xf1, 0x80, 0x83, + 0xaf, 0xe7, 0x46, 0xe7, 0x12, 0xf9, 0xfb, 0x09, 0x22, 0x57, 0xc2, 0x29, 0x64, 0x2f, 0x20, 0x83, + 0xc7, 0x07, 0x29, 0x1e, 0x87, 0x82, 0x4d, 0xcc, 0x21, 0xf2, 0x1f, 0x26, 0x89, 0x7c, 0x3b, 0x47, + 0x07, 0x85, 0xe9, 0x92, 0xc5, 0xe3, 0xef, 0xc5, 0x3c, 0xbe, 0x93, 0x2b, 0x44, 0xc2, 0x15, 0x2c, + 0x13, 0xf9, 0xe3, 0x15, 0x22, 0x0f, 0x88, 0xf7, 0xed, 0x5c, 0x88, 0x02, 0x26, 0x7f, 0xbc, 0xc2, + 0xe4, 0xad, 0x02, 0xc0, 0x02, 0x2a, 0xff, 0x65, 0x36, 0x95, 0xe7, 0x93, 0x6d, 0x38, 0xcd, 0x72, + 0x5c, 0xae, 0xe7, 0x70, 0xf9, 0xbe, 0x84, 0xff, 0x76, 0x2e, 0x7c, 0x69, 0x32, 0xd7, 0xf2, 0xc9, + 0xfc, 0x46, 0xce, 0x19, 0x17, 0xb2, 0xf9, 0xc3, 0x3c, 0x36, 0xbf, 0x9e, 0x9f, 0x35, 0x25, 0xe8, + 0xfc, 0x8f, 0x92, 0x82, 0x96, 0xee, 0x6a, 0x26, 0xf5, 0x56, 0xff, 0x3f, 0xd4, 0xbb, 0xf1, 0x5f, + 0x52, 0xef, 0x15, 0x68, 0x0a, 0xea, 0x95, 0xcc, 0x58, 0x93, 0xcc, 0xd8, 0x20, 0xae, 0x3b, 0x24, + 0xfe, 0xa4, 0xf3, 0x97, 0x0d, 0xd8, 0x5b, 0xba, 0xae, 0x82, 0x44, 0x0d, 0x66, 0x06, 0x8a, 0x64, + 0x57, 0x93, 0xdf, 0xc2, 0x66, 0x12, 0x4e, 0x64, 0x79, 0xde, 0xd1, 0xe4, 0x37, 0xee, 0x43, 0xcd, + 0x66, 0x63, 0x89, 0xa8, 0x68, 0xe2, 0x53, 0x78, 0xc5, 0x75, 0x55, 0x09, 0xcb, 0xe6, 0x11, 0xc0, + 0x98, 0xf8, 0xfa, 0x67, 0xc4, 0xe1, 0xd4, 0x94, 0x65, 0xb3, 0xa6, 0x25, 0x2c, 0xa8, 0x42, 0x53, + 0xb4, 0x66, 0x3e, 0x35, 0x43, 0xa6, 0x8f, 0xdb, 0x38, 0x84, 0x2d, 0x7a, 0x4e, 0x1d, 0xee, 0xb7, + 0x1b, 0x72, 0xe9, 0x97, 0x57, 0x76, 0xf0, 0x44, 0x74, 0xf7, 0xdb, 0x62, 0xc9, 0xff, 0xfc, 0xea, + 0x78, 0x3f, 0xf0, 0xbe, 0xc5, 0xa6, 0x16, 0xa7, 0x53, 0x97, 0xcf, 0xb5, 0x30, 0x1e, 0xdf, 0x02, + 0x45, 0xac, 0xc3, 0x77, 0x89, 0x41, 0x65, 0xe9, 0x53, 0xb4, 0x85, 0x41, 0xb0, 0x9c, 0x2f, 0x81, + 0x65, 0x41, 0x53, 0xb4, 0xb0, 0x25, 0xe6, 0xe6, 0x7a, 0x16, 0xf3, 0x2c, 0x3e, 0x97, 0xb5, 0xaa, + 0xa6, 0xc5, 0x6d, 0xbc, 0x0e, 0xbb, 0x53, 0x3a, 0x75, 0x19, 0xb3, 0x75, 0xea, 0x79, 0xcc, 0x93, + 0x85, 0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, 0x75, 0x0d, 0x36, 0xed, 0xd9, 0x96, 0x43, 0x7b, 0x19, 0xff, 0xa5, 0x8c, 0xb6, 0x24, 0x89, + 0xdc, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x31, 0x66, 0xed, 0x69, 0x19, 0x00, 0x00, } -type ResponseBeginBlock struct { - Events []Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ABCIApplicationClient is the client API for ABCIApplication service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ABCIApplicationClient interface { + Echo(ctx context.Context, in *types.RequestEcho, opts ...grpc.CallOption) (*types.ResponseEcho, error) + Flush(ctx context.Context, in *types.RequestFlush, opts ...grpc.CallOption) (*types.ResponseFlush, error) + Info(ctx context.Context, in *types.RequestInfo, opts ...grpc.CallOption) (*types.ResponseInfo, error) + SetOption(ctx context.Context, in *types.RequestSetOption, opts ...grpc.CallOption) (*types.ResponseSetOption, error) + DeliverTx(ctx context.Context, in *types.RequestDeliverTx, opts ...grpc.CallOption) (*types.ResponseDeliverTx, error) + CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) + Query(ctx context.Context, in *types.RequestQuery, opts ...grpc.CallOption) (*types.ResponseQuery, error) + Commit(ctx context.Context, in *types.RequestCommit, opts ...grpc.CallOption) (*types.ResponseCommit, error) + InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) + BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*types.ResponseBeginBlock, error) + EndBlock(ctx context.Context, in *types.RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) + ListSnapshots(ctx context.Context, in *types.RequestListSnapshots, opts ...grpc.CallOption) (*types.ResponseListSnapshots, error) + OfferSnapshot(ctx context.Context, in *types.RequestOfferSnapshot, opts ...grpc.CallOption) (*types.ResponseOfferSnapshot, error) + LoadSnapshotChunk(ctx context.Context, in *types.RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*types.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunk(ctx context.Context, in *types.RequestApplySnapshotChunk, opts ...grpc.CallOption) (*types.ResponseApplySnapshotChunk, error) + BeginRecheckTx(ctx context.Context, in *RequestBeginRecheckTx, opts ...grpc.CallOption) (*ResponseBeginRecheckTx, error) + EndRecheckTx(ctx context.Context, in *RequestEndRecheckTx, opts ...grpc.CallOption) (*ResponseEndRecheckTx, error) } -func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } -func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } -func (*ResponseBeginBlock) ProtoMessage() {} -func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{26} +type aBCIApplicationClient struct { + cc *grpc.ClientConn } -func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func NewABCIApplicationClient(cc *grpc.ClientConn) ABCIApplicationClient { + return &aBCIApplicationClient{cc} } -func (m *ResponseBeginBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseBeginBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func (c *aBCIApplicationClient) Echo(ctx context.Context, in *types.RequestEcho, opts ...grpc.CallOption) (*types.ResponseEcho, error) { + out := new(types.ResponseEcho) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Echo", in, out, opts...) + if err != nil { + return nil, err } + return out, nil } -func (m *ResponseBeginBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseBeginBlock.Merge(m, src) -} -func (m *ResponseBeginBlock) XXX_Size() int { - return m.Size() -} -func (m *ResponseBeginBlock) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseBeginBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseBeginBlock proto.InternalMessageInfo -func (m *ResponseBeginBlock) GetEvents() []Event { - if m != nil { - return m.Events +func (c *aBCIApplicationClient) Flush(ctx context.Context, in *types.RequestFlush, opts ...grpc.CallOption) (*types.ResponseFlush, error) { + out := new(types.ResponseFlush) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Flush", in, out, opts...) + if err != nil { + return nil, err } - return nil -} - -type ResponseCheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,proto3" json:"gas_used,omitempty"` - Events []Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` - Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` - Sender string `protobuf:"bytes,9,opt,name=sender,proto3" json:"sender,omitempty"` - Priority int64 `protobuf:"varint,10,opt,name=priority,proto3" json:"priority,omitempty"` - // mempool_error is set by Ostracon. - // ABCI applictions creating a ResponseCheckTX should not set mempool_error. - MempoolError string `protobuf:"bytes,11,opt,name=mempool_error,json=mempoolError,proto3" json:"mempool_error,omitempty"` + return out, nil } -func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } -func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } -func (*ResponseCheckTx) ProtoMessage() {} -func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{27} -} -func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseCheckTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (c *aBCIApplicationClient) Info(ctx context.Context, in *types.RequestInfo, opts ...grpc.CallOption) (*types.ResponseInfo, error) { + out := new(types.ResponseInfo) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Info", in, out, opts...) + if err != nil { + return nil, err } + return out, nil } -func (m *ResponseCheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseCheckTx.Merge(m, src) -} -func (m *ResponseCheckTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseCheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseCheckTx.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseCheckTx proto.InternalMessageInfo -func (m *ResponseCheckTx) GetCode() uint32 { - if m != nil { - return m.Code +func (c *aBCIApplicationClient) SetOption(ctx context.Context, in *types.RequestSetOption, opts ...grpc.CallOption) (*types.ResponseSetOption, error) { + out := new(types.ResponseSetOption) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/SetOption", in, out, opts...) + if err != nil { + return nil, err } - return 0 + return out, nil } -func (m *ResponseCheckTx) GetData() []byte { - if m != nil { - return m.Data +func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *types.RequestDeliverTx, opts ...grpc.CallOption) (*types.ResponseDeliverTx, error) { + out := new(types.ResponseDeliverTx) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/DeliverTx", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *ResponseCheckTx) GetLog() string { - if m != nil { - return m.Log +func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { + out := new(ResponseCheckTx) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/CheckTx", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *ResponseCheckTx) GetInfo() string { - if m != nil { - return m.Info +func (c *aBCIApplicationClient) Query(ctx context.Context, in *types.RequestQuery, opts ...grpc.CallOption) (*types.ResponseQuery, error) { + out := new(types.ResponseQuery) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Query", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *ResponseCheckTx) GetGasWanted() int64 { - if m != nil { - return m.GasWanted +func (c *aBCIApplicationClient) Commit(ctx context.Context, in *types.RequestCommit, opts ...grpc.CallOption) (*types.ResponseCommit, error) { + out := new(types.ResponseCommit) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Commit", in, out, opts...) + if err != nil { + return nil, err } - return 0 + return out, nil } -func (m *ResponseCheckTx) GetGasUsed() int64 { - if m != nil { - return m.GasUsed +func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { + out := new(ResponseInitChain) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/InitChain", in, out, opts...) + if err != nil { + return nil, err } - return 0 + return out, nil } -func (m *ResponseCheckTx) GetEvents() []Event { - if m != nil { - return m.Events +func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*types.ResponseBeginBlock, error) { + out := new(types.ResponseBeginBlock) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/BeginBlock", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *ResponseCheckTx) GetCodespace() string { - if m != nil { - return m.Codespace +func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *types.RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) { + out := new(ResponseEndBlock) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/EndBlock", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *ResponseCheckTx) GetSender() string { - if m != nil { - return m.Sender +func (c *aBCIApplicationClient) ListSnapshots(ctx context.Context, in *types.RequestListSnapshots, opts ...grpc.CallOption) (*types.ResponseListSnapshots, error) { + out := new(types.ResponseListSnapshots) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/ListSnapshots", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *ResponseCheckTx) GetPriority() int64 { - if m != nil { - return m.Priority +func (c *aBCIApplicationClient) OfferSnapshot(ctx context.Context, in *types.RequestOfferSnapshot, opts ...grpc.CallOption) (*types.ResponseOfferSnapshot, error) { + out := new(types.ResponseOfferSnapshot) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/OfferSnapshot", in, out, opts...) + if err != nil { + return nil, err } - return 0 + return out, nil } -func (m *ResponseCheckTx) GetMempoolError() string { - if m != nil { - return m.MempoolError +func (c *aBCIApplicationClient) LoadSnapshotChunk(ctx context.Context, in *types.RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*types.ResponseLoadSnapshotChunk, error) { + out := new(types.ResponseLoadSnapshotChunk) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/LoadSnapshotChunk", in, out, opts...) + if err != nil { + return nil, err } - return "" -} - -type ResponseDeliverTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,proto3" json:"gas_used,omitempty"` - Events []Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` - Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` + return out, nil } -func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } -func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } -func (*ResponseDeliverTx) ProtoMessage() {} -func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{28} -} -func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseDeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseDeliverTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (c *aBCIApplicationClient) ApplySnapshotChunk(ctx context.Context, in *types.RequestApplySnapshotChunk, opts ...grpc.CallOption) (*types.ResponseApplySnapshotChunk, error) { + out := new(types.ResponseApplySnapshotChunk) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/ApplySnapshotChunk", in, out, opts...) + if err != nil { + return nil, err } -} -func (m *ResponseDeliverTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseDeliverTx.Merge(m, src) -} -func (m *ResponseDeliverTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseDeliverTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseDeliverTx.DiscardUnknown(m) + return out, nil } -var xxx_messageInfo_ResponseDeliverTx proto.InternalMessageInfo - -func (m *ResponseDeliverTx) GetCode() uint32 { - if m != nil { - return m.Code +func (c *aBCIApplicationClient) BeginRecheckTx(ctx context.Context, in *RequestBeginRecheckTx, opts ...grpc.CallOption) (*ResponseBeginRecheckTx, error) { + out := new(ResponseBeginRecheckTx) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/BeginRecheckTx", in, out, opts...) + if err != nil { + return nil, err } - return 0 + return out, nil } -func (m *ResponseDeliverTx) GetData() []byte { - if m != nil { - return m.Data +func (c *aBCIApplicationClient) EndRecheckTx(ctx context.Context, in *RequestEndRecheckTx, opts ...grpc.CallOption) (*ResponseEndRecheckTx, error) { + out := new(ResponseEndRecheckTx) + err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/EndRecheckTx", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *ResponseDeliverTx) GetLog() string { - if m != nil { - return m.Log - } - return "" +// ABCIApplicationServer is the server API for ABCIApplication service. +type ABCIApplicationServer interface { + Echo(context.Context, *types.RequestEcho) (*types.ResponseEcho, error) + Flush(context.Context, *types.RequestFlush) (*types.ResponseFlush, error) + Info(context.Context, *types.RequestInfo) (*types.ResponseInfo, error) + SetOption(context.Context, *types.RequestSetOption) (*types.ResponseSetOption, error) + DeliverTx(context.Context, *types.RequestDeliverTx) (*types.ResponseDeliverTx, error) + CheckTx(context.Context, *types.RequestCheckTx) (*ResponseCheckTx, error) + Query(context.Context, *types.RequestQuery) (*types.ResponseQuery, error) + Commit(context.Context, *types.RequestCommit) (*types.ResponseCommit, error) + InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) + BeginBlock(context.Context, *RequestBeginBlock) (*types.ResponseBeginBlock, error) + EndBlock(context.Context, *types.RequestEndBlock) (*ResponseEndBlock, error) + ListSnapshots(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) + OfferSnapshot(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) + LoadSnapshotChunk(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunk(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) + BeginRecheckTx(context.Context, *RequestBeginRecheckTx) (*ResponseBeginRecheckTx, error) + EndRecheckTx(context.Context, *RequestEndRecheckTx) (*ResponseEndRecheckTx, error) } -func (m *ResponseDeliverTx) GetInfo() string { - if m != nil { - return m.Info - } - return "" +// UnimplementedABCIApplicationServer can be embedded to have forward compatible implementations. +type UnimplementedABCIApplicationServer struct { } -func (m *ResponseDeliverTx) GetGasWanted() int64 { - if m != nil { - return m.GasWanted - } - return 0 +func (*UnimplementedABCIApplicationServer) Echo(ctx context.Context, req *types.RequestEcho) (*types.ResponseEcho, error) { + return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") } - -func (m *ResponseDeliverTx) GetGasUsed() int64 { - if m != nil { - return m.GasUsed - } - return 0 +func (*UnimplementedABCIApplicationServer) Flush(ctx context.Context, req *types.RequestFlush) (*types.ResponseFlush, error) { + return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented") } - -func (m *ResponseDeliverTx) GetEvents() []Event { - if m != nil { - return m.Events - } - return nil +func (*UnimplementedABCIApplicationServer) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") } - -func (m *ResponseDeliverTx) GetCodespace() string { - if m != nil { - return m.Codespace - } - return "" +func (*UnimplementedABCIApplicationServer) SetOption(ctx context.Context, req *types.RequestSetOption) (*types.ResponseSetOption, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetOption not implemented") } - -type ResponseEndBlock struct { - ValidatorUpdates []ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates"` - ConsensusParamUpdates *ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` - Events []Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"` +func (*UnimplementedABCIApplicationServer) DeliverTx(ctx context.Context, req *types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeliverTx not implemented") } - -func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } -func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } -func (*ResponseEndBlock) ProtoMessage() {} -func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{29} +func (*UnimplementedABCIApplicationServer) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*ResponseCheckTx, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckTx not implemented") } -func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (*UnimplementedABCIApplicationServer) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") } -func (m *ResponseEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseEndBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (*UnimplementedABCIApplicationServer) Commit(ctx context.Context, req *types.RequestCommit) (*types.ResponseCommit, error) { + return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") } -func (m *ResponseEndBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseEndBlock.Merge(m, src) +func (*UnimplementedABCIApplicationServer) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitChain not implemented") } -func (m *ResponseEndBlock) XXX_Size() int { - return m.Size() +func (*UnimplementedABCIApplicationServer) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*types.ResponseBeginBlock, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginBlock not implemented") } -func (m *ResponseEndBlock) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseEndBlock.DiscardUnknown(m) +func (*UnimplementedABCIApplicationServer) EndBlock(ctx context.Context, req *types.RequestEndBlock) (*ResponseEndBlock, error) { + return nil, status.Errorf(codes.Unimplemented, "method EndBlock not implemented") } - -var xxx_messageInfo_ResponseEndBlock proto.InternalMessageInfo - -func (m *ResponseEndBlock) GetValidatorUpdates() []ValidatorUpdate { - if m != nil { - return m.ValidatorUpdates - } - return nil +func (*UnimplementedABCIApplicationServer) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSnapshots not implemented") } - -func (m *ResponseEndBlock) GetConsensusParamUpdates() *ConsensusParams { - if m != nil { - return m.ConsensusParamUpdates - } - return nil -} - -func (m *ResponseEndBlock) GetEvents() []Event { - if m != nil { - return m.Events - } - return nil -} - -type ResponseCommit struct { - // reserve 1 - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - RetainHeight int64 `protobuf:"varint,3,opt,name=retain_height,json=retainHeight,proto3" json:"retain_height,omitempty"` -} - -func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } -func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } -func (*ResponseCommit) ProtoMessage() {} -func (*ResponseCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{30} -} -func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (*UnimplementedABCIApplicationServer) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { + return nil, status.Errorf(codes.Unimplemented, "method OfferSnapshot not implemented") } -func (m *ResponseCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseCommit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (*UnimplementedABCIApplicationServer) LoadSnapshotChunk(ctx context.Context, req *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoadSnapshotChunk not implemented") } -func (m *ResponseCommit) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseCommit.Merge(m, src) +func (*UnimplementedABCIApplicationServer) ApplySnapshotChunk(ctx context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApplySnapshotChunk not implemented") } -func (m *ResponseCommit) XXX_Size() int { - return m.Size() +func (*UnimplementedABCIApplicationServer) BeginRecheckTx(ctx context.Context, req *RequestBeginRecheckTx) (*ResponseBeginRecheckTx, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginRecheckTx not implemented") } -func (m *ResponseCommit) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseCommit.DiscardUnknown(m) +func (*UnimplementedABCIApplicationServer) EndRecheckTx(ctx context.Context, req *RequestEndRecheckTx) (*ResponseEndRecheckTx, error) { + return nil, status.Errorf(codes.Unimplemented, "method EndRecheckTx not implemented") } -var xxx_messageInfo_ResponseCommit proto.InternalMessageInfo - -func (m *ResponseCommit) GetData() []byte { - if m != nil { - return m.Data - } - return nil +func RegisterABCIApplicationServer(s *grpc.Server, srv ABCIApplicationServer) { + s.RegisterService(&_ABCIApplication_serviceDesc, srv) } -func (m *ResponseCommit) GetRetainHeight() int64 { - if m != nil { - return m.RetainHeight +func _ABCIApplication_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestEcho) + if err := dec(in); err != nil { + return nil, err } - return 0 -} - -type ResponseListSnapshots struct { - Snapshots []*Snapshot `protobuf:"bytes,1,rep,name=snapshots,proto3" json:"snapshots,omitempty"` -} - -func (m *ResponseListSnapshots) Reset() { *m = ResponseListSnapshots{} } -func (m *ResponseListSnapshots) String() string { return proto.CompactTextString(m) } -func (*ResponseListSnapshots) ProtoMessage() {} -func (*ResponseListSnapshots) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{31} -} -func (m *ResponseListSnapshots) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseListSnapshots) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseListSnapshots.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if interceptor == nil { + return srv.(ABCIApplicationServer).Echo(ctx, in) } -} -func (m *ResponseListSnapshots) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseListSnapshots.Merge(m, src) -} -func (m *ResponseListSnapshots) XXX_Size() int { - return m.Size() -} -func (m *ResponseListSnapshots) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseListSnapshots.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseListSnapshots proto.InternalMessageInfo - -func (m *ResponseListSnapshots) GetSnapshots() []*Snapshot { - if m != nil { - return m.Snapshots + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/Echo", } - return nil -} - -type ResponseOfferSnapshot struct { - Result ResponseOfferSnapshot_Result `protobuf:"varint,1,opt,name=result,proto3,enum=ostracon.abci.ResponseOfferSnapshot_Result" json:"result,omitempty"` -} - -func (m *ResponseOfferSnapshot) Reset() { *m = ResponseOfferSnapshot{} } -func (m *ResponseOfferSnapshot) String() string { return proto.CompactTextString(m) } -func (*ResponseOfferSnapshot) ProtoMessage() {} -func (*ResponseOfferSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{32} -} -func (m *ResponseOfferSnapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseOfferSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseOfferSnapshot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).Echo(ctx, req.(*types.RequestEcho)) } -} -func (m *ResponseOfferSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseOfferSnapshot.Merge(m, src) -} -func (m *ResponseOfferSnapshot) XXX_Size() int { - return m.Size() -} -func (m *ResponseOfferSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseOfferSnapshot.DiscardUnknown(m) + return interceptor(ctx, in, info, handler) } -var xxx_messageInfo_ResponseOfferSnapshot proto.InternalMessageInfo - -func (m *ResponseOfferSnapshot) GetResult() ResponseOfferSnapshot_Result { - if m != nil { - return m.Result +func _ABCIApplication_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestFlush) + if err := dec(in); err != nil { + return nil, err } - return ResponseOfferSnapshot_UNKNOWN -} - -type ResponseLoadSnapshotChunk struct { - Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"` -} - -func (m *ResponseLoadSnapshotChunk) Reset() { *m = ResponseLoadSnapshotChunk{} } -func (m *ResponseLoadSnapshotChunk) String() string { return proto.CompactTextString(m) } -func (*ResponseLoadSnapshotChunk) ProtoMessage() {} -func (*ResponseLoadSnapshotChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{33} -} -func (m *ResponseLoadSnapshotChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseLoadSnapshotChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseLoadSnapshotChunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if interceptor == nil { + return srv.(ABCIApplicationServer).Flush(ctx, in) } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/Flush", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).Flush(ctx, req.(*types.RequestFlush)) + } + return interceptor(ctx, in, info, handler) } -func (m *ResponseLoadSnapshotChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseLoadSnapshotChunk.Merge(m, src) -} -func (m *ResponseLoadSnapshotChunk) XXX_Size() int { - return m.Size() -} -func (m *ResponseLoadSnapshotChunk) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseLoadSnapshotChunk.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseLoadSnapshotChunk proto.InternalMessageInfo -func (m *ResponseLoadSnapshotChunk) GetChunk() []byte { - if m != nil { - return m.Chunk +func _ABCIApplication_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestInfo) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(ABCIApplicationServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/Info", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).Info(ctx, req.(*types.RequestInfo)) + } + return interceptor(ctx, in, info, handler) } -type ResponseApplySnapshotChunk struct { - Result ResponseApplySnapshotChunk_Result `protobuf:"varint,1,opt,name=result,proto3,enum=ostracon.abci.ResponseApplySnapshotChunk_Result" json:"result,omitempty"` - RefetchChunks []uint32 `protobuf:"varint,2,rep,packed,name=refetch_chunks,json=refetchChunks,proto3" json:"refetch_chunks,omitempty"` - RejectSenders []string `protobuf:"bytes,3,rep,name=reject_senders,json=rejectSenders,proto3" json:"reject_senders,omitempty"` +func _ABCIApplication_SetOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestSetOption) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIApplicationServer).SetOption(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/SetOption", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).SetOption(ctx, req.(*types.RequestSetOption)) + } + return interceptor(ctx, in, info, handler) } -func (m *ResponseApplySnapshotChunk) Reset() { *m = ResponseApplySnapshotChunk{} } -func (m *ResponseApplySnapshotChunk) String() string { return proto.CompactTextString(m) } -func (*ResponseApplySnapshotChunk) ProtoMessage() {} -func (*ResponseApplySnapshotChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{34} -} -func (m *ResponseApplySnapshotChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseApplySnapshotChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseApplySnapshotChunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func _ABCIApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestDeliverTx) + if err := dec(in); err != nil { + return nil, err } + if interceptor == nil { + return srv.(ABCIApplicationServer).DeliverTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/DeliverTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).DeliverTx(ctx, req.(*types.RequestDeliverTx)) + } + return interceptor(ctx, in, info, handler) } -func (m *ResponseApplySnapshotChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseApplySnapshotChunk.Merge(m, src) -} -func (m *ResponseApplySnapshotChunk) XXX_Size() int { - return m.Size() -} -func (m *ResponseApplySnapshotChunk) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseApplySnapshotChunk.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseApplySnapshotChunk proto.InternalMessageInfo -func (m *ResponseApplySnapshotChunk) GetResult() ResponseApplySnapshotChunk_Result { - if m != nil { - return m.Result +func _ABCIApplication_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestCheckTx) + if err := dec(in); err != nil { + return nil, err } - return ResponseApplySnapshotChunk_UNKNOWN + if interceptor == nil { + return srv.(ABCIApplicationServer).CheckTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/CheckTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).CheckTx(ctx, req.(*types.RequestCheckTx)) + } + return interceptor(ctx, in, info, handler) } -func (m *ResponseApplySnapshotChunk) GetRefetchChunks() []uint32 { - if m != nil { - return m.RefetchChunks +func _ABCIApplication_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestQuery) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(ABCIApplicationServer).Query(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/Query", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).Query(ctx, req.(*types.RequestQuery)) + } + return interceptor(ctx, in, info, handler) } -func (m *ResponseApplySnapshotChunk) GetRejectSenders() []string { - if m != nil { - return m.RejectSenders +func _ABCIApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestCommit) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(ABCIApplicationServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).Commit(ctx, req.(*types.RequestCommit)) + } + return interceptor(ctx, in, info, handler) } -type ResponseBeginRecheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` +func _ABCIApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestInitChain) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIApplicationServer).InitChain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/InitChain", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).InitChain(ctx, req.(*RequestInitChain)) + } + return interceptor(ctx, in, info, handler) } -func (m *ResponseBeginRecheckTx) Reset() { *m = ResponseBeginRecheckTx{} } -func (m *ResponseBeginRecheckTx) String() string { return proto.CompactTextString(m) } -func (*ResponseBeginRecheckTx) ProtoMessage() {} -func (*ResponseBeginRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{35} -} -func (m *ResponseBeginRecheckTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseBeginRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseBeginRecheckTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func _ABCIApplication_BeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestBeginBlock) + if err := dec(in); err != nil { + return nil, err } -} -func (m *ResponseBeginRecheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseBeginRecheckTx.Merge(m, src) -} -func (m *ResponseBeginRecheckTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseBeginRecheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseBeginRecheckTx.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseBeginRecheckTx proto.InternalMessageInfo - -func (m *ResponseBeginRecheckTx) GetCode() uint32 { - if m != nil { - return m.Code + if interceptor == nil { + return srv.(ABCIApplicationServer).BeginBlock(ctx, in) } - return 0 -} - -type ResponseEndRecheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` -} - -func (m *ResponseEndRecheckTx) Reset() { *m = ResponseEndRecheckTx{} } -func (m *ResponseEndRecheckTx) String() string { return proto.CompactTextString(m) } -func (*ResponseEndRecheckTx) ProtoMessage() {} -func (*ResponseEndRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{36} -} -func (m *ResponseEndRecheckTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseEndRecheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseEndRecheckTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/BeginBlock", } -} -func (m *ResponseEndRecheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseEndRecheckTx.Merge(m, src) -} -func (m *ResponseEndRecheckTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseEndRecheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseEndRecheckTx.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseEndRecheckTx proto.InternalMessageInfo - -func (m *ResponseEndRecheckTx) GetCode() uint32 { - if m != nil { - return m.Code + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).BeginBlock(ctx, req.(*RequestBeginBlock)) } - return 0 -} - -// ConsensusParams contains all consensus-relevant parameters -// that can be adjusted by the abci app -type ConsensusParams struct { - Block *BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Evidence *types2.EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *types2.ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` - Version *types2.VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + return interceptor(ctx, in, info, handler) } -func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } -func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } -func (*ConsensusParams) ProtoMessage() {} -func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{37} -} -func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func _ABCIApplication_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestEndBlock) + if err := dec(in); err != nil { + return nil, err } -} -func (m *ConsensusParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusParams.Merge(m, src) -} -func (m *ConsensusParams) XXX_Size() int { - return m.Size() -} -func (m *ConsensusParams) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo - -func (m *ConsensusParams) GetBlock() *BlockParams { - if m != nil { - return m.Block + if interceptor == nil { + return srv.(ABCIApplicationServer).EndBlock(ctx, in) } - return nil -} - -func (m *ConsensusParams) GetEvidence() *types2.EvidenceParams { - if m != nil { - return m.Evidence + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/EndBlock", } - return nil -} - -func (m *ConsensusParams) GetValidator() *types2.ValidatorParams { - if m != nil { - return m.Validator + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).EndBlock(ctx, req.(*types.RequestEndBlock)) } - return nil + return interceptor(ctx, in, info, handler) } -func (m *ConsensusParams) GetVersion() *types2.VersionParams { - if m != nil { - return m.Version +func _ABCIApplication_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestListSnapshots) + if err := dec(in); err != nil { + return nil, err } - return nil -} - -// BlockParams contains limits on the block size. -type BlockParams struct { - // Note: must be greater than 0 - MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - // Note: must be greater or equal to -1 - MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` -} - -func (m *BlockParams) Reset() { *m = BlockParams{} } -func (m *BlockParams) String() string { return proto.CompactTextString(m) } -func (*BlockParams) ProtoMessage() {} -func (*BlockParams) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{38} -} -func (m *BlockParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if interceptor == nil { + return srv.(ABCIApplicationServer).ListSnapshots(ctx, in) } -} -func (m *BlockParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockParams.Merge(m, src) -} -func (m *BlockParams) XXX_Size() int { - return m.Size() -} -func (m *BlockParams) XXX_DiscardUnknown() { - xxx_messageInfo_BlockParams.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockParams proto.InternalMessageInfo - -func (m *BlockParams) GetMaxBytes() int64 { - if m != nil { - return m.MaxBytes + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/ListSnapshots", } - return 0 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).ListSnapshots(ctx, req.(*types.RequestListSnapshots)) + } + return interceptor(ctx, in, info, handler) } -func (m *BlockParams) GetMaxGas() int64 { - if m != nil { - return m.MaxGas +func _ABCIApplication_OfferSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestOfferSnapshot) + if err := dec(in); err != nil { + return nil, err } - return 0 + if interceptor == nil { + return srv.(ABCIApplicationServer).OfferSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/OfferSnapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).OfferSnapshot(ctx, req.(*types.RequestOfferSnapshot)) + } + return interceptor(ctx, in, info, handler) } -type LastCommitInfo struct { - Round int32 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` - Votes []VoteInfo `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes"` +func _ABCIApplication_LoadSnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestLoadSnapshotChunk) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIApplicationServer).LoadSnapshotChunk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/LoadSnapshotChunk", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).LoadSnapshotChunk(ctx, req.(*types.RequestLoadSnapshotChunk)) + } + return interceptor(ctx, in, info, handler) } -func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } -func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } -func (*LastCommitInfo) ProtoMessage() {} -func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{39} -} -func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LastCommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LastCommitInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func _ABCIApplication_ApplySnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.RequestApplySnapshotChunk) + if err := dec(in); err != nil { + return nil, err } -} -func (m *LastCommitInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LastCommitInfo.Merge(m, src) -} -func (m *LastCommitInfo) XXX_Size() int { - return m.Size() -} -func (m *LastCommitInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LastCommitInfo.DiscardUnknown(m) + if interceptor == nil { + return srv.(ABCIApplicationServer).ApplySnapshotChunk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/ApplySnapshotChunk", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).ApplySnapshotChunk(ctx, req.(*types.RequestApplySnapshotChunk)) + } + return interceptor(ctx, in, info, handler) } -var xxx_messageInfo_LastCommitInfo proto.InternalMessageInfo - -func (m *LastCommitInfo) GetRound() int32 { - if m != nil { - return m.Round +func _ABCIApplication_BeginRecheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestBeginRecheckTx) + if err := dec(in); err != nil { + return nil, err } - return 0 + if interceptor == nil { + return srv.(ABCIApplicationServer).BeginRecheckTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/BeginRecheckTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).BeginRecheckTx(ctx, req.(*RequestBeginRecheckTx)) + } + return interceptor(ctx, in, info, handler) } -func (m *LastCommitInfo) GetVotes() []VoteInfo { - if m != nil { - return m.Votes +func _ABCIApplication_EndRecheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestEndRecheckTx) + if err := dec(in); err != nil { + return nil, err } - return nil -} - -// Event allows application developers to attach additional information to -// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. -// Later, transactions may be queried using these events. -type Event struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Attributes []EventAttribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{40} -} -func (m *Event) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + if interceptor == nil { + return srv.(ABCIApplicationServer).EndRecheckTx(ctx, in) } -} -func (m *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(m, src) -} -func (m *Event) XXX_Size() int { - return m.Size() -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ostracon.abci.ABCIApplication/EndRecheckTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).EndRecheckTx(ctx, req.(*RequestEndRecheckTx)) + } + return interceptor(ctx, in, info, handler) } -var xxx_messageInfo_Event proto.InternalMessageInfo - -func (m *Event) GetType() string { - if m != nil { - return m.Type - } - return "" +var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ostracon.abci.ABCIApplication", + HandlerType: (*ABCIApplicationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Echo", + Handler: _ABCIApplication_Echo_Handler, + }, + { + MethodName: "Flush", + Handler: _ABCIApplication_Flush_Handler, + }, + { + MethodName: "Info", + Handler: _ABCIApplication_Info_Handler, + }, + { + MethodName: "SetOption", + Handler: _ABCIApplication_SetOption_Handler, + }, + { + MethodName: "DeliverTx", + Handler: _ABCIApplication_DeliverTx_Handler, + }, + { + MethodName: "CheckTx", + Handler: _ABCIApplication_CheckTx_Handler, + }, + { + MethodName: "Query", + Handler: _ABCIApplication_Query_Handler, + }, + { + MethodName: "Commit", + Handler: _ABCIApplication_Commit_Handler, + }, + { + MethodName: "InitChain", + Handler: _ABCIApplication_InitChain_Handler, + }, + { + MethodName: "BeginBlock", + Handler: _ABCIApplication_BeginBlock_Handler, + }, + { + MethodName: "EndBlock", + Handler: _ABCIApplication_EndBlock_Handler, + }, + { + MethodName: "ListSnapshots", + Handler: _ABCIApplication_ListSnapshots_Handler, + }, + { + MethodName: "OfferSnapshot", + Handler: _ABCIApplication_OfferSnapshot_Handler, + }, + { + MethodName: "LoadSnapshotChunk", + Handler: _ABCIApplication_LoadSnapshotChunk_Handler, + }, + { + MethodName: "ApplySnapshotChunk", + Handler: _ABCIApplication_ApplySnapshotChunk_Handler, + }, + { + MethodName: "BeginRecheckTx", + Handler: _ABCIApplication_BeginRecheckTx_Handler, + }, + { + MethodName: "EndRecheckTx", + Handler: _ABCIApplication_EndRecheckTx_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ostracon/abci/types.proto", } -func (m *Event) GetAttributes() []EventAttribute { - if m != nil { - return m.Attributes +func (m *Request) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -// EventAttribute is a single key-value pair, associated with an event. -type EventAttribute struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Index bool `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` +func (m *Request) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EventAttribute) Reset() { *m = EventAttribute{} } -func (m *EventAttribute) String() string { return proto.CompactTextString(m) } -func (*EventAttribute) ProtoMessage() {} -func (*EventAttribute) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{41} -} -func (m *EventAttribute) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventAttribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventAttribute.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - return b[:n], nil } + return len(dAtA) - i, nil } -func (m *EventAttribute) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventAttribute.Merge(m, src) -} -func (m *EventAttribute) XXX_Size() int { - return m.Size() -} -func (m *EventAttribute) XXX_DiscardUnknown() { - xxx_messageInfo_EventAttribute.DiscardUnknown(m) -} - -var xxx_messageInfo_EventAttribute proto.InternalMessageInfo -func (m *EventAttribute) GetKey() []byte { - if m != nil { - return m.Key - } - return nil +func (m *Request_Echo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EventAttribute) GetValue() []byte { - if m != nil { - return m.Value +func (m *Request_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Echo != nil { + { + size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return nil + return len(dAtA) - i, nil +} +func (m *Request_Flush) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EventAttribute) GetIndex() bool { - if m != nil { - return m.Index +func (m *Request_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Flush != nil { + { + size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return false + return len(dAtA) - i, nil } - -// TxResult contains results of executing the transaction. -// -// One usage is indexing transaction results. -type TxResult struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - Tx []byte `protobuf:"bytes,3,opt,name=tx,proto3" json:"tx,omitempty"` - Result ResponseDeliverTx `protobuf:"bytes,4,opt,name=result,proto3" json:"result"` +func (m *Request_Info) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TxResult) Reset() { *m = TxResult{} } -func (m *TxResult) String() string { return proto.CompactTextString(m) } -func (*TxResult) ProtoMessage() {} -func (*TxResult) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{42} -} -func (m *TxResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxResult.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *Request_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Info != nil { + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x1a } + return len(dAtA) - i, nil } -func (m *TxResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxResult.Merge(m, src) -} -func (m *TxResult) XXX_Size() int { - return m.Size() -} -func (m *TxResult) XXX_DiscardUnknown() { - xxx_messageInfo_TxResult.DiscardUnknown(m) +func (m *Request_SetOption) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -var xxx_messageInfo_TxResult proto.InternalMessageInfo - -func (m *TxResult) GetHeight() int64 { - if m != nil { - return m.Height +func (m *Request_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SetOption != nil { + { + size, err := m.SetOption.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - return 0 + return len(dAtA) - i, nil } - -func (m *TxResult) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 +func (m *Request_InitChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TxResult) GetTx() []byte { - if m != nil { - return m.Tx +func (m *Request_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.InitChain != nil { + { + size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - return nil + return len(dAtA) - i, nil +} +func (m *Request_Query) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TxResult) GetResult() ResponseDeliverTx { - if m != nil { - return m.Result +func (m *Request_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Query != nil { + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } - return ResponseDeliverTx{} + return len(dAtA) - i, nil } - -// Validator -type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` +func (m *Request_BeginBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Validator) Reset() { *m = Validator{} } -func (m *Validator) String() string { return proto.CompactTextString(m) } -func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{43} -} -func (m *Validator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Validator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *Request_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BeginBlock != nil { + { + size, err := m.BeginBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x3a } + return len(dAtA) - i, nil } -func (m *Validator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Validator.Merge(m, src) -} -func (m *Validator) XXX_Size() int { - return m.Size() -} -func (m *Validator) XXX_DiscardUnknown() { - xxx_messageInfo_Validator.DiscardUnknown(m) +func (m *Request_CheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -var xxx_messageInfo_Validator proto.InternalMessageInfo - -func (m *Validator) GetAddress() []byte { - if m != nil { - return m.Address +func (m *Request_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CheckTx != nil { + { + size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 } - return nil + return len(dAtA) - i, nil +} +func (m *Request_DeliverTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Validator) GetPower() int64 { - if m != nil { - return m.Power +func (m *Request_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DeliverTx != nil { + { + size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a } - return 0 + return len(dAtA) - i, nil } - -// ValidatorUpdate -type ValidatorUpdate struct { - PubKey crypto1.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` +func (m *Request_EndBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } -func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } -func (*ValidatorUpdate) ProtoMessage() {} -func (*ValidatorUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{44} +func (m *Request_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.EndBlock != nil { + { + size, err := m.EndBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + return len(dAtA) - i, nil } -func (m *ValidatorUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *Request_Commit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ValidatorUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (m *Request_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x5a } + return len(dAtA) - i, nil } -func (m *ValidatorUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorUpdate.Merge(m, src) +func (m *Request_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ValidatorUpdate) XXX_Size() int { - return m.Size() + +func (m *Request_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ListSnapshots != nil { + { + size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + return len(dAtA) - i, nil } -func (m *ValidatorUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorUpdate.DiscardUnknown(m) +func (m *Request_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -var xxx_messageInfo_ValidatorUpdate proto.InternalMessageInfo - -func (m *ValidatorUpdate) GetPubKey() crypto1.PublicKey { - if m != nil { - return m.PubKey +func (m *Request_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.OfferSnapshot != nil { + { + size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a } - return crypto1.PublicKey{} + return len(dAtA) - i, nil +} +func (m *Request_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ValidatorUpdate) GetPower() int64 { - if m != nil { - return m.Power +func (m *Request_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.LoadSnapshotChunk != nil { + { + size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 } - return 0 + return len(dAtA) - i, nil } - -// VoteInfo -type VoteInfo struct { - Validator Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` - SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` +func (m *Request_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *VoteInfo) Reset() { *m = VoteInfo{} } -func (m *VoteInfo) String() string { return proto.CompactTextString(m) } -func (*VoteInfo) ProtoMessage() {} -func (*VoteInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{45} -} -func (m *VoteInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VoteInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *Request_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ApplySnapshotChunk != nil { + { + size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x7a } + return len(dAtA) - i, nil } -func (m *VoteInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteInfo.Merge(m, src) -} -func (m *VoteInfo) XXX_Size() int { - return m.Size() -} -func (m *VoteInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VoteInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_VoteInfo proto.InternalMessageInfo - -func (m *VoteInfo) GetValidator() Validator { - if m != nil { - return m.Validator - } - return Validator{} +func (m *Request_BeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *VoteInfo) GetSignedLastBlock() bool { - if m != nil { - return m.SignedLastBlock +func (m *Request_BeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BeginRecheckTx != nil { + { + size, err := m.BeginRecheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xc2 } - return false + return len(dAtA) - i, nil } - -type Evidence struct { - Type EvidenceType `protobuf:"varint,1,opt,name=type,proto3,enum=ostracon.abci.EvidenceType" json:"type,omitempty"` - // The offending validator - Validator Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator"` - // The height when the offense occurred - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - // The corresponding time where the offense occurred - Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` - // Total voting power of the validator set in case the ABCI application does - // not store historical validators. - // https://github.com/tendermint/tendermint/issues/4581 - TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` +func (m *Request_EndRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Evidence) Reset() { *m = Evidence{} } -func (m *Evidence) String() string { return proto.CompactTextString(m) } -func (*Evidence) ProtoMessage() {} -func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{46} -} -func (m *Evidence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Evidence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *Request_EndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.EndRecheckTx != nil { + { + size, err := m.EndRecheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xca } + return len(dAtA) - i, nil } -func (m *Evidence) XXX_Merge(src proto.Message) { - xxx_messageInfo_Evidence.Merge(m, src) -} -func (m *Evidence) XXX_Size() int { - return m.Size() -} -func (m *Evidence) XXX_DiscardUnknown() { - xxx_messageInfo_Evidence.DiscardUnknown(m) -} - -var xxx_messageInfo_Evidence proto.InternalMessageInfo - -func (m *Evidence) GetType() EvidenceType { - if m != nil { - return m.Type +func (m *RequestInitChain) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return EvidenceType_UNKNOWN + return dAtA[:n], nil } -func (m *Evidence) GetValidator() Validator { - if m != nil { - return m.Validator - } - return Validator{} +func (m *RequestInitChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Evidence) GetHeight() int64 { - if m != nil { - return m.Height +func (m *RequestInitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.InitialHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.InitialHeight)) + i-- + dAtA[i] = 0x30 } - return 0 -} - -func (m *Evidence) GetTime() time.Time { - if m != nil { - return m.Time + if len(m.AppStateBytes) > 0 { + i -= len(m.AppStateBytes) + copy(dAtA[i:], m.AppStateBytes) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AppStateBytes))) + i-- + dAtA[i] = 0x2a } - return time.Time{} -} - -func (m *Evidence) GetTotalVotingPower() int64 { - if m != nil { - return m.TotalVotingPower + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } - return 0 -} - -type Snapshot struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *Snapshot) Reset() { *m = Snapshot{} } -func (m *Snapshot) String() string { return proto.CompactTextString(m) } -func (*Snapshot) ProtoMessage() {} -func (*Snapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{47} -} -func (m *Snapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + if m.ConsensusParams != nil { + { + size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return b[:n], nil + i-- + dAtA[i] = 0x1a } -} -func (m *Snapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_Snapshot.Merge(m, src) -} -func (m *Snapshot) XXX_Size() int { - return m.Size() -} -func (m *Snapshot) XXX_DiscardUnknown() { - xxx_messageInfo_Snapshot.DiscardUnknown(m) -} - -var xxx_messageInfo_Snapshot proto.InternalMessageInfo - -func (m *Snapshot) GetHeight() uint64 { - if m != nil { - return m.Height + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 } - return 0 + n19, err19 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err19 != nil { + return 0, err19 + } + i -= n19 + i = encodeVarintTypes(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *Snapshot) GetFormat() uint32 { - if m != nil { - return m.Format +func (m *RequestBeginBlock) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return 0 + return dAtA[:n], nil } -func (m *Snapshot) GetChunks() uint32 { - if m != nil { - return m.Chunks - } - return 0 +func (m *RequestBeginBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Snapshot) GetHash() []byte { - if m != nil { - return m.Hash +func (m *RequestBeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ByzantineValidators) > 0 { + for iNdEx := len(m.ByzantineValidators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ByzantineValidators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } - return nil -} - -func (m *Snapshot) GetMetadata() []byte { - if m != nil { - return m.Metadata + { + size, err := m.LastCommitInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return nil -} - -func init() { - proto.RegisterEnum("ostracon.abci.CheckTxType", CheckTxType_name, CheckTxType_value) - proto.RegisterEnum("ostracon.abci.EvidenceType", EvidenceType_name, EvidenceType_value) - proto.RegisterEnum("ostracon.abci.ResponseOfferSnapshot_Result", ResponseOfferSnapshot_Result_name, ResponseOfferSnapshot_Result_value) - proto.RegisterEnum("ostracon.abci.ResponseApplySnapshotChunk_Result", ResponseApplySnapshotChunk_Result_name, ResponseApplySnapshotChunk_Result_value) - proto.RegisterType((*Request)(nil), "ostracon.abci.Request") - proto.RegisterType((*RequestEcho)(nil), "ostracon.abci.RequestEcho") - proto.RegisterType((*RequestFlush)(nil), "ostracon.abci.RequestFlush") - proto.RegisterType((*RequestInfo)(nil), "ostracon.abci.RequestInfo") - proto.RegisterType((*RequestSetOption)(nil), "ostracon.abci.RequestSetOption") - proto.RegisterType((*RequestInitChain)(nil), "ostracon.abci.RequestInitChain") - proto.RegisterType((*RequestQuery)(nil), "ostracon.abci.RequestQuery") - proto.RegisterType((*RequestBeginBlock)(nil), "ostracon.abci.RequestBeginBlock") - proto.RegisterType((*RequestCheckTx)(nil), "ostracon.abci.RequestCheckTx") - proto.RegisterType((*RequestDeliverTx)(nil), "ostracon.abci.RequestDeliverTx") - proto.RegisterType((*RequestEndBlock)(nil), "ostracon.abci.RequestEndBlock") - proto.RegisterType((*RequestCommit)(nil), "ostracon.abci.RequestCommit") - proto.RegisterType((*RequestListSnapshots)(nil), "ostracon.abci.RequestListSnapshots") - proto.RegisterType((*RequestOfferSnapshot)(nil), "ostracon.abci.RequestOfferSnapshot") - proto.RegisterType((*RequestLoadSnapshotChunk)(nil), "ostracon.abci.RequestLoadSnapshotChunk") - proto.RegisterType((*RequestApplySnapshotChunk)(nil), "ostracon.abci.RequestApplySnapshotChunk") - proto.RegisterType((*RequestBeginRecheckTx)(nil), "ostracon.abci.RequestBeginRecheckTx") - proto.RegisterType((*RequestEndRecheckTx)(nil), "ostracon.abci.RequestEndRecheckTx") - proto.RegisterType((*Response)(nil), "ostracon.abci.Response") - proto.RegisterType((*ResponseException)(nil), "ostracon.abci.ResponseException") - proto.RegisterType((*ResponseEcho)(nil), "ostracon.abci.ResponseEcho") - proto.RegisterType((*ResponseFlush)(nil), "ostracon.abci.ResponseFlush") - proto.RegisterType((*ResponseInfo)(nil), "ostracon.abci.ResponseInfo") - proto.RegisterType((*ResponseSetOption)(nil), "ostracon.abci.ResponseSetOption") - proto.RegisterType((*ResponseInitChain)(nil), "ostracon.abci.ResponseInitChain") - proto.RegisterType((*ResponseQuery)(nil), "ostracon.abci.ResponseQuery") - proto.RegisterType((*ResponseBeginBlock)(nil), "ostracon.abci.ResponseBeginBlock") - proto.RegisterType((*ResponseCheckTx)(nil), "ostracon.abci.ResponseCheckTx") - proto.RegisterType((*ResponseDeliverTx)(nil), "ostracon.abci.ResponseDeliverTx") - proto.RegisterType((*ResponseEndBlock)(nil), "ostracon.abci.ResponseEndBlock") - proto.RegisterType((*ResponseCommit)(nil), "ostracon.abci.ResponseCommit") - proto.RegisterType((*ResponseListSnapshots)(nil), "ostracon.abci.ResponseListSnapshots") - proto.RegisterType((*ResponseOfferSnapshot)(nil), "ostracon.abci.ResponseOfferSnapshot") - proto.RegisterType((*ResponseLoadSnapshotChunk)(nil), "ostracon.abci.ResponseLoadSnapshotChunk") - proto.RegisterType((*ResponseApplySnapshotChunk)(nil), "ostracon.abci.ResponseApplySnapshotChunk") - proto.RegisterType((*ResponseBeginRecheckTx)(nil), "ostracon.abci.ResponseBeginRecheckTx") - proto.RegisterType((*ResponseEndRecheckTx)(nil), "ostracon.abci.ResponseEndRecheckTx") - proto.RegisterType((*ConsensusParams)(nil), "ostracon.abci.ConsensusParams") - proto.RegisterType((*BlockParams)(nil), "ostracon.abci.BlockParams") - proto.RegisterType((*LastCommitInfo)(nil), "ostracon.abci.LastCommitInfo") - proto.RegisterType((*Event)(nil), "ostracon.abci.Event") - proto.RegisterType((*EventAttribute)(nil), "ostracon.abci.EventAttribute") - proto.RegisterType((*TxResult)(nil), "ostracon.abci.TxResult") - proto.RegisterType((*Validator)(nil), "ostracon.abci.Validator") - proto.RegisterType((*ValidatorUpdate)(nil), "ostracon.abci.ValidatorUpdate") - proto.RegisterType((*VoteInfo)(nil), "ostracon.abci.VoteInfo") - proto.RegisterType((*Evidence)(nil), "ostracon.abci.Evidence") - proto.RegisterType((*Snapshot)(nil), "ostracon.abci.Snapshot") -} - -func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_addf585b2317eb36) } - -var fileDescriptor_addf585b2317eb36 = []byte{ - // 2925 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0x4b, 0x73, 0xe3, 0xc6, - 0x11, 0xe6, 0x9b, 0x44, 0x4b, 0xa4, 0xa8, 0x59, 0x79, 0x97, 0x86, 0x6d, 0x69, 0x8d, 0x8d, 0x63, - 0x7b, 0x63, 0x4b, 0xf6, 0xae, 0x93, 0xf8, 0x6d, 0x53, 0x5c, 0xda, 0x54, 0xa4, 0x95, 0xb4, 0x10, - 0xbd, 0x2e, 0xbf, 0x02, 0x83, 0xe4, 0x88, 0x44, 0x96, 0x04, 0x60, 0x60, 0x28, 0x4b, 0x39, 0x26, - 0x95, 0xaa, 0x94, 0x4f, 0xae, 0x4a, 0x55, 0x6e, 0xfe, 0x1f, 0x39, 0xa4, 0x2a, 0xc7, 0xf8, 0xe8, - 0x63, 0x2a, 0x07, 0x27, 0x65, 0x1f, 0xf2, 0xf8, 0x03, 0xa9, 0x1c, 0xf2, 0xa8, 0x79, 0xe0, 0x45, - 0x02, 0x20, 0xd7, 0xce, 0x2d, 0x37, 0x4c, 0xa3, 0xbb, 0x07, 0x33, 0xe8, 0xf9, 0xfa, 0xeb, 0x06, - 0xe0, 0x41, 0xcb, 0x25, 0x8e, 0xde, 0xb7, 0xcc, 0x1d, 0xbd, 0xd7, 0x37, 0x76, 0xc8, 0x85, 0x8d, - 0xdd, 0x6d, 0xdb, 0xb1, 0x88, 0x85, 0xaa, 0xde, 0xad, 0x6d, 0x7a, 0x4b, 0x7e, 0x84, 0x60, 0x73, - 0x80, 0x9d, 0x89, 0x61, 0x92, 0x9d, 0xbe, 0x73, 0x61, 0x13, 0x6b, 0xc7, 0x76, 0x2c, 0xeb, 0x94, - 0x6b, 0x47, 0x6e, 0x33, 0x2f, 0x3b, 0xb6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x2f, 0xa1, 0xf7, 0x96, 0x0d, 0xbf, 0x37, 0x65, 0x0d, 0xaa, 0x91, 0x74, 0xa2, - 0x5c, 0x86, 0x8d, 0xb8, 0xfc, 0xa0, 0x9c, 0xfa, 0xf2, 0x08, 0xd2, 0xa3, 0x9b, 0x50, 0xf1, 0x13, - 0x04, 0x3f, 0x81, 0xb3, 0xfb, 0xe4, 0xa9, 0xaa, 0xbe, 0x22, 0x3d, 0x78, 0x34, 0x98, 0x59, 0x14, - 0xe4, 0xd8, 0x63, 0x97, 0x75, 0xdb, 0xee, 0xe8, 0xee, 0x48, 0xf9, 0x10, 0x1a, 0x49, 0xf0, 0x3f, - 0xb3, 0x88, 0x82, 0x1f, 0x7c, 0x97, 0xa1, 0x74, 0x6a, 0x39, 0x13, 0x9d, 0x30, 0x67, 0x55, 0x55, - 0x8c, 0x68, 0x50, 0xf2, 0x54, 0x90, 0x67, 0x62, 0x3e, 0x50, 0x34, 0x78, 0x30, 0x31, 0x09, 0x50, - 0x13, 0xc3, 0x1c, 0x60, 0xbe, 0x9b, 0x55, 0x95, 0x0f, 0x02, 0x47, 0xfc, 0x61, 0xf9, 0x80, 0x4e, - 0xeb, 0x32, 0x5e, 0xca, 0xfc, 0x4b, 0xaa, 0x18, 0x29, 0xb7, 0xe1, 0x81, 0xd8, 0x54, 0x10, 0x0a, - 0xf2, 0xec, 0xf2, 0x41, 0xae, 0x3c, 0x0d, 0x97, 0x62, 0x12, 0x41, 0xe2, 0x1b, 0xfd, 0x8b, 0x04, - 0x15, 0x15, 0xbb, 0x36, 0x45, 0x21, 0xf4, 0x3a, 0x48, 0xf8, 0xbc, 0x8f, 0x39, 0x09, 0xcc, 0x26, - 0x50, 0x29, 0xae, 0xdb, 0xf6, 0xf4, 0x28, 0x97, 0xf1, 0x8d, 0xd0, 0xb3, 0x82, 0xe0, 0x26, 0xb1, - 0x55, 0x61, 0x1c, 0x66, 0xb8, 0xcf, 0x79, 0x0c, 0x37, 0x9f, 0x40, 0x5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64, 0xbb, 0x6a, 0xc5, 0x16, 0x57, 0xa1, - 0xbc, 0x2f, 0x45, 0x18, 0xf8, 0xc3, 0x20, 0xd1, 0xa7, 0x77, 0x6d, 0xbd, 0x8f, 0x19, 0x98, 0x4b, - 0x6a, 0x20, 0x50, 0xde, 0x07, 0x34, 0x9f, 0x4c, 0xd0, 0x1b, 0x50, 0xc2, 0x67, 0xd8, 0x24, 0xf4, - 0x8d, 0xd1, 0xcd, 0xde, 0x98, 0xa3, 0xb8, 0xd8, 0x24, 0xbb, 0x0d, 0xba, 0xc5, 0x7f, 0xff, 0x72, - 0xab, 0xce, 0x75, 0x9f, 0xb2, 0x26, 0x06, 0xc1, 0x13, 0x9b, 0x5c, 0xa8, 0xc2, 0x5a, 0xf9, 0x63, - 0x8e, 0x32, 0xce, 0x48, 0xa2, 0x89, 0xdd, 0x59, 0xef, 0xe8, 0xe4, 0x42, 0x55, 0xc6, 0x72, 0xbb, - 0xbd, 0x09, 0x30, 0xd4, 0x5d, 0xed, 0x63, 0xdd, 0x24, 0x78, 0x20, 0xb6, 0x3c, 0x24, 0x41, 0x32, - 0x54, 0xe8, 0x68, 0xea, 0xe2, 0x81, 0x28, 0x78, 0xfc, 0x71, 0x68, 0x95, 0xe5, 0x6f, 0xb3, 0xca, - 0xe8, 0x0e, 0x57, 0x66, 0x76, 0x38, 0xc4, 0x06, 0xa5, 0x30, 0x1b, 0xa4, 0x4f, 0x66, 0x3b, 0x86, - 0xe5, 0x18, 0xe4, 0x82, 0xbd, 0x96, 0xbc, 0xea, 0x8f, 0x69, 0x45, 0x3d, 0xc1, 0x13, 0xdb, 0xb2, - 0xc6, 0x1a, 0x07, 0xad, 0x15, 0x66, 0xba, 0x2a, 0x84, 0x6d, 0x86, 0x5d, 0x3f, 0xcf, 0x05, 0xc7, - 0x2e, 0xe0, 0xfc, 0xff, 0x67, 0xdb, 0xab, 0xfc, 0x82, 0x95, 0xfe, 0x51, 0x2a, 0x81, 0xee, 0xc0, - 0xba, 0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0x64, 0x67, 0x6c, 0x98, 0x78, 0x27, 0xe6, 0x9f, 0xb0, 0x5e, 0x89, 0x25, 0xc7, 0x9b, 0xff, - 0x0d, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xd8, 0x1d, 0xa3, 0x31, 0x26, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ABCIApplicationClient is the client API for ABCIApplication service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ABCIApplicationClient interface { - Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) - Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) - Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) - SetOption(ctx context.Context, in *RequestSetOption, opts ...grpc.CallOption) (*ResponseSetOption, error) - DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) - CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) - Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) - Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) - InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) - BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) - EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) - ListSnapshots(ctx context.Context, in *RequestListSnapshots, opts ...grpc.CallOption) (*ResponseListSnapshots, error) - OfferSnapshot(ctx context.Context, in *RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error) - LoadSnapshotChunk(ctx context.Context, in *RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*ResponseLoadSnapshotChunk, error) - ApplySnapshotChunk(ctx context.Context, in *RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error) - BeginRecheckTx(ctx context.Context, in *RequestBeginRecheckTx, opts ...grpc.CallOption) (*ResponseBeginRecheckTx, error) - EndRecheckTx(ctx context.Context, in *RequestEndRecheckTx, opts ...grpc.CallOption) (*ResponseEndRecheckTx, error) -} - -type aBCIApplicationClient struct { - cc *grpc.ClientConn -} - -func NewABCIApplicationClient(cc *grpc.ClientConn) ABCIApplicationClient { - return &aBCIApplicationClient{cc} -} - -func (c *aBCIApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) { - out := new(ResponseEcho) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Echo", in, out, opts...) - if err != nil { - return nil, err + i-- + dAtA[i] = 0x1a + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return out, nil + i-- + dAtA[i] = 0x12 + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (c *aBCIApplicationClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) { - out := new(ResponseFlush) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Flush", in, out, opts...) +func (m *RequestBeginRecheckTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *aBCIApplicationClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) { - out := new(ResponseInfo) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *RequestBeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *aBCIApplicationClient) SetOption(ctx context.Context, in *RequestSetOption, opts ...grpc.CallOption) (*ResponseSetOption, error) { - out := new(ResponseSetOption) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/SetOption", in, out, opts...) - if err != nil { - return nil, err +func (m *RequestBeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return out, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) { - out := new(ResponseDeliverTx) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/DeliverTx", in, out, opts...) +func (m *RequestEndRecheckTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { - out := new(ResponseCheckTx) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/CheckTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *RequestEndRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) { - out := new(ResponseQuery) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Query", in, out, opts...) - if err != nil { - return nil, err +func (m *RequestEndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 } - return out, nil + return len(dAtA) - i, nil } -func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { - out := new(ResponseCommit) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/Commit", in, out, opts...) +func (m *Response) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { - out := new(ResponseInitChain) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/InitChain", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *Response) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) { - out := new(ResponseBeginBlock) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/BeginBlock", in, out, opts...) - if err != nil { - return nil, err +func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return out, nil + return len(dAtA) - i, nil } -func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) { - out := new(ResponseEndBlock) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/EndBlock", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *Response_Exception) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *aBCIApplicationClient) ListSnapshots(ctx context.Context, in *RequestListSnapshots, opts ...grpc.CallOption) (*ResponseListSnapshots, error) { - out := new(ResponseListSnapshots) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/ListSnapshots", in, out, opts...) - if err != nil { - return nil, err +func (m *Response_Exception) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Exception != nil { + { + size, err := m.Exception.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return out, nil + return len(dAtA) - i, nil +} +func (m *Response_Echo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *aBCIApplicationClient) OfferSnapshot(ctx context.Context, in *RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error) { - out := new(ResponseOfferSnapshot) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/OfferSnapshot", in, out, opts...) - if err != nil { - return nil, err +func (m *Response_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Echo != nil { + { + size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return out, nil + return len(dAtA) - i, nil +} +func (m *Response_Flush) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *aBCIApplicationClient) LoadSnapshotChunk(ctx context.Context, in *RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*ResponseLoadSnapshotChunk, error) { - out := new(ResponseLoadSnapshotChunk) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/LoadSnapshotChunk", in, out, opts...) - if err != nil { - return nil, err +func (m *Response_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Flush != nil { + { + size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - return out, nil + return len(dAtA) - i, nil } - -func (c *aBCIApplicationClient) ApplySnapshotChunk(ctx context.Context, in *RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error) { - out := new(ResponseApplySnapshotChunk) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/ApplySnapshotChunk", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *Response_Info) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *aBCIApplicationClient) BeginRecheckTx(ctx context.Context, in *RequestBeginRecheckTx, opts ...grpc.CallOption) (*ResponseBeginRecheckTx, error) { - out := new(ResponseBeginRecheckTx) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/BeginRecheckTx", in, out, opts...) - if err != nil { - return nil, err +func (m *Response_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Info != nil { + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - return out, nil + return len(dAtA) - i, nil } - -func (c *aBCIApplicationClient) EndRecheckTx(ctx context.Context, in *RequestEndRecheckTx, opts ...grpc.CallOption) (*ResponseEndRecheckTx, error) { - out := new(ResponseEndRecheckTx) - err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/EndRecheckTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *Response_SetOption) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -// ABCIApplicationServer is the server API for ABCIApplication service. -type ABCIApplicationServer interface { - Echo(context.Context, *RequestEcho) (*ResponseEcho, error) - Flush(context.Context, *RequestFlush) (*ResponseFlush, error) - Info(context.Context, *RequestInfo) (*ResponseInfo, error) - SetOption(context.Context, *RequestSetOption) (*ResponseSetOption, error) - DeliverTx(context.Context, *RequestDeliverTx) (*ResponseDeliverTx, error) - CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) - Query(context.Context, *RequestQuery) (*ResponseQuery, error) - Commit(context.Context, *RequestCommit) (*ResponseCommit, error) - InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) - BeginBlock(context.Context, *RequestBeginBlock) (*ResponseBeginBlock, error) - EndBlock(context.Context, *RequestEndBlock) (*ResponseEndBlock, error) - ListSnapshots(context.Context, *RequestListSnapshots) (*ResponseListSnapshots, error) - OfferSnapshot(context.Context, *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) - LoadSnapshotChunk(context.Context, *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) - ApplySnapshotChunk(context.Context, *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) - BeginRecheckTx(context.Context, *RequestBeginRecheckTx) (*ResponseBeginRecheckTx, error) - EndRecheckTx(context.Context, *RequestEndRecheckTx) (*ResponseEndRecheckTx, error) +func (m *Response_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SetOption != nil { + { + size, err := m.SetOption.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil } - -// UnimplementedABCIApplicationServer can be embedded to have forward compatible implementations. -type UnimplementedABCIApplicationServer struct { +func (m *Response_InitChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) Echo(ctx context.Context, req *RequestEcho) (*ResponseEcho, error) { - return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") -} -func (*UnimplementedABCIApplicationServer) Flush(ctx context.Context, req *RequestFlush) (*ResponseFlush, error) { - return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented") +func (m *Response_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.InitChain != nil { + { + size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +func (m *Response_Query) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) SetOption(ctx context.Context, req *RequestSetOption) (*ResponseSetOption, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetOption not implemented") + +func (m *Response_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Query != nil { + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) DeliverTx(ctx context.Context, req *RequestDeliverTx) (*ResponseDeliverTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeliverTx not implemented") +func (m *Response_BeginBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckTx not implemented") + +func (m *Response_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BeginBlock != nil { + { + size, err := m.BeginBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) { - return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +func (m *Response_CheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) Commit(ctx context.Context, req *RequestCommit) (*ResponseCommit, error) { - return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") + +func (m *Response_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CheckTx != nil { + { + size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitChain not implemented") +func (m *Response_DeliverTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeginBlock not implemented") + +func (m *Response_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DeliverTx != nil { + { + size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) { - return nil, status.Errorf(codes.Unimplemented, "method EndBlock not implemented") +func (m *Response_EndBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) ListSnapshots(ctx context.Context, req *RequestListSnapshots) (*ResponseListSnapshots, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSnapshots not implemented") + +func (m *Response_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.EndBlock != nil { + { + size, err := m.EndBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) OfferSnapshot(ctx context.Context, req *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) { - return nil, status.Errorf(codes.Unimplemented, "method OfferSnapshot not implemented") +func (m *Response_Commit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) LoadSnapshotChunk(ctx context.Context, req *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) { - return nil, status.Errorf(codes.Unimplemented, "method LoadSnapshotChunk not implemented") + +func (m *Response_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) ApplySnapshotChunk(ctx context.Context, req *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) { - return nil, status.Errorf(codes.Unimplemented, "method ApplySnapshotChunk not implemented") +func (m *Response_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (*UnimplementedABCIApplicationServer) BeginRecheckTx(ctx context.Context, req *RequestBeginRecheckTx) (*ResponseBeginRecheckTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeginRecheckTx not implemented") + +func (m *Response_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ListSnapshots != nil { + { + size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + return len(dAtA) - i, nil } -func (*UnimplementedABCIApplicationServer) EndRecheckTx(ctx context.Context, req *RequestEndRecheckTx) (*ResponseEndRecheckTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method EndRecheckTx not implemented") +func (m *Response_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func RegisterABCIApplicationServer(s *grpc.Server, srv ABCIApplicationServer) { - s.RegisterService(&_ABCIApplication_serviceDesc, srv) +func (m *Response_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.OfferSnapshot != nil { + { + size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *Response_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _ABCIApplication_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestEcho) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).Echo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/Echo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).Echo(ctx, req.(*RequestEcho)) +func (m *Response_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.LoadSnapshotChunk != nil { + { + size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil +} +func (m *Response_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _ABCIApplication_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestFlush) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).Flush(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/Flush", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).Flush(ctx, req.(*RequestFlush)) +func (m *Response_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ApplySnapshotChunk != nil { + { + size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil +} +func (m *Response_BeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _ABCIApplication_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestInfo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/Info", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).Info(ctx, req.(*RequestInfo)) +func (m *Response_BeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BeginRecheckTx != nil { + { + size, err := m.BeginRecheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xc2 } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil +} +func (m *Response_EndRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _ABCIApplication_SetOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestSetOption) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).SetOption(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/SetOption", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).SetOption(ctx, req.(*RequestSetOption)) +func (m *Response_EndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.EndRecheckTx != nil { + { + size, err := m.EndRecheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xca } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } - -func _ABCIApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestDeliverTx) - if err := dec(in); err != nil { +func (m *ResponseInitChain) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(ABCIApplicationServer).DeliverTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/DeliverTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).DeliverTx(ctx, req.(*RequestDeliverTx)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _ABCIApplication_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestCheckTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).CheckTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/CheckTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).CheckTx(ctx, req.(*RequestCheckTx)) - } - return interceptor(ctx, in, info, handler) +func (m *ResponseInitChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _ABCIApplication_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestQuery) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).Query(ctx, in) +func (m *ResponseInitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x1a } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/Query", + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).Query(ctx, req.(*RequestQuery)) + if m.ConsensusParams != nil { + { + size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _ABCIApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestCommit) - if err := dec(in); err != nil { +func (m *ResponseCheckTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(ABCIApplicationServer).Commit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/Commit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).Commit(ctx, req.(*RequestCommit)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _ABCIApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestInitChain) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).InitChain(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/InitChain", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).InitChain(ctx, req.(*RequestInitChain)) - } - return interceptor(ctx, in, info, handler) +func (m *ResponseCheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _ABCIApplication_BeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestBeginBlock) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).BeginBlock(ctx, in) +func (m *ResponseCheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MempoolError) > 0 { + i -= len(m.MempoolError) + copy(dAtA[i:], m.MempoolError) + i = encodeVarintTypes(dAtA, i, uint64(len(m.MempoolError))) + i-- + dAtA[i] = 0x5a } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/BeginBlock", + if m.Priority != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Priority)) + i-- + dAtA[i] = 0x50 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).BeginBlock(ctx, req.(*RequestBeginBlock)) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x4a } - return interceptor(ctx, in, info, handler) -} - -func _ABCIApplication_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestEndBlock) - if err := dec(in); err != nil { - return nil, err + if len(m.Codespace) > 0 { + i -= len(m.Codespace) + copy(dAtA[i:], m.Codespace) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Codespace))) + i-- + dAtA[i] = 0x42 } - if interceptor == nil { - return srv.(ABCIApplicationServer).EndBlock(ctx, in) + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/EndBlock", + if m.GasUsed != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.GasUsed)) + i-- + dAtA[i] = 0x30 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).EndBlock(ctx, req.(*RequestEndBlock)) + if m.GasWanted != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.GasWanted)) + i-- + dAtA[i] = 0x28 } - return interceptor(ctx, in, info, handler) -} - -func _ABCIApplication_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestListSnapshots) - if err := dec(in); err != nil { - return nil, err + if len(m.Info) > 0 { + i -= len(m.Info) + copy(dAtA[i:], m.Info) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) + i-- + dAtA[i] = 0x22 } - if interceptor == nil { - return srv.(ABCIApplicationServer).ListSnapshots(ctx, in) + if len(m.Log) > 0 { + i -= len(m.Log) + copy(dAtA[i:], m.Log) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) + i-- + dAtA[i] = 0x1a } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/ListSnapshots", + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).ListSnapshots(ctx, req.(*RequestListSnapshots)) + if m.Code != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _ABCIApplication_OfferSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestOfferSnapshot) - if err := dec(in); err != nil { +func (m *ResponseEndBlock) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(ABCIApplicationServer).OfferSnapshot(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/OfferSnapshot", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).OfferSnapshot(ctx, req.(*RequestOfferSnapshot)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -func _ABCIApplication_LoadSnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestLoadSnapshotChunk) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).LoadSnapshotChunk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/LoadSnapshotChunk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).LoadSnapshotChunk(ctx, req.(*RequestLoadSnapshotChunk)) - } - return interceptor(ctx, in, info, handler) +func (m *ResponseEndBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _ABCIApplication_ApplySnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestApplySnapshotChunk) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).ApplySnapshotChunk(ctx, in) +func (m *ResponseEndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/ApplySnapshotChunk", + if m.ConsensusParamUpdates != nil { + { + size, err := m.ConsensusParamUpdates.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).ApplySnapshotChunk(ctx, req.(*RequestApplySnapshotChunk)) + if len(m.ValidatorUpdates) > 0 { + for iNdEx := len(m.ValidatorUpdates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _ABCIApplication_BeginRecheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestBeginRecheckTx) - if err := dec(in); err != nil { +func (m *ResponseBeginRecheckTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(ABCIApplicationServer).BeginRecheckTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/BeginRecheckTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).BeginRecheckTx(ctx, req.(*RequestBeginRecheckTx)) + return dAtA[:n], nil +} + +func (m *ResponseBeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseBeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Code != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 } - return interceptor(ctx, in, info, handler) + return len(dAtA) - i, nil } -func _ABCIApplication_EndRecheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestEndRecheckTx) - if err := dec(in); err != nil { +func (m *ResponseEndRecheckTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(ABCIApplicationServer).EndRecheckTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ostracon.abci.ABCIApplication/EndRecheckTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).EndRecheckTx(ctx, req.(*RequestEndRecheckTx)) - } - return interceptor(ctx, in, info, handler) + return dAtA[:n], nil } -var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ostracon.abci.ABCIApplication", - HandlerType: (*ABCIApplicationServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Echo", - Handler: _ABCIApplication_Echo_Handler, - }, - { - MethodName: "Flush", - Handler: _ABCIApplication_Flush_Handler, - }, - { - MethodName: "Info", - Handler: _ABCIApplication_Info_Handler, - }, - { - MethodName: "SetOption", - Handler: _ABCIApplication_SetOption_Handler, - }, - { - MethodName: "DeliverTx", - Handler: _ABCIApplication_DeliverTx_Handler, - }, - { - MethodName: "CheckTx", - Handler: _ABCIApplication_CheckTx_Handler, - }, - { - MethodName: "Query", - Handler: _ABCIApplication_Query_Handler, - }, - { - MethodName: "Commit", - Handler: _ABCIApplication_Commit_Handler, - }, - { - MethodName: "InitChain", - Handler: _ABCIApplication_InitChain_Handler, - }, - { - MethodName: "BeginBlock", - Handler: _ABCIApplication_BeginBlock_Handler, - }, - { - MethodName: "EndBlock", - Handler: _ABCIApplication_EndBlock_Handler, - }, - { - MethodName: "ListSnapshots", - Handler: _ABCIApplication_ListSnapshots_Handler, - }, - { - MethodName: "OfferSnapshot", - Handler: _ABCIApplication_OfferSnapshot_Handler, - }, - { - MethodName: "LoadSnapshotChunk", - Handler: _ABCIApplication_LoadSnapshotChunk_Handler, - }, - { - MethodName: "ApplySnapshotChunk", - Handler: _ABCIApplication_ApplySnapshotChunk_Handler, - }, - { - MethodName: "BeginRecheckTx", - Handler: _ABCIApplication_BeginRecheckTx_Handler, - }, - { - MethodName: "EndRecheckTx", - Handler: _ABCIApplication_EndRecheckTx_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ostracon/abci/types.proto", +func (m *ResponseEndRecheckTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request) Marshal() (dAtA []byte, err error) { +func (m *ResponseEndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Code != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LastCommitInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4311,7480 +3571,957 @@ func (m *Request) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Request) MarshalTo(dAtA []byte) (int, error) { +func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LastCommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Value != nil { - { - size := m.Value.Size() - i -= size - if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { - return 0, err + if len(m.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } } + if m.Round != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Round)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *Request_Echo) MarshalTo(dAtA []byte) (int, error) { +func (m *Validator) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Validator) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.Echo != nil { - { - size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } + _ = i + var l int + _ = l + if m.Power != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Power)) + i-- + dAtA[i] = 0x18 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *Request_Flush) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *Request_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Flush != nil { - { - size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (m *ValidatorUpdate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return dAtA[:n], nil } -func (m *Request_Info) MarshalTo(dAtA []byte) (int, error) { + +func (m *ValidatorUpdate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ValidatorUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.Info != nil { - { - size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } + _ = i + var l int + _ = l + if m.Power != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Power)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x10 } + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *Request_SetOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *Request_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SetOption != nil { - { - size, err := m.SetOption.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 +func (m *VoteInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return dAtA[:n], nil } -func (m *Request_InitChain) MarshalTo(dAtA []byte) (int, error) { + +func (m *VoteInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *VoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.InitChain != nil { - { - size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + _ = i + var l int + _ = l + if m.SignedLastBlock { + i-- + if m.SignedLastBlock { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x10 } - return len(dAtA) - i, nil -} -func (m *Request_Query) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Request_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Query != nil { - { - size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x32 + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *Request_BeginBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *Request_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BeginBlock != nil { - { - size, err := m.BeginBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a +func (m *Evidence) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return dAtA[:n], nil } -func (m *Request_CheckTx) MarshalTo(dAtA []byte) (int, error) { + +func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Request_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.CheckTx != nil { - { - size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } + _ = i + var l int + _ = l + if m.TotalVotingPower != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.TotalVotingPower)) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x28 } - return len(dAtA) - i, nil -} -func (m *Request_DeliverTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Request_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DeliverTx != nil { - { - size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } + n45, err45 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err45 != nil { + return 0, err45 + } + i -= n45 + i = encodeVarintTypes(dAtA, i, uint64(n45)) + i-- + dAtA[i] = 0x22 + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x18 } - return len(dAtA) - i, nil -} -func (m *Request_EndBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Request_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EndBlock != nil { - { - size, err := m.EndBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Type != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *Request_Commit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *Request_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Commit != nil { - { - size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return len(dAtA) - i, nil + dAtA[offset] = uint8(v) + return base } -func (m *Request_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Request) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + n += m.Value.Size() + } + return n } -func (m *Request_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ListSnapshots != nil { - { - size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 +func (m *Request_Echo) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil + var l int + _ = l + if m.Echo != nil { + l = m.Echo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } -func (m *Request_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Request_Flush) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Flush != nil { + l = m.Flush.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } - -func (m *Request_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.OfferSnapshot != nil { - { - size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a +func (m *Request_Info) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil + var l int + _ = l + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } -func (m *Request_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Request_SetOption) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SetOption != nil { + l = m.SetOption.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } - -func (m *Request_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.LoadSnapshotChunk != nil { - { - size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 +func (m *Request_InitChain) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil -} -func (m *Request_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Request_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ApplySnapshotChunk != nil { - { - size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a + var l int + _ = l + if m.InitChain != nil { + l = m.InitChain.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil -} -func (m *Request_BeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } - -func (m *Request_BeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BeginRecheckTx != nil { - { - size, err := m.BeginRecheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3e - i-- - dAtA[i] = 0xc2 +func (m *Request_Query) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil -} -func (m *Request_EndRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Request_EndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EndRecheckTx != nil { - { - size, err := m.EndRecheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3e - i-- - dAtA[i] = 0xca + var l int + _ = l + if m.Query != nil { + l = m.Query.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *RequestEcho) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Request_BeginBlock) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestEcho) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestEcho) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa + if m.BeginBlock != nil { + l = m.BeginBlock.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *RequestFlush) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Request_CheckTx) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestFlush) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestFlush) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - return len(dAtA) - i, nil -} - -func (m *RequestInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.CheckTx != nil { + l = m.CheckTx.Size() + n += 1 + l + sovTypes(uint64(l)) } - return dAtA[:n], nil -} - -func (m *RequestInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } - -func (m *RequestInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Request_DeliverTx) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.P2PVersion != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.P2PVersion)) - i-- - dAtA[i] = 0x18 + if m.DeliverTx != nil { + l = m.DeliverTx.Size() + n += 1 + l + sovTypes(uint64(l)) } - if m.BlockVersion != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.BlockVersion)) - i-- - dAtA[i] = 0x10 + return n +} +func (m *Request_EndBlock) Size() (n int) { + if m == nil { + return 0 } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0xa + var l int + _ = l + if m.EndBlock != nil { + l = m.EndBlock.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *RequestSetOption) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Request_Commit) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestSetOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestSetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *RequestInitChain) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Request_ListSnapshots) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestInitChain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestInitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.InitialHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.InitialHeight)) - i-- - dAtA[i] = 0x30 + if m.ListSnapshots != nil { + l = m.ListSnapshots.Size() + n += 1 + l + sovTypes(uint64(l)) } - if len(m.AppStateBytes) > 0 { - i -= len(m.AppStateBytes) - copy(dAtA[i:], m.AppStateBytes) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppStateBytes))) - i-- - dAtA[i] = 0x2a + return n +} +func (m *Request_OfferSnapshot) Size() (n int) { + if m == nil { + return 0 } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.ConsensusParams != nil { - { - size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a + var l int + _ = l + if m.OfferSnapshot != nil { + l = m.OfferSnapshot.Size() + n += 1 + l + sovTypes(uint64(l)) } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 + return n +} +func (m *Request_LoadSnapshotChunk) Size() (n int) { + if m == nil { + return 0 } - n19, err19 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err19 != nil { - return 0, err19 + var l int + _ = l + if m.LoadSnapshotChunk != nil { + l = m.LoadSnapshotChunk.Size() + n += 1 + l + sovTypes(uint64(l)) } - i -= n19 - i = encodeVarintTypes(dAtA, i, uint64(n19)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } - -func (m *RequestQuery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Request_ApplySnapshotChunk) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestQuery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestQuery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Prove { - i-- - if m.Prove { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x18 + if m.ApplySnapshotChunk != nil { + l = m.ApplySnapshotChunk.Size() + n += 1 + l + sovTypes(uint64(l)) } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x12 + return n +} +func (m *Request_BeginRecheckTx) Size() (n int) { + if m == nil { + return 0 } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa + var l int + _ = l + if m.BeginRecheckTx != nil { + l = m.BeginRecheckTx.Size() + n += 2 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *RequestBeginBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Request_EndRecheckTx) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestBeginBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + if m.EndRecheckTx != nil { + l = m.EndRecheckTx.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n } - -func (m *RequestBeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *RequestInitChain) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.ByzantineValidators) > 0 { - for iNdEx := len(m.ByzantineValidators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ByzantineValidators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } - { - size, err := m.LastCommitInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if m.ConsensusParams != nil { + l = m.ConsensusParams.Size() + n += 1 + l + sovTypes(uint64(l)) } - i-- - dAtA[i] = 0x1a - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0xa + l = len(m.AppStateBytes) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *RequestCheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.InitialHeight != 0 { + n += 1 + sovTypes(uint64(m.InitialHeight)) } - return dAtA[:n], nil -} - -func (m *RequestCheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *RequestCheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *RequestBeginBlock) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x10 + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0xa + l = m.Header.Size() + n += 1 + l + sovTypes(uint64(l)) + l = m.LastCommitInfo.Size() + n += 1 + l + sovTypes(uint64(l)) + if len(m.ByzantineValidators) > 0 { + for _, e := range m.ByzantineValidators { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } } - return len(dAtA) - i, nil + return n } -func (m *RequestDeliverTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *RequestBeginRecheckTx) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestDeliverTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + l = m.Header.Size() + n += 1 + l + sovTypes(uint64(l)) + return n } -func (m *RequestDeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *RequestEndRecheckTx) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0xa + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) } - return len(dAtA) - i, nil + return n } -func (m *RequestEndBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Response) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestEndBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestEndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 + if m.Value != nil { + n += m.Value.Size() } - return len(dAtA) - i, nil + return n } -func (m *RequestCommit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Response_Exception) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestCommit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestCommit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - return len(dAtA) - i, nil -} - -func (m *RequestListSnapshots) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.Exception != nil { + l = m.Exception.Size() + n += 1 + l + sovTypes(uint64(l)) } - return dAtA[:n], nil -} - -func (m *RequestListSnapshots) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } - -func (m *RequestListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Response_Echo) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - return len(dAtA) - i, nil -} - -func (m *RequestOfferSnapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.Echo != nil { + l = m.Echo.Size() + n += 1 + l + sovTypes(uint64(l)) } - return dAtA[:n], nil -} - -func (m *RequestOfferSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } - -func (m *RequestOfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Response_Flush) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.AppHash) > 0 { - i -= len(m.AppHash) - copy(dAtA[i:], m.AppHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) - i-- - dAtA[i] = 0x12 - } - if m.Snapshot != nil { - { - size, err := m.Snapshot.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + if m.Flush != nil { + l = m.Flush.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *RequestLoadSnapshotChunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Response_Info) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestLoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestLoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Chunk != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Chunk)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *RequestApplySnapshotChunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Response_SetOption) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x1a + if m.SetOption != nil { + l = m.SetOption.Size() + n += 1 + l + sovTypes(uint64(l)) } - if len(m.Chunk) > 0 { - i -= len(m.Chunk) - copy(dAtA[i:], m.Chunk) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Chunk))) - i-- - dAtA[i] = 0x12 + return n +} +func (m *Response_InitChain) Size() (n int) { + if m == nil { + return 0 } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 + var l int + _ = l + if m.InitChain != nil { + l = m.InitChain.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *RequestBeginRecheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Response_Query) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestBeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestBeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if m.Query != nil { + l = m.Query.Size() + n += 1 + l + sovTypes(uint64(l)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } - -func (m *RequestEndRecheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Response_BeginBlock) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *RequestEndRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestEndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 + if m.BeginBlock != nil { + l = m.BeginBlock.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil + return n } - -func (m *Response) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *Response_CheckTx) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *Response) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.Value != nil { - { - size := m.Value.Size() - i -= size - if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + if m.CheckTx != nil { + l = m.CheckTx.Size() + n += 1 + l + sovTypes(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *Response_Exception) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } - -func (m *Response_Exception) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Exception != nil { - { - size, err := m.Exception.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (m *Response_DeliverTx) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil -} -func (m *Response_Echo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + if m.DeliverTx != nil { + l = m.DeliverTx.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } - -func (m *Response_Echo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Echo != nil { - { - size, err := m.Echo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (m *Response_EndBlock) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil + var l int + _ = l + if m.EndBlock != nil { + l = m.EndBlock.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } -func (m *Response_Flush) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Response_Commit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } - -func (m *Response_Flush) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Flush != nil { - { - size, err := m.Flush.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a +func (m *Response_ListSnapshots) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil + var l int + _ = l + if m.ListSnapshots != nil { + l = m.ListSnapshots.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } -func (m *Response_Info) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Response_OfferSnapshot) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OfferSnapshot != nil { + l = m.OfferSnapshot.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } - -func (m *Response_Info) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Info != nil { - { - size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 +func (m *Response_LoadSnapshotChunk) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil + var l int + _ = l + if m.LoadSnapshotChunk != nil { + l = m.LoadSnapshotChunk.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n } -func (m *Response_SetOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Response_ApplySnapshotChunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ApplySnapshotChunk != nil { + l = m.ApplySnapshotChunk.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n } - -func (m *Response_SetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SetOption != nil { - { - size, err := m.SetOption.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a +func (m *Response_BeginRecheckTx) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil + var l int + _ = l + if m.BeginRecheckTx != nil { + l = m.BeginRecheckTx.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n } -func (m *Response_InitChain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Response_EndRecheckTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EndRecheckTx != nil { + l = m.EndRecheckTx.Size() + n += 2 + l + sovTypes(uint64(l)) + } + return n } - -func (m *Response_InitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.InitChain != nil { - { - size, err := m.InitChain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *ResponseInitChain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConsensusParams != nil { + l = m.ConsensusParams.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) } - i-- - dAtA[i] = 0x32 } - return len(dAtA) - i, nil -} -func (m *Response_Query) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n } -func (m *Response_Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Query != nil { - { - size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a +func (m *ResponseCheckTx) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil -} -func (m *Response_BeginBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Response_BeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BeginBlock != nil { - { - size, err := m.BeginBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + var l int + _ = l + if m.Code != 0 { + n += 1 + sovTypes(uint64(m.Code)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Log) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Info) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.GasWanted != 0 { + n += 1 + sovTypes(uint64(m.GasWanted)) + } + if m.GasUsed != 0 { + n += 1 + sovTypes(uint64(m.GasUsed)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) } - i-- - dAtA[i] = 0x42 } - return len(dAtA) - i, nil -} -func (m *Response_CheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + l = len(m.Codespace) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Priority != 0 { + n += 1 + sovTypes(uint64(m.Priority)) + } + l = len(m.MempoolError) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n } -func (m *Response_CheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.CheckTx != nil { - { - size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *ResponseEndBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ValidatorUpdates) > 0 { + for _, e := range m.ValidatorUpdates { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) } - i-- - dAtA[i] = 0x4a } - return len(dAtA) - i, nil -} -func (m *Response_DeliverTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Response_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DeliverTx != nil { - { - size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if m.ConsensusParamUpdates != nil { + l = m.ConsensusParamUpdates.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) } - i-- - dAtA[i] = 0x52 } - return len(dAtA) - i, nil -} -func (m *Response_EndBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *Response_EndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EndBlock != nil { - { - size, err := m.EndBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a +func (m *ResponseBeginRecheckTx) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil -} -func (m *Response_Commit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + if m.Code != 0 { + n += 1 + sovTypes(uint64(m.Code)) + } + return n } -func (m *Response_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Commit != nil { - { - size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 +func (m *ResponseEndRecheckTx) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil -} -func (m *Response_ListSnapshots) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + if m.Code != 0 { + n += 1 + sovTypes(uint64(m.Code)) + } + return n } -func (m *Response_ListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ListSnapshots != nil { - { - size, err := m.ListSnapshots.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *LastCommitInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Round != 0 { + n += 1 + sovTypes(uint64(m.Round)) + } + if len(m.Votes) > 0 { + for _, e := range m.Votes { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) } - i-- - dAtA[i] = 0x6a } - return len(dAtA) - i, nil -} -func (m *Response_OfferSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *Response_OfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.OfferSnapshot != nil { - { - size, err := m.OfferSnapshot.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 +func (m *Validator) Size() (n int) { + if m == nil { + return 0 } - return len(dAtA) - i, nil -} -func (m *Response_LoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Power != 0 { + n += 1 + sovTypes(uint64(m.Power)) + } + return n } -func (m *Response_LoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.LoadSnapshotChunk != nil { - { - size, err := m.LoadSnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - return len(dAtA) - i, nil -} -func (m *Response_ApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Response_ApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ApplySnapshotChunk != nil { - { - size, err := m.ApplySnapshotChunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - return len(dAtA) - i, nil -} -func (m *Response_BeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Response_BeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BeginRecheckTx != nil { - { - size, err := m.BeginRecheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3e - i-- - dAtA[i] = 0xc2 - } - return len(dAtA) - i, nil -} -func (m *Response_EndRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Response_EndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EndRecheckTx != nil { - { - size, err := m.EndRecheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3e - i-- - dAtA[i] = 0xca - } - return len(dAtA) - i, nil -} -func (m *ResponseException) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseException) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseException) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ResponseEcho) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseEcho) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseEcho) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ResponseFlush) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseFlush) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseFlush) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ResponseInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LastBlockAppHash) > 0 { - i -= len(m.LastBlockAppHash) - copy(dAtA[i:], m.LastBlockAppHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.LastBlockAppHash))) - i-- - dAtA[i] = 0x2a - } - if m.LastBlockHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastBlockHeight)) - i-- - dAtA[i] = 0x20 - } - if m.AppVersion != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.AppVersion)) - i-- - dAtA[i] = 0x18 - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ResponseSetOption) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *ValidatorUpdate) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *ResponseSetOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseSetOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.Info) > 0 { - i -= len(m.Info) - copy(dAtA[i:], m.Info) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) - i-- - dAtA[i] = 0x22 - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x1a - } - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 + l = m.PubKey.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.Power != 0 { + n += 1 + sovTypes(uint64(m.Power)) } - return len(dAtA) - i, nil + return n } -func (m *ResponseInitChain) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *VoteInfo) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *ResponseInitChain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseInitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.AppHash) > 0 { - i -= len(m.AppHash) - copy(dAtA[i:], m.AppHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.ConsensusParams != nil { - { - size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ResponseQuery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseQuery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseQuery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Codespace) > 0 { - i -= len(m.Codespace) - copy(dAtA[i:], m.Codespace) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Codespace))) - i-- - dAtA[i] = 0x52 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x48 - } - if m.ProofOps != nil { - { - size, err := m.ProofOps.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x3a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x32 - } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x28 - } - if len(m.Info) > 0 { - i -= len(m.Info) - copy(dAtA[i:], m.Info) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) - i-- - dAtA[i] = 0x22 - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x1a - } - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResponseBeginBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseBeginBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseBeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ResponseCheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseCheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseCheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MempoolError) > 0 { - i -= len(m.MempoolError) - copy(dAtA[i:], m.MempoolError) - i = encodeVarintTypes(dAtA, i, uint64(len(m.MempoolError))) - i-- - dAtA[i] = 0x5a - } - if m.Priority != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Priority)) - i-- - dAtA[i] = 0x50 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x4a - } - if len(m.Codespace) > 0 { - i -= len(m.Codespace) - copy(dAtA[i:], m.Codespace) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Codespace))) - i-- - dAtA[i] = 0x42 - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.GasUsed != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.GasUsed)) - i-- - dAtA[i] = 0x30 - } - if m.GasWanted != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.GasWanted)) - i-- - dAtA[i] = 0x28 - } - if len(m.Info) > 0 { - i -= len(m.Info) - copy(dAtA[i:], m.Info) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) - i-- - dAtA[i] = 0x22 - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResponseDeliverTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseDeliverTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseDeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Codespace) > 0 { - i -= len(m.Codespace) - copy(dAtA[i:], m.Codespace) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Codespace))) - i-- - dAtA[i] = 0x42 - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.GasUsed != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.GasUsed)) - i-- - dAtA[i] = 0x30 - } - if m.GasWanted != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.GasWanted)) - i-- - dAtA[i] = 0x28 - } - if len(m.Info) > 0 { - i -= len(m.Info) - copy(dAtA[i:], m.Info) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) - i-- - dAtA[i] = 0x22 - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResponseEndBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseEndBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseEndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.ConsensusParamUpdates != nil { - { - size, err := m.ConsensusParamUpdates.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ValidatorUpdates) > 0 { - for iNdEx := len(m.ValidatorUpdates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ResponseCommit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseCommit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseCommit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RetainHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.RetainHeight)) - i-- - dAtA[i] = 0x18 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *ResponseListSnapshots) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseListSnapshots) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseListSnapshots) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Snapshots) > 0 { - for iNdEx := len(m.Snapshots) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Snapshots[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ResponseOfferSnapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseOfferSnapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseOfferSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResponseLoadSnapshotChunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseLoadSnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseLoadSnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Chunk) > 0 { - i -= len(m.Chunk) - copy(dAtA[i:], m.Chunk) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Chunk))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ResponseApplySnapshotChunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseApplySnapshotChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseApplySnapshotChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RejectSenders) > 0 { - for iNdEx := len(m.RejectSenders) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.RejectSenders[iNdEx]) - copy(dAtA[i:], m.RejectSenders[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.RejectSenders[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.RefetchChunks) > 0 { - dAtA46 := make([]byte, len(m.RefetchChunks)*10) - var j45 int - for _, num := range m.RefetchChunks { - for num >= 1<<7 { - dAtA46[j45] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j45++ - } - dAtA46[j45] = uint8(num) - j45++ - } - i -= j45 - copy(dAtA[i:], dAtA46[:j45]) - i = encodeVarintTypes(dAtA, i, uint64(j45)) - i-- - dAtA[i] = 0x12 - } - if m.Result != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResponseBeginRecheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseBeginRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseBeginRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResponseEndRecheckTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseEndRecheckTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseEndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ConsensusParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsensusParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Version != nil { - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Validator != nil { - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Evidence != nil { - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Block != nil { - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BlockParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxGas != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxGas)) - i-- - dAtA[i] = 0x10 - } - if m.MaxBytes != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LastCommitInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LastCommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Attributes) > 0 { - for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventAttribute) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventAttribute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index { - i-- - if m.Index { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TxResult) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TxResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0x1a - } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Validator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Validator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Power != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Power)) - i-- - dAtA[i] = 0x18 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ValidatorUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Power != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Power)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *VoteInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VoteInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SignedLastBlock { - i-- - if m.SignedLastBlock { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Evidence) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TotalVotingPower != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.TotalVotingPower)) - i-- - dAtA[i] = 0x28 - } - n54, err54 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err54 != nil { - return 0, err54 - } - i -= n54 - i = encodeVarintTypes(dAtA, i, uint64(n54)) - i-- - dAtA[i] = 0x22 - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x18 - } - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Snapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x2a - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - if m.Chunks != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Request) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != nil { - n += m.Value.Size() - } - return n -} - -func (m *Request_Echo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Echo != nil { - l = m.Echo.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_Flush) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Flush != nil { - l = m.Flush.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_Info) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Info != nil { - l = m.Info.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_SetOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SetOption != nil { - l = m.SetOption.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_InitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.InitChain != nil { - l = m.InitChain.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_Query) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Query != nil { - l = m.Query.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_BeginBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BeginBlock != nil { - l = m.BeginBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_CheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_DeliverTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DeliverTx != nil { - l = m.DeliverTx.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_EndBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EndBlock != nil { - l = m.EndBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_Commit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Commit != nil { - l = m.Commit.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_ListSnapshots) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ListSnapshots != nil { - l = m.ListSnapshots.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_OfferSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.OfferSnapshot != nil { - l = m.OfferSnapshot.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_LoadSnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LoadSnapshotChunk != nil { - l = m.LoadSnapshotChunk.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_ApplySnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ApplySnapshotChunk != nil { - l = m.ApplySnapshotChunk.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_BeginRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BeginRecheckTx != nil { - l = m.BeginRecheckTx.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Request_EndRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EndRecheckTx != nil { - l = m.EndRecheckTx.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n -} -func (m *RequestEcho) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RequestFlush) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *RequestInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Version) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.BlockVersion != 0 { - n += 1 + sovTypes(uint64(m.BlockVersion)) - } - if m.P2PVersion != 0 { - n += 1 + sovTypes(uint64(m.P2PVersion)) - } - return n -} - -func (m *RequestSetOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RequestInitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.ConsensusParams != nil { - l = m.ConsensusParams.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.AppStateBytes) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.InitialHeight != 0 { - n += 1 + sovTypes(uint64(m.InitialHeight)) - } - return n -} - -func (m *RequestQuery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Prove { - n += 2 - } - return n -} - -func (m *RequestBeginBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Header.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.LastCommitInfo.Size() - n += 1 + l + sovTypes(uint64(l)) - if len(m.ByzantineValidators) > 0 { - for _, e := range m.ByzantineValidators { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *RequestCheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - return n -} - -func (m *RequestDeliverTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RequestEndBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - -func (m *RequestCommit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *RequestListSnapshots) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *RequestOfferSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Snapshot != nil { - l = m.Snapshot.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.AppHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RequestLoadSnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Chunk != 0 { - n += 1 + sovTypes(uint64(m.Chunk)) - } - return n -} - -func (m *RequestApplySnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - l = len(m.Chunk) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *RequestBeginRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Header.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *RequestEndRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - -func (m *Response) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != nil { - n += m.Value.Size() - } - return n -} - -func (m *Response_Exception) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Exception != nil { - l = m.Exception.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_Echo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Echo != nil { - l = m.Echo.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_Flush) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Flush != nil { - l = m.Flush.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_Info) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Info != nil { - l = m.Info.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_SetOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SetOption != nil { - l = m.SetOption.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_InitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.InitChain != nil { - l = m.InitChain.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_Query) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Query != nil { - l = m.Query.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_BeginBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BeginBlock != nil { - l = m.BeginBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_CheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_DeliverTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DeliverTx != nil { - l = m.DeliverTx.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_EndBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EndBlock != nil { - l = m.EndBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_Commit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Commit != nil { - l = m.Commit.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_ListSnapshots) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ListSnapshots != nil { - l = m.ListSnapshots.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_OfferSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.OfferSnapshot != nil { - l = m.OfferSnapshot.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_LoadSnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LoadSnapshotChunk != nil { - l = m.LoadSnapshotChunk.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_ApplySnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ApplySnapshotChunk != nil { - l = m.ApplySnapshotChunk.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_BeginRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BeginRecheckTx != nil { - l = m.BeginRecheckTx.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n -} -func (m *Response_EndRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EndRecheckTx != nil { - l = m.EndRecheckTx.Size() - n += 2 + l + sovTypes(uint64(l)) - } - return n -} -func (m *ResponseException) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Error) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseEcho) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseFlush) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ResponseInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.AppVersion != 0 { - n += 1 + sovTypes(uint64(m.AppVersion)) - } - if m.LastBlockHeight != 0 { - n += 1 + sovTypes(uint64(m.LastBlockHeight)) - } - l = len(m.LastBlockAppHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseSetOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Info) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseInitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ConsensusParams != nil { - l = m.ConsensusParams.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.AppHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseQuery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Info) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.ProofOps != nil { - l = m.ProofOps.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - l = len(m.Codespace) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseBeginBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ResponseCheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Info) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.GasWanted != 0 { - n += 1 + sovTypes(uint64(m.GasWanted)) - } - if m.GasUsed != 0 { - n += 1 + sovTypes(uint64(m.GasUsed)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.Codespace) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Priority != 0 { - n += 1 + sovTypes(uint64(m.Priority)) - } - l = len(m.MempoolError) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseDeliverTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Info) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.GasWanted != 0 { - n += 1 + sovTypes(uint64(m.GasWanted)) - } - if m.GasUsed != 0 { - n += 1 + sovTypes(uint64(m.GasUsed)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.Codespace) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseEndBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ValidatorUpdates) > 0 { - for _, e := range m.ValidatorUpdates { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.ConsensusParamUpdates != nil { - l = m.ConsensusParamUpdates.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ResponseCommit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.RetainHeight != 0 { - n += 1 + sovTypes(uint64(m.RetainHeight)) - } - return n -} - -func (m *ResponseListSnapshots) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Snapshots) > 0 { - for _, e := range m.Snapshots { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ResponseOfferSnapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != 0 { - n += 1 + sovTypes(uint64(m.Result)) - } - return n -} - -func (m *ResponseLoadSnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Chunk) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ResponseApplySnapshotChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != 0 { - n += 1 + sovTypes(uint64(m.Result)) - } - if len(m.RefetchChunks) > 0 { - l = 0 - for _, e := range m.RefetchChunks { - l += sovTypes(uint64(e)) - } - n += 1 + sovTypes(uint64(l)) + l - } - if len(m.RejectSenders) > 0 { - for _, s := range m.RejectSenders { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ResponseBeginRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - return n -} - -func (m *ResponseEndRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - return n -} - -func (m *ConsensusParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Evidence != nil { - l = m.Evidence.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Validator != nil { - l = m.Validator.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Version != nil { - l = m.Version.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *BlockParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxBytes != 0 { - n += 1 + sovTypes(uint64(m.MaxBytes)) - } - if m.MaxGas != 0 { - n += 1 + sovTypes(uint64(m.MaxGas)) - } - return n -} - -func (m *LastCommitInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *EventAttribute) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Index { - n += 2 - } - return n -} - -func (m *TxResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Result.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *Validator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Power != 0 { - n += 1 + sovTypes(uint64(m.Power)) - } - return n -} - -func (m *ValidatorUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PubKey.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Power != 0 { - n += 1 + sovTypes(uint64(m.Power)) - } - return n -} - -func (m *VoteInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Validator.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.SignedLastBlock { - n += 2 - } - return n -} - -func (m *Evidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = m.Validator.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - if m.TotalVotingPower != 0 { - n += 1 + sovTypes(uint64(m.TotalVotingPower)) - } - return n -} - -func (m *Snapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Chunks != 0 { - n += 1 + sovTypes(uint64(m.Chunks)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Request) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Request: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestEcho{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_Echo{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestFlush{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_Flush{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_Info{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SetOption", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestSetOption{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_SetOption{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestInitChain{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_InitChain{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestQuery{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_Query{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestBeginBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_BeginBlock{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestCheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_CheckTx{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestDeliverTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_DeliverTx{v} - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestEndBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_EndBlock{v} - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestCommit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_Commit{v} - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestListSnapshots{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_ListSnapshots{v} - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestOfferSnapshot{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_OfferSnapshot{v} - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestLoadSnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_LoadSnapshotChunk{v} - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestApplySnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_ApplySnapshotChunk{v} - iNdEx = postIndex - case 1000: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginRecheckTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestBeginRecheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_BeginRecheckTx{v} - iNdEx = postIndex - case 1001: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndRecheckTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RequestEndRecheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Request_EndRecheckTx{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestEcho) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestEcho: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestEcho: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestFlush) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestFlush: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestFlush: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockVersion", wireType) - } - m.BlockVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockVersion |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field P2PVersion", wireType) - } - m.P2PVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.P2PVersion |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestSetOption) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestSetOption: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestSetOption: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestInitChain) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestInitChain: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestInitChain: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusParams == nil { - m.ConsensusParams = &ConsensusParams{} - } - if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Validators = append(m.Validators, ValidatorUpdate{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppStateBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppStateBytes = append(m.AppStateBytes[:0], dAtA[iNdEx:postIndex]...) - if m.AppStateBytes == nil { - m.AppStateBytes = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) - } - m.InitialHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.InitialHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestQuery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestQuery: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestQuery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Prove", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Prove = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestBeginBlock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestBeginBlock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommitInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastCommitInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ByzantineValidators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ByzantineValidators = append(m.ByzantineValidators, Evidence{}) - if err := m.ByzantineValidators[len(m.ByzantineValidators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestCheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestCheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestCheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) - if m.Tx == nil { - m.Tx = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= CheckTxType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestDeliverTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestDeliverTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestDeliverTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) - if m.Tx == nil { - m.Tx = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestEndBlock) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestEndBlock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestEndBlock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestCommit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestCommit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestCommit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestListSnapshots) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestListSnapshots: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestListSnapshots: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestOfferSnapshot) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestOfferSnapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestOfferSnapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Snapshot == nil { - m.Snapshot = &Snapshot{} - } - if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestLoadSnapshotChunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestLoadSnapshotChunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestLoadSnapshotChunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) - } - m.Chunk = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Chunk |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestApplySnapshotChunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestApplySnapshotChunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestApplySnapshotChunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunk = append(m.Chunk[:0], dAtA[iNdEx:postIndex]...) - if m.Chunk == nil { - m.Chunk = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestBeginRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestBeginRecheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestEndRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestEndRecheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestEndRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Response) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Response: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exception", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseException{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Exception{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseEcho{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Echo{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseFlush{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Flush{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Info{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SetOption", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseSetOption{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_SetOption{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseInitChain{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_InitChain{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseQuery{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Query{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseBeginBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_BeginBlock{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseCheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_CheckTx{v} - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseDeliverTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_DeliverTx{v} - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseEndBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_EndBlock{v} - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseCommit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Commit{v} - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseListSnapshots{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_ListSnapshots{v} - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseOfferSnapshot{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_OfferSnapshot{v} - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseLoadSnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_LoadSnapshotChunk{v} - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseApplySnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_ApplySnapshotChunk{v} - iNdEx = postIndex - case 1000: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginRecheckTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseBeginRecheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_BeginRecheckTx{v} - iNdEx = postIndex - case 1001: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndRecheckTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseEndRecheckTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_EndRecheckTx{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseException) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseException: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseException: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseEcho) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseEcho: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseEcho: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseFlush) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseFlush: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseFlush: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + l = m.Validator.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.SignedLastBlock { + n += 2 } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *Evidence) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + if m.Type != 0 { + n += 1 + sovTypes(uint64(m.Type)) + } + l = m.Validator.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + if m.TotalVotingPower != 0 { + n += 1 + sovTypes(uint64(m.TotalVotingPower)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *ResponseInfo) Unmarshal(dAtA []byte) error { +func (m *Request) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11807,17 +4544,17 @@ func (m *ResponseInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseInfo: wiretype end group for non-group") + return fmt.Errorf("proto: Request: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -11827,29 +4564,32 @@ func (m *ResponseInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = string(dAtA[iNdEx:postIndex]) + v := &types.RequestEcho{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Echo{v} iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -11859,67 +4599,32 @@ func (m *ResponseInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) + v := &types.RequestFlush{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Flush{v} iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) - } - m.AppVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppVersion |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockHeight", wireType) - } - m.LastBlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastBlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockAppHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -11929,132 +4634,32 @@ func (m *ResponseInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.LastBlockAppHash = append(m.LastBlockAppHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastBlockAppHash == nil { - m.LastBlockAppHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { + v := &types.RequestInfo{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseSetOption) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseSetOption: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseSetOption: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Log = string(dAtA[iNdEx:postIndex]) + m.Value = &Request_Info{v} iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SetOption", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12064,77 +4669,30 @@ func (m *ResponseSetOption) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Info = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + break + } } - if iNdEx >= l { + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &types.RequestSetOption{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseInitChain: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseInitChain: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Value = &Request_SetOption{v} + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12161,16 +4719,15 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusParams == nil { - m.ConsensusParams = &ConsensusParams{} - } - if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &RequestInitChain{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Request_InitChain{v} iNdEx = postIndex - case 2: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12197,16 +4754,17 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, ValidatorUpdate{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.RequestQuery{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Request_Query{v} iNdEx = postIndex - case 3: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BeginBlock", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12216,81 +4774,67 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} + v := &RequestBeginBlock{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Request_BeginBlock{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return ErrInvalidLengthTypes } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseQuery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &types.RequestCheckTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseQuery: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseQuery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + m.Value = &Request_CheckTx{v} + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) } - m.Code = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12300,16 +4844,32 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.RequestDeliverTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_DeliverTx{v} + iNdEx = postIndex + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12319,29 +4879,32 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Log = string(dAtA[iNdEx:postIndex]) + v := &types.RequestEndBlock{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_EndBlock{v} iNdEx = postIndex - case 4: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12351,29 +4914,32 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Info = string(dAtA[iNdEx:postIndex]) + v := &types.RequestCommit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_Commit{v} iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) } - m.Index = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12383,16 +4949,32 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Index |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.RequestListSnapshots{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_ListSnapshots{v} + iNdEx = postIndex + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12402,31 +4984,32 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + v := &types.RequestOfferSnapshot{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Request_OfferSnapshot{v} iNdEx = postIndex - case 7: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12436,29 +5019,30 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} + v := &types.RequestLoadSnapshotChunk{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Request_LoadSnapshotChunk{v} iNdEx = postIndex - case 8: + case 15: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofOps", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12485,18 +5069,17 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ProofOps == nil { - m.ProofOps = &crypto.ProofOps{} - } - if err := m.ProofOps.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.RequestApplySnapshotChunk{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Request_ApplySnapshotChunk{v} iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + case 1000: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BeginRecheckTx", wireType) } - m.Height = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12506,16 +5089,32 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 10: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &RequestBeginRecheckTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_BeginRecheckTx{v} + iNdEx = postIndex + case 1001: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EndRecheckTx", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12525,23 +5124,26 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Codespace = string(dAtA[iNdEx:postIndex]) + v := &RequestEndRecheckTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Request_EndRecheckTx{v} iNdEx = postIndex default: iNdEx = preIndex @@ -12564,7 +5166,7 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseBeginBlock) Unmarshal(dAtA []byte) error { +func (m *RequestInitChain) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12587,15 +5189,15 @@ func (m *ResponseBeginBlock) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseBeginBlock: wiretype end group for non-group") + return fmt.Errorf("proto: RequestInitChain: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseBeginBlock: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RequestInitChain: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12622,66 +5224,15 @@ func (m *ResponseBeginBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseCheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseCheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - m.Code = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12691,16 +5242,29 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= uint32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 2: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12710,31 +5274,33 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} + if m.ConsensusParams == nil { + m.ConsensusParams = &types.ConsensusParams{} + } + if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12744,29 +5310,31 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Log = string(dAtA[iNdEx:postIndex]) + m.Validators = append(m.Validators, ValidatorUpdate{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AppStateBytes", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12776,29 +5344,31 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Info = string(dAtA[iNdEx:postIndex]) + m.AppStateBytes = append(m.AppStateBytes[:0], dAtA[iNdEx:postIndex]...) + if m.AppStateBytes == nil { + m.AppStateBytes = []byte{} + } iNdEx = postIndex - case 5: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) } - m.GasWanted = 0 + m.InitialHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12808,16 +5378,66 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GasWanted |= int64(b&0x7F) << shift + m.InitialHeight |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - m.GasUsed = 0 + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestBeginBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestBeginBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12827,14 +5447,29 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GasUsed |= int64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 7: + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12861,16 +5496,15 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 8: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastCommitInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12880,29 +5514,30 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Codespace = string(dAtA[iNdEx:postIndex]) + if err := m.LastCommitInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 9: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ByzantineValidators", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12912,29 +5547,81 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.ByzantineValidators = append(m.ByzantineValidators, Evidence{}) + if err := m.ByzantineValidators[len(m.ByzantineValidators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - m.Priority = 0 + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestBeginRecheckTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestBeginRecheckTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12944,16 +5631,80 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Priority |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MempoolError", wireType) + if msglen < 0 { + return ErrInvalidLengthTypes } - var stringLen uint64 + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestEndRecheckTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestEndRecheckTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestEndRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12963,24 +5714,11 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Height |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MempoolError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -13002,7 +5740,7 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { +func (m *Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13012,30 +5750,100 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowTypes } - if iNdEx >= l { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exception", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.ResponseException{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_Exception{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &types.ResponseEcho{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseDeliverTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseDeliverTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + m.Value = &Response_Echo{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) } - m.Code = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13045,16 +5853,32 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 2: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.ResponseFlush{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_Flush{v} + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13064,31 +5888,32 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} + v := &types.ResponseInfo{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Response_Info{v} iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SetOption", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13098,29 +5923,32 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Log = string(dAtA[iNdEx:postIndex]) + v := &types.ResponseSetOption{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_SetOption{v} iNdEx = postIndex - case 4: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13130,29 +5958,32 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Info = string(dAtA[iNdEx:postIndex]) + v := &ResponseInitChain{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_InitChain{v} iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } - m.GasWanted = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13162,16 +5993,32 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GasWanted |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + if msglen < 0 { + return ErrInvalidLengthTypes } - m.GasUsed = 0 + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.ResponseQuery{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_Query{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BeginBlock", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13181,14 +6028,30 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GasUsed |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 7: + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.ResponseBeginBlock{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_BeginBlock{v} + iNdEx = postIndex + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13215,16 +6078,17 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &ResponseCheckTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_CheckTx{v} iNdEx = postIndex - case 8: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13234,77 +6098,65 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Codespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { + v := &types.ResponseDeliverTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + m.Value = &Response_DeliverTx{v} + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return ErrInvalidLengthTypes } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseEndBlock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseEndBlock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ResponseEndBlock{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &Response_EndBlock{v} + iNdEx = postIndex + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13331,14 +6183,15 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorUpdates = append(m.ValidatorUpdates, ValidatorUpdate{}) - if err := m.ValidatorUpdates[len(m.ValidatorUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.ResponseCommit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_Commit{v} iNdEx = postIndex - case 2: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParamUpdates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13365,16 +6218,15 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusParamUpdates == nil { - m.ConsensusParamUpdates = &ConsensusParams{} - } - if err := m.ConsensusParamUpdates.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.ResponseListSnapshots{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_ListSnapshots{v} iNdEx = postIndex - case 3: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13401,66 +6253,52 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.ResponseOfferSnapshot{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_OfferSnapshot{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return ErrInvalidLengthTypes } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseCommit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &types.ResponseLoadSnapshotChunk{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseCommit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseCommit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: + m.Value = &Response_LoadSnapshotChunk{v} + iNdEx = postIndex + case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ApplySnapshotChunk", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13470,31 +6308,32 @@ func (m *ResponseCommit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} + v := &types.ResponseApplySnapshotChunk{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Response_ApplySnapshotChunk{v} iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RetainHeight", wireType) + case 1000: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BeginRecheckTx", wireType) } - m.RetainHeight = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13504,64 +6343,30 @@ func (m *ResponseCommit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RetainHeight |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseListSnapshots) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &ResponseBeginRecheckTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseListSnapshots: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseListSnapshots: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Value = &Response_BeginRecheckTx{v} + iNdEx = postIndex + case 1001: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshots", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EndRecheckTx", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13588,10 +6393,11 @@ func (m *ResponseListSnapshots) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Snapshots = append(m.Snapshots, &Snapshot{}) - if err := m.Snapshots[len(m.Snapshots)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &ResponseEndRecheckTx{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_EndRecheckTx{v} iNdEx = postIndex default: iNdEx = preIndex @@ -13614,7 +6420,7 @@ func (m *ResponseListSnapshots) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseOfferSnapshot) Unmarshal(dAtA []byte) error { +func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13637,17 +6443,17 @@ func (m *ResponseOfferSnapshot) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseOfferSnapshot: wiretype end group for non-group") + return fmt.Errorf("proto: ResponseInitChain: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseOfferSnapshot: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponseInitChain: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) } - m.Result = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13657,64 +6463,65 @@ func (m *ResponseOfferSnapshot) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Result |= ResponseOfferSnapshot_Result(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err + if msglen < 0 { + return ErrInvalidLengthTypes } - if (skippy < 0) || (iNdEx+skippy) < 0 { + postIndex := iNdEx + msglen + if postIndex < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseLoadSnapshotChunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + if m.ConsensusParams == nil { + m.ConsensusParams = &types.ConsensusParams{} } - if iNdEx >= l { + if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Validators = append(m.Validators, ValidatorUpdate{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseLoadSnapshotChunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseLoadSnapshotChunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -13741,9 +6548,9 @@ func (m *ResponseLoadSnapshotChunk) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Chunk = append(m.Chunk[:0], dAtA[iNdEx:postIndex]...) - if m.Chunk == nil { - m.Chunk = []byte{} + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} } iNdEx = postIndex default: @@ -13767,7 +6574,7 @@ func (m *ResponseLoadSnapshotChunk) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { +func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13790,17 +6597,17 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseApplySnapshotChunk: wiretype end group for non-group") + return fmt.Errorf("proto: ResponseCheckTx: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseApplySnapshotChunk: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponseCheckTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - m.Result = 0 + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13810,90 +6617,48 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Result |= ResponseApplySnapshotChunk_Result(b&0x7F) << shift + m.Code |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 2: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RefetchChunks = append(m.RefetchChunks, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.RefetchChunks) == 0 { - m.RefetchChunks = make([]uint32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RefetchChunks = append(m.RefetchChunks, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field RefetchChunks", wireType) + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} } + iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RejectSenders", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -13921,63 +6686,13 @@ func (m *ResponseApplySnapshotChunk) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RejectSenders = append(m.RejectSenders, string(dAtA[iNdEx:postIndex])) + m.Log = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseBeginRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseBeginRecheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - m.Code = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -13987,66 +6702,29 @@ func (m *ResponseBeginRecheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= uint32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseEndRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseEndRecheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseEndRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Info = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) } - m.Code = 0 + m.GasWanted = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14056,66 +6734,16 @@ func (m *ResponseEndRecheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= uint32(b&0x7F) << shift + m.GasWanted |= int64(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConsensusParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsensusParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) } - var msglen int + m.GasUsed = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14125,31 +6753,14 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.GasUsed |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Block == nil { - m.Block = &BlockParams{} - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14176,18 +6787,16 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Evidence == nil { - m.Evidence = &types2.EvidenceParams{} - } - if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, types.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14197,33 +6806,29 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Validator == nil { - m.Validator = &types2.ValidatorParams{} - } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Codespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14233,83 +6838,29 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Version == nil { - m.Version = &types2.VersionParams{} - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 10: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) } - m.MaxBytes = 0 + m.Priority = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14319,16 +6870,16 @@ func (m *BlockParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxBytes |= int64(b&0x7F) << shift + m.Priority |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MempoolError", wireType) } - m.MaxGas = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14338,11 +6889,24 @@ func (m *BlockParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxGas |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MempoolError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -14364,7 +6928,7 @@ func (m *BlockParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { +func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14387,34 +6951,15 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LastCommitInfo: wiretype end group for non-group") + return fmt.Errorf("proto: ResponseEndBlock: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LastCommitInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponseEndBlock: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdates", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14441,66 +6986,16 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Votes = append(m.Votes, VoteInfo{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ValidatorUpdates = append(m.ValidatorUpdates, ValidatorUpdate{}) + if err := m.ValidatorUpdates[len(m.ValidatorUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Event) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Event: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParamUpdates", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14510,27 +7005,31 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + if m.ConsensusParamUpdates == nil { + m.ConsensusParamUpdates = &types.ConsensusParams{} + } + if err := m.ConsensusParamUpdates.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14557,8 +7056,8 @@ func (m *Event) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Attributes = append(m.Attributes, EventAttribute{}) - if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, types.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -14583,7 +7082,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } return nil } -func (m *EventAttribute) Unmarshal(dAtA []byte) error { +func (m *ResponseBeginRecheckTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14606,17 +7105,17 @@ func (m *EventAttribute) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventAttribute: wiretype end group for non-group") + return fmt.Errorf("proto: ResponseBeginRecheckTx: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventAttribute: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponseBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var byteLen int + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14626,65 +7125,66 @@ func (m *EventAttribute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.Code |= uint32(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthTypes + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + byteLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseEndRecheckTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 3: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseEndRecheckTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseEndRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var v int + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14694,12 +7194,11 @@ func (m *EventAttribute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Code |= uint32(b&0x7F) << shift if b < 0x80 { break } } - m.Index = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -14721,7 +7220,7 @@ func (m *EventAttribute) Unmarshal(dAtA []byte) error { } return nil } -func (m *TxResult) Unmarshal(dAtA []byte) error { +func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14744,17 +7243,17 @@ func (m *TxResult) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TxResult: wiretype end group for non-group") + return fmt.Errorf("proto: LastCommitInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TxResult: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LastCommitInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) } - m.Height = 0 + m.Round = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -14764,67 +7263,14 @@ func (m *TxResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + m.Round |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) - if m.Tx == nil { - m.Tx = []byte{} - } - iNdEx = postIndex - case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14851,7 +7297,8 @@ func (m *TxResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Votes = append(m.Votes, VoteInfo{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -15227,7 +7674,7 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= EvidenceType(b&0x7F) << shift + m.Type |= types.EvidenceType(b&0x7F) << shift if b < 0x80 { break } @@ -15357,181 +7804,6 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { } return nil } -func (m *Snapshot) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Snapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - m.Chunks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Chunks |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/blockchain/v0/reactor_test.go b/blockchain/v0/reactor_test.go index e0aff57fb..ba58fc3fc 100644 --- a/blockchain/v0/reactor_test.go +++ b/blockchain/v0/reactor_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -317,34 +318,34 @@ type testApp struct { var _ abci.Application = (*testApp)(nil) -func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { - return abci.ResponseInfo{} +func (app *testApp) Info(req tmabci.RequestInfo) (resInfo tmabci.ResponseInfo) { + return tmabci.ResponseInfo{} } -func (app *testApp) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return abci.ResponseBeginBlock{} +func (app *testApp) BeginBlock(req abci.RequestBeginBlock) tmabci.ResponseBeginBlock { + return tmabci.ResponseBeginBlock{} } -func (app *testApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { +func (app *testApp) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { return abci.ResponseEndBlock{} } -func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { - return abci.ResponseDeliverTx{Events: []abci.Event{}} +func (app *testApp) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { + return tmabci.ResponseDeliverTx{Events: []tmabci.Event{}} } -func (app *testApp) CheckTxSync(req abci.RequestCheckTx) abci.ResponseCheckTx { +func (app *testApp) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { return abci.ResponseCheckTx{} } -func (app *testApp) CheckTxAsync(req abci.RequestCheckTx, callback abci.CheckTxCallback) { +func (app *testApp) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { callback(abci.ResponseCheckTx{}) } -func (app *testApp) Commit() abci.ResponseCommit { - return abci.ResponseCommit{} +func (app *testApp) Commit() tmabci.ResponseCommit { + return tmabci.ResponseCommit{} } -func (app *testApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { +func (app *testApp) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { return } diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index b8c4bf76b..7bd1bcd80 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" @@ -148,7 +149,7 @@ func TestMempoolRmBadTx(t *testing.T) { txBytes := make([]byte, 8) binary.BigEndian.PutUint64(txBytes, uint64(0)) - resDeliver := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) + resDeliver := app.DeliverTx(tmabci.RequestDeliverTx{Tx: txBytes}) assert.False(t, resDeliver.IsErr(), fmt.Sprintf("expected no error. got %v", resDeliver)) resCommit := app.Commit() @@ -236,30 +237,30 @@ func NewCounterApplication() *CounterApplication { return &CounterApplication{} } -func (app *CounterApplication) Info(req abci.RequestInfo) abci.ResponseInfo { - return abci.ResponseInfo{Data: fmt.Sprintf("txs:%v", app.txCount)} +func (app *CounterApplication) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { + return tmabci.ResponseInfo{Data: fmt.Sprintf("txs:%v", app.txCount)} } -func (app *CounterApplication) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (app *CounterApplication) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { txValue := txAsUint64(req.Tx) if txValue != uint64(app.txCount) { - return abci.ResponseDeliverTx{ + return tmabci.ResponseDeliverTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } app.txCount++ - return abci.ResponseDeliverTx{Code: code.CodeTypeOK} + return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} } -func (app *CounterApplication) CheckTxSync(req abci.RequestCheckTx) abci.ResponseCheckTx { +func (app *CounterApplication) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { return app.checkTx(req) } -func (app *CounterApplication) CheckTxAsync(req abci.RequestCheckTx, callback abci.CheckTxCallback) { +func (app *CounterApplication) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *CounterApplication) checkTx(req abci.RequestCheckTx) abci.ResponseCheckTx { +func (app *CounterApplication) checkTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { txValue := txAsUint64(req.Tx) app.mempoolTxCountMtx.Lock() defer app.mempoolTxCountMtx.Unlock() @@ -283,11 +284,11 @@ func txAsUint64(tx []byte) uint64 { return binary.BigEndian.Uint64(tx8) } -func (app *CounterApplication) Commit() abci.ResponseCommit { +func (app *CounterApplication) Commit() tmabci.ResponseCommit { if app.txCount == 0 { - return abci.ResponseCommit{} + return tmabci.ResponseCommit{} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return abci.ResponseCommit{Data: hash} + return tmabci.ResponseCommit{Data: hash} } diff --git a/consensus/replay_stubs.go b/consensus/replay_stubs.go index 0956992fc..4f68ca05b 100644 --- a/consensus/replay_stubs.go +++ b/consensus/replay_stubs.go @@ -1,6 +1,8 @@ package consensus import ( + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/clist" mempl "github.com/line/ostracon/mempool" @@ -28,7 +30,7 @@ func (emptyMempool) ReapMaxBytesMaxGasMaxTxs(_, _, _ int64) types.Txs { return t func (emptyMempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} } func (emptyMempool) Update( _ *types.Block, - _ []*abci.ResponseDeliverTx, + _ []*tmabci.ResponseDeliverTx, _ mempl.PreCheckFunc, _ mempl.PostCheckFunc, ) error { @@ -73,20 +75,20 @@ type mockProxyApp struct { abciResponses *ocstate.ABCIResponses } -func (mock *mockProxyApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (mock *mockProxyApp) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { r := mock.abciResponses.DeliverTxs[mock.txCount] mock.txCount++ if r == nil { - return abci.ResponseDeliverTx{} + return tmabci.ResponseDeliverTx{} } return *r } -func (mock *mockProxyApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { +func (mock *mockProxyApp) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { mock.txCount = 0 return *mock.abciResponses.EndBlock } -func (mock *mockProxyApp) Commit() abci.ResponseCommit { - return abci.ResponseCommit{Data: mock.appHash} +func (mock *mockProxyApp) Commit() tmabci.ResponseCommit { + return tmabci.ResponseCommit{Data: mock.appHash} } diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 1cdb3c1fc..618bdc2c8 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -16,6 +16,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -609,8 +610,8 @@ func TestMockProxyApp(t *testing.T) { assert.NotPanics(t, func() { abciResWithEmptyDeliverTx := new(ocstate.ABCIResponses) - abciResWithEmptyDeliverTx.DeliverTxs = make([]*abci.ResponseDeliverTx, 0) - abciResWithEmptyDeliverTx.DeliverTxs = append(abciResWithEmptyDeliverTx.DeliverTxs, &abci.ResponseDeliverTx{}) + abciResWithEmptyDeliverTx.DeliverTxs = make([]*tmabci.ResponseDeliverTx, 0) + abciResWithEmptyDeliverTx.DeliverTxs = append(abciResWithEmptyDeliverTx.DeliverTxs, &tmabci.ResponseDeliverTx{}) // called when saveABCIResponses: bytes, err := proto.Marshal(abciResWithEmptyDeliverTx) @@ -624,7 +625,7 @@ func TestMockProxyApp(t *testing.T) { mock := newMockProxyApp([]byte("mock_hash"), loadedAbciRes) abciRes := new(ocstate.ABCIResponses) - abciRes.DeliverTxs = make([]*abci.ResponseDeliverTx, len(loadedAbciRes.DeliverTxs)) + abciRes.DeliverTxs = make([]*tmabci.ResponseDeliverTx, len(loadedAbciRes.DeliverTxs)) // Execute transactions and get hash. proxyCb := func(req *abci.Request, res *abci.Response) { if r, ok := res.Value.(*abci.Response_DeliverTx); ok { @@ -645,7 +646,7 @@ func TestMockProxyApp(t *testing.T) { mock.SetGlobalCallback(proxyCb) someTx := []byte("tx") - mock.DeliverTxAsync(abci.RequestDeliverTx{Tx: someTx}, nil) + mock.DeliverTxAsync(tmabci.RequestDeliverTx{Tx: someTx}, nil) }) assert.True(t, validTxs == 1) assert.True(t, invalidTxs == 0) @@ -782,7 +783,7 @@ func testHandshakeReplay(t *testing.T, config *cfg.Config, nBlocks int, mode uin } // get the latest app hash from the app - res, err := proxyApp.Query().InfoSync(abci.RequestInfo{Version: ""}) + res, err := proxyApp.Query().InfoSync(tmabci.RequestInfo{Version: ""}) if err != nil { t.Fatal(err) } @@ -1037,15 +1038,15 @@ type badApp struct { onlyLastHashIsWrong bool } -func (app *badApp) Commit() abci.ResponseCommit { +func (app *badApp) Commit() tmabci.ResponseCommit { app.height++ if app.onlyLastHashIsWrong { if app.height == app.numBlocks { - return abci.ResponseCommit{Data: tmrand.Bytes(8)} + return tmabci.ResponseCommit{Data: tmrand.Bytes(8)} } - return abci.ResponseCommit{Data: []byte{app.height}} + return tmabci.ResponseCommit{Data: []byte{app.height}} } else if app.allHashesAreWrong { - return abci.ResponseCommit{Data: tmrand.Bytes(8)} + return tmabci.ResponseCommit{Data: tmrand.Bytes(8)} } panic("either allHashesAreWrong or onlyLastHashIsWrong must be set") diff --git a/consensus/state_test.go b/consensus/state_test.go index bccd11b43..421164052 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -2097,12 +2098,12 @@ func subscribeUnBuffered(eventBus *types.EventBus, q tmpubsub.Query) <-chan tmpu func TestPruneBlocks(t *testing.T) { // Based behaviour is counter.Application mockApp := &mocks.Application{} - mockApp.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{}) + mockApp.On("BeginBlock", mock.Anything).Return(tmabci.ResponseBeginBlock{}) mockApp.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{}) mockApp.On("BeginRecheckTx", mock.Anything).Return(abci.ResponseBeginRecheckTx{Code: abci.CodeTypeOK}) mockApp.On("EndRecheckTx", mock.Anything).Return(abci.ResponseEndRecheckTx{Code: abci.CodeTypeOK}) // Mocking behaviour to response `RetainHeight` for pruneBlocks - mockApp.On("Commit", mock.Anything, mock.Anything).Return(abci.ResponseCommit{RetainHeight: 1}) + mockApp.On("Commit", mock.Anything, mock.Anything).Return(tmabci.ResponseCommit{RetainHeight: 1}) cs1, vss := randStateWithApp(4, mockApp) height, round := cs1.Height, cs1.Round diff --git a/light/rpc/client.go b/light/rpc/client.go index 663f09578..781e2465e 100644 --- a/light/rpc/client.go +++ b/light/rpc/client.go @@ -10,6 +10,8 @@ import ( "github.com/gogo/protobuf/proto" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/merkle" tmbytes "github.com/line/ostracon/libs/bytes" @@ -410,7 +412,7 @@ func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.Resul } // proto-encode BeginBlock events - bbeBytes, err := proto.Marshal(&abci.ResponseBeginBlock{ + bbeBytes, err := proto.Marshal(&tmabci.ResponseBeginBlock{ Events: res.BeginBlockEvents, }) if err != nil { diff --git a/mempool/clist_mempool.go b/mempool/clist_mempool.go index 2766dc2c4..b89244d96 100644 --- a/mempool/clist_mempool.go +++ b/mempool/clist_mempool.go @@ -8,6 +8,7 @@ import ( "sync/atomic" "time" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" abci "github.com/line/ostracon/abci/types" @@ -249,7 +250,7 @@ func (mem *CListMempool) CheckTxSync(tx types.Tx, txInfo TxInfo) (res *abci.Resp // CONTRACT: `app.CheckTxSync()` should check whether `GasWanted` is valid (0 <= GasWanted <= block.masGas) var r *abci.ResponseCheckTx - r, err = mem.proxyAppConn.CheckTxSync(abci.RequestCheckTx{Tx: tx}) + r, err = mem.proxyAppConn.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) if err != nil { return res, err } @@ -295,7 +296,7 @@ func (mem *CListMempool) checkTxAsync(tx types.Tx, txInfo TxInfo, prepareCb func } // CONTRACT: `app.CheckTxAsync()` should check whether `GasWanted` is valid (0 <= GasWanted <= block.masGas) - mem.proxyAppConn.CheckTxAsync(abci.RequestCheckTx{Tx: tx}, func(res *abci.Response) { + mem.proxyAppConn.CheckTxAsync(tmabci.RequestCheckTx{Tx: tx}, func(res *abci.Response) { mem.reqResCb(tx, txInfo.SenderID, txInfo.SenderP2PID, res, func(response *abci.Response) { if checkTxCb != nil { checkTxCb(response) @@ -386,7 +387,7 @@ func (mem *CListMempool) globalCb(req *abci.Request, res *abci.Response) { return } - if checkTxReq.Type == abci.CheckTxType_Recheck { + if checkTxReq.Type == tmabci.CheckTxType_Recheck { mem.metrics.RecheckCount.Add(1) mem.resCbRecheck(req, res) @@ -691,7 +692,7 @@ func (mem *CListMempool) ReapMaxTxs(max int) types.Txs { // Lock() must be held by the caller during execution. func (mem *CListMempool) Update( block *types.Block, - deliverTxResponses []*abci.ResponseDeliverTx, + deliverTxResponses []*tmabci.ResponseDeliverTx, preCheck PreCheckFunc, postCheck PostCheckFunc, ) (err error) { @@ -777,9 +778,9 @@ func (mem *CListMempool) recheckTxs() { wg.Add(1) memTx := e.Value.(*mempoolTx) - req := abci.RequestCheckTx{ + req := tmabci.RequestCheckTx{ Tx: memTx.tx, - Type: abci.CheckTxType_Recheck, + Type: tmabci.CheckTxType_Recheck, } mem.proxyAppConn.CheckTxAsync(req, func(res *abci.Response) { diff --git a/mempool/clist_mempool_system_test.go b/mempool/clist_mempool_system_test.go index 65d9e1bd3..79196b080 100644 --- a/mempool/clist_mempool_system_test.go +++ b/mempool/clist_mempool_system_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/assert" + tmabci "github.com/tendermint/tendermint/abci/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/abci/example/counter" @@ -93,16 +94,16 @@ func sizeOfSyncMap(m *sync.Map) int { } func createProposalBlockAndDeliverTxs( - mem *CListMempool, height int64) (*types.Block, []*abci.ResponseDeliverTx) { + mem *CListMempool, height int64) (*types.Block, []*tmabci.ResponseDeliverTx) { // mempool.lock/unlock in ReapMaxBytesMaxGasMaxTxs txs := mem.ReapMaxBytesMaxGasMaxTxs(mem.config.MaxTxsBytes, 0, int64(mem.config.Size)) block := types.MakeBlock(height, txs, nil, nil, tmversion.Consensus{ Block: version.BlockProtocol, App: version.AppProtocol, }) - deliverTxResponses := make([]*abci.ResponseDeliverTx, len(block.Txs)) + deliverTxResponses := make([]*tmabci.ResponseDeliverTx, len(block.Txs)) for i, tx := range block.Txs { - deliverTxResponses[i] = &abci.ResponseDeliverTx{ + deliverTxResponses[i] = &tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK, Data: tx, } @@ -111,7 +112,7 @@ func createProposalBlockAndDeliverTxs( } func commitBlock(ctx context.Context, t *testing.T, - mem *CListMempool, block *types.Block, deliverTxResponses []*abci.ResponseDeliverTx) { + mem *CListMempool, block *types.Block, deliverTxResponses []*tmabci.ResponseDeliverTx) { mem.Lock() defer mem.Unlock() err := mem.Update(block, deliverTxResponses, nil, nil) diff --git a/mempool/clist_mempool_test.go b/mempool/clist_mempool_test.go index 0d3cab409..0c90b43e4 100644 --- a/mempool/clist_mempool_test.go +++ b/mempool/clist_mempool_test.go @@ -14,6 +14,8 @@ import ( "testing" "time" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" @@ -103,7 +105,7 @@ func TestReapMaxBytesMaxGas(t *testing.T) { tx0 := mempool.TxsFront().Value.(*mempoolTx) // assert that kv store has gas wanted = 1. require.Equal(t, - app.CheckTxSync(abci.RequestCheckTx{Tx: tx0.tx}).GasWanted, int64(1), "KVStore had a gas value neq to 1") + app.CheckTxSync(tmabci.RequestCheckTx{Tx: tx0.tx}).GasWanted, int64(1), "KVStore had a gas value neq to 1") require.Equal(t, tx0.gasWanted, int64(1), "transactions gas was set incorrectly") // ensure each tx is 20 bytes long require.Equal(t, len(tx0.tx), 20, "Tx is longer than 20 bytes") @@ -242,10 +244,10 @@ func TestMempool_KeepInvalidTxsInCache(t *testing.T) { require.NoError(t, err) // simulate new block - _ = app.DeliverTx(abci.RequestDeliverTx{Tx: a}) - _ = app.DeliverTx(abci.RequestDeliverTx{Tx: b}) + _ = app.DeliverTx(tmabci.RequestDeliverTx{Tx: a}) + _ = app.DeliverTx(tmabci.RequestDeliverTx{Tx: b}) err = mempool.Update(newTestBlock(1, []types.Tx{a, b}), - []*abci.ResponseDeliverTx{{Code: abci.CodeTypeOK}, {Code: 2}}, nil, nil) + []*tmabci.ResponseDeliverTx{{Code: abci.CodeTypeOK}, {Code: 2}}, nil, nil) require.NoError(t, err) // a must be added to the cache @@ -327,7 +329,7 @@ func TestTxsAvailable(t *testing.T) { func TestSerialReap(t *testing.T) { app := counter.NewApplication(true) - app.SetOption(abci.RequestSetOption{Key: "serial", Value: "on"}) + app.SetOption(tmabci.RequestSetOption{Key: "serial", Value: "on"}) cc := proxy.NewLocalClientCreator(app) mempool, cleanup := newMempoolWithApp(cc) @@ -384,7 +386,7 @@ func TestSerialReap(t *testing.T) { for i := start; i < end; i++ { txBytes := make([]byte, 8) binary.BigEndian.PutUint64(txBytes, uint64(i)) - res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) + res, err := appConnCon.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) if err != nil { t.Errorf("client error committing tx: %v", err) } @@ -588,7 +590,7 @@ func TestMempoolTxsBytes(t *testing.T) { t.Error(err) } }) - res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) + res, err := appConnCon.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) require.NoError(t, err) require.EqualValues(t, 0, res.Code) res2, err := appConnCon.CommitSync() @@ -694,10 +696,10 @@ func checksumFile(p string, t *testing.T) string { return checksumIt(data) } -func abciResponses(n int, code uint32) []*abci.ResponseDeliverTx { - responses := make([]*abci.ResponseDeliverTx, 0, n) +func abciResponses(n int, code uint32) []*tmabci.ResponseDeliverTx { + responses := make([]*tmabci.ResponseDeliverTx, 0, n) for i := 0; i < n; i++ { - responses = append(responses, &abci.ResponseDeliverTx{Code: code}) + responses = append(responses, &tmabci.ResponseDeliverTx{Code: code}) } return responses } @@ -732,9 +734,9 @@ func TestTxMempoolPostCheckError(t *testing.T) { _, err := mempool.CheckTxSync(tx, TxInfo{}) require.NoError(t, err) - req := abci.RequestCheckTx{ + req := tmabci.RequestCheckTx{ Tx: tx, - Type: abci.CheckTxType_Recheck, + Type: tmabci.CheckTxType_Recheck, } res := &abci.Response{} diff --git a/mempool/mempool.go b/mempool/mempool.go index a13add17d..caf3c3a02 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -3,6 +3,8 @@ package mempool import ( "fmt" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/p2p" "github.com/line/ostracon/types" @@ -44,7 +46,7 @@ type Mempool interface { // NOTE: Lock/Unlock must be managed by caller Update( block *types.Block, - deliverTxResponses []*abci.ResponseDeliverTx, + deliverTxResponses []*tmabci.ResponseDeliverTx, newPreFn PreCheckFunc, newPostFn PostCheckFunc, ) error diff --git a/mempool/mock/mempool.go b/mempool/mock/mempool.go index 3d817854a..dcb6137f0 100644 --- a/mempool/mock/mempool.go +++ b/mempool/mock/mempool.go @@ -1,6 +1,8 @@ package mock import ( + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/clist" mempl "github.com/line/ostracon/mempool" @@ -25,7 +27,7 @@ func (Mempool) ReapMaxBytesMaxGasMaxTxs(_, _, _ int64) types.Txs { return types. func (Mempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} } func (Mempool) Update( _ *types.Block, - _ []*abci.ResponseDeliverTx, + _ []*tmabci.ResponseDeliverTx, _ mempl.PreCheckFunc, _ mempl.PostCheckFunc, ) error { diff --git a/mempool/reactor_test.go b/mempool/reactor_test.go index 15acd97e6..acce31dbf 100644 --- a/mempool/reactor_test.go +++ b/mempool/reactor_test.go @@ -13,10 +13,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" memproto "github.com/tendermint/tendermint/proto/tendermint/mempool" "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" @@ -104,9 +104,9 @@ func TestReactorConcurrency(t *testing.T) { reactors[0].mempool.Lock() defer reactors[0].mempool.Unlock() - deliverTxResponses := make([]*abci.ResponseDeliverTx, len(txs)) + deliverTxResponses := make([]*tmabci.ResponseDeliverTx, len(txs)) for i := range txs { - deliverTxResponses[i] = &abci.ResponseDeliverTx{Code: 0} + deliverTxResponses[i] = &tmabci.ResponseDeliverTx{Code: 0} } err := reactors[0].mempool.Update(newTestBlock(1, txs), deliverTxResponses, nil, nil) assert.NoError(t, err) @@ -121,7 +121,7 @@ func TestReactorConcurrency(t *testing.T) { reactors[1].mempool.Lock() defer reactors[1].mempool.Unlock() err := reactors[1].mempool.Update(newTestBlock(1, []types.Tx{}), - make([]*abci.ResponseDeliverTx, 0), nil, nil) + make([]*tmabci.ResponseDeliverTx, 0), nil, nil) assert.NoError(t, err) }() diff --git a/node/node.go b/node/node.go index e47157de6..2752f7c72 100644 --- a/node/node.go +++ b/node/node.go @@ -13,9 +13,9 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/rs/cors" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" bcv0 "github.com/line/ostracon/blockchain/v0" bcv1 "github.com/line/ostracon/blockchain/v1" bcv2 "github.com/line/ostracon/blockchain/v2" @@ -507,7 +507,7 @@ func createTransport( connFilters, // ABCI query for address filtering. func(_ p2p.ConnSet, c net.Conn, _ []net.IP) error { - res, err := proxyApp.Query().QuerySync(abci.RequestQuery{ + res, err := proxyApp.Query().QuerySync(tmabci.RequestQuery{ Path: fmt.Sprintf("/p2p/filter/addr/%s", c.RemoteAddr().String()), }) if err != nil { @@ -525,7 +525,7 @@ func createTransport( peerFilters, // ABCI query for ID filtering. func(_ p2p.IPeerSet, p p2p.Peer) error { - res, err := proxyApp.Query().QuerySync(abci.RequestQuery{ + res, err := proxyApp.Query().QuerySync(tmabci.RequestQuery{ Path: fmt.Sprintf("/p2p/filter/id/%s", p.ID()), }) if err != nil { diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index 2dbb73992..7a81263c8 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -7,6 +7,7 @@ option go_package = "github.com/line/ostracon/abci/types"; // https://github.com/gogo/protobuf/blob/master/extensions.md import "tendermint/crypto/proof.proto"; import "tendermint/types/params.proto"; +import "tendermint/abci/types.proto"; import "ostracon/types/types.proto"; import "ostracon/crypto/keys.proto"; import "google/protobuf/timestamp.proto"; @@ -21,60 +22,60 @@ import "gogoproto/gogo.proto"; message Request { oneof value { - RequestEcho echo = 1; - RequestFlush flush = 2; - RequestInfo info = 3; - RequestSetOption set_option = 4; + tendermint.abci.RequestEcho echo = 1; + tendermint.abci.RequestFlush flush = 2; + tendermint.abci.RequestInfo info = 3; + tendermint.abci.RequestSetOption set_option = 4; RequestInitChain init_chain = 5; - RequestQuery query = 6; + tendermint.abci.RequestQuery query = 6; RequestBeginBlock begin_block = 7; - RequestCheckTx check_tx = 8; - RequestDeliverTx deliver_tx = 9; - RequestEndBlock end_block = 10; - RequestCommit commit = 11; - RequestListSnapshots list_snapshots = 12; - RequestOfferSnapshot offer_snapshot = 13; - RequestLoadSnapshotChunk load_snapshot_chunk = 14; - RequestApplySnapshotChunk apply_snapshot_chunk = 15; - RequestBeginRecheckTx begin_recheck_tx = 1000; // 16~99 are reserved for merging original tendermint + tendermint.abci.RequestCheckTx check_tx = 8; + tendermint.abci.RequestDeliverTx deliver_tx = 9; + tendermint.abci.RequestEndBlock end_block = 10; + tendermint.abci.RequestCommit commit = 11; + tendermint.abci.RequestListSnapshots list_snapshots = 12; + tendermint.abci.RequestOfferSnapshot offer_snapshot = 13; + tendermint.abci.RequestLoadSnapshotChunk load_snapshot_chunk = 14; + tendermint.abci.RequestApplySnapshotChunk apply_snapshot_chunk = 15; + RequestBeginRecheckTx begin_recheck_tx = 1000; // 16~99 are reserved for merging original tendermint RequestEndRecheckTx end_recheck_tx = 1001; } } -message RequestEcho { - string message = 1; -} +//message RequestEcho { +// string message = 1; +//} -message RequestFlush {} +//message RequestFlush {} -message RequestInfo { - string version = 1; - uint64 block_version = 2; - uint64 p2p_version = 3; -} +//message RequestInfo { +// string version = 1; +// uint64 block_version = 2; +// uint64 p2p_version = 3; +//} // nondeterministic -message RequestSetOption { - string key = 1; - string value = 2; -} +//message RequestSetOption { +// string key = 1; +// string value = 2; +//} message RequestInitChain { google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; string chain_id = 2; - ConsensusParams consensus_params = 3; + tendermint.abci.ConsensusParams consensus_params = 3; repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; bytes app_state_bytes = 5; int64 initial_height = 6; } -message RequestQuery { - bytes data = 1; - string path = 2; - int64 height = 3; - bool prove = 4; -} +//message RequestQuery { +// bytes data = 1; +// string path = 2; +// int64 height = 3; +// bool prove = 4; +//} message RequestBeginBlock { bytes hash = 1; @@ -83,49 +84,49 @@ message RequestBeginBlock { repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; } -enum CheckTxType { - NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; - RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; -} +//enum CheckTxType { +// NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; +// RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; +//} -message RequestCheckTx { - bytes tx = 1; - CheckTxType type = 2; -} +//message RequestCheckTx { +// bytes tx = 1; +// CheckTxType type = 2; +//} -message RequestDeliverTx { - bytes tx = 1; -} +//message RequestDeliverTx { +// bytes tx = 1; +//} -message RequestEndBlock { - int64 height = 1; -} +//message RequestEndBlock { +// int64 height = 1; +//} -message RequestCommit {} +//message RequestCommit {} // lists available snapshots -message RequestListSnapshots { -} +//message RequestListSnapshots { +//} // offers a snapshot to the application -message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height -} +//message RequestOfferSnapshot { +// Snapshot snapshot = 1; // snapshot offered by peers +// bytes app_hash = 2; // light client-verified app hash for snapshot height +//} // loads a snapshot chunk -message RequestLoadSnapshotChunk { - uint64 height = 1; - uint32 format = 2; - uint32 chunk = 3; -} +//message RequestLoadSnapshotChunk { +// uint64 height = 1; +// uint32 format = 2; +// uint32 chunk = 3; +//} // Applies a snapshot chunk -message RequestApplySnapshotChunk { - uint32 index = 1; - bytes chunk = 2; - string sender = 3; -} +//message RequestApplySnapshotChunk { +// uint32 index = 1; +// bytes chunk = 2; +// string sender = 3; +//} message RequestBeginRecheckTx { ostracon.types.Header header = 1 [(gogoproto.nullable) = false]; @@ -140,79 +141,79 @@ message RequestEndRecheckTx { message Response { oneof value { - ResponseException exception = 1; - ResponseEcho echo = 2; - ResponseFlush flush = 3; - ResponseInfo info = 4; - ResponseSetOption set_option = 5; + tendermint.abci.ResponseException exception = 1; + tendermint.abci.ResponseEcho echo = 2; + tendermint.abci.ResponseFlush flush = 3; + tendermint.abci.ResponseInfo info = 4; + tendermint.abci.ResponseSetOption set_option = 5; ResponseInitChain init_chain = 6; - ResponseQuery query = 7; - ResponseBeginBlock begin_block = 8; + tendermint.abci.ResponseQuery query = 7; + tendermint.abci.ResponseBeginBlock begin_block = 8; ResponseCheckTx check_tx = 9; - ResponseDeliverTx deliver_tx = 10; + tendermint.abci.ResponseDeliverTx deliver_tx = 10; ResponseEndBlock end_block = 11; - ResponseCommit commit = 12; - ResponseListSnapshots list_snapshots = 13; - ResponseOfferSnapshot offer_snapshot = 14; - ResponseLoadSnapshotChunk load_snapshot_chunk = 15; - ResponseApplySnapshotChunk apply_snapshot_chunk = 16; - ResponseBeginRecheckTx begin_recheck_tx = 1000; // 17~99 are reserved for merging original tendermint + tendermint.abci.ResponseCommit commit = 12; + tendermint.abci.ResponseListSnapshots list_snapshots = 13; + tendermint.abci.ResponseOfferSnapshot offer_snapshot = 14; + tendermint.abci.ResponseLoadSnapshotChunk load_snapshot_chunk = 15; + tendermint.abci.ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + ResponseBeginRecheckTx begin_recheck_tx = 1000; // 17~99 are reserved for merging original tendermint ResponseEndRecheckTx end_recheck_tx = 1001; } } // nondeterministic -message ResponseException { - string error = 1; -} +//message ResponseException { +// string error = 1; +//} -message ResponseEcho { - string message = 1; -} - -message ResponseFlush {} +//message ResponseEcho { +// string message = 1; +//} -message ResponseInfo { - string data = 1; +//message ResponseFlush {} - string version = 2; - uint64 app_version = 3; - - int64 last_block_height = 4; - bytes last_block_app_hash = 5; -} +//message ResponseInfo { +// string data = 1; +// +// string version = 2; +// uint64 app_version = 3; +// +// int64 last_block_height = 4; +// bytes last_block_app_hash = 5; +//} // nondeterministic -message ResponseSetOption { - uint32 code = 1; - // bytes data = 2; - string log = 3; - string info = 4; -} +//message ResponseSetOption { +// uint32 code = 1; +// // bytes data = 2; +// string log = 3; +// string info = 4; +//} message ResponseInitChain { - ConsensusParams consensus_params = 1; + tendermint.abci.ConsensusParams consensus_params = 1; repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; bytes app_hash = 3; } -message ResponseQuery { - uint32 code = 1; - // bytes data = 2; // use "value" instead. - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 index = 5; - bytes key = 6; - bytes value = 7; - tendermint.crypto.ProofOps proof_ops = 8; - int64 height = 9; - string codespace = 10; -} - -message ResponseBeginBlock { - repeated Event events = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; -} +//message ResponseQuery { +// uint32 code = 1; +// // bytes data = 2; // use "value" instead. +// string log = 3; // nondeterministic +// string info = 4; // nondeterministic +// int64 index = 5; +// bytes key = 6; +// bytes value = 7; +// tendermint.crypto.ProofOps proof_ops = 8; +// int64 height = 9; +// string codespace = 10; +//} + +//message ResponseBeginBlock { +// repeated Event events = 1 +// [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +//} message ResponseCheckTx { uint32 code = 1; @@ -221,7 +222,7 @@ message ResponseCheckTx { string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 + repeated tendermint.abci.Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; string codespace = 8; string sender = 9; // MEMO: not used, just reservation to implement https://github.com/tendermint/tendermint/pull/6740 first @@ -232,67 +233,67 @@ message ResponseCheckTx { string mempool_error = 11; } -message ResponseDeliverTx { - uint32 code = 1; - bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 gas_wanted = 5 [json_name = "gas_wanted"]; - int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic - string codespace = 8; -} +//message ResponseDeliverTx { +// uint32 code = 1; +// bytes data = 2; +// string log = 3; // nondeterministic +// string info = 4; // nondeterministic +// int64 gas_wanted = 5 [json_name = "gas_wanted"]; +// int64 gas_used = 6 [json_name = "gas_used"]; +// repeated Event events = 7 +// [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic +// string codespace = 8; +//} message ResponseEndBlock { repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; - ConsensusParams consensus_param_updates = 2; - repeated Event events = 3 + tendermint.abci.ConsensusParams consensus_param_updates = 2; + repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; } -message ResponseCommit { - // reserve 1 - bytes data = 2; - int64 retain_height = 3; -} - -message ResponseListSnapshots { - repeated Snapshot snapshots = 1; -} - -message ResponseOfferSnapshot { - Result result = 1; - - enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Snapshot accepted, apply chunks - ABORT = 2; // Abort all snapshot restoration - REJECT = 3; // Reject this specific snapshot, try others - REJECT_FORMAT = 4; // Reject all snapshots of this format, try others - REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others - } -} +//message ResponseCommit { +// // reserve 1 +// bytes data = 2; +// int64 retain_height = 3; +//} -message ResponseLoadSnapshotChunk { - bytes chunk = 1; -} +//message ResponseListSnapshots { +// repeated Snapshot snapshots = 1; +//} -message ResponseApplySnapshotChunk { - Result result = 1; - repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply - repeated string reject_senders = 3; // Chunk senders to reject and ban - - enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others - } -} +//message ResponseOfferSnapshot { +// Result result = 1; +// +// enum Result { +// UNKNOWN = 0; // Unknown result, abort all snapshot restoration +// ACCEPT = 1; // Snapshot accepted, apply chunks +// ABORT = 2; // Abort all snapshot restoration +// REJECT = 3; // Reject this specific snapshot, try others +// REJECT_FORMAT = 4; // Reject all snapshots of this format, try others +// REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others +// } +//} + +//message ResponseLoadSnapshotChunk { +// bytes chunk = 1; +//} + +//message ResponseApplySnapshotChunk { +// Result result = 1; +// repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply +// repeated string reject_senders = 3; // Chunk senders to reject and ban +// +// enum Result { +// UNKNOWN = 0; // Unknown result, abort all snapshot restoration +// ACCEPT = 1; // Chunk successfully accepted +// ABORT = 2; // Abort all snapshot restoration +// RETRY = 3; // Retry chunk (combine with refetch and reject) +// RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) +// REJECT_SNAPSHOT = 5; // Reject this snapshot, try others +// } +//} message ResponseBeginRecheckTx { uint32 code = 1; @@ -307,20 +308,20 @@ message ResponseEndRecheckTx { // ConsensusParams contains all consensus-relevant parameters // that can be adjusted by the abci app -message ConsensusParams { - BlockParams block = 1; - tendermint.types.EvidenceParams evidence = 2; - tendermint.types.ValidatorParams validator = 3; - tendermint.types.VersionParams version = 4; -} +//message ConsensusParams { +// BlockParams block = 1; +// tendermint.types.EvidenceParams evidence = 2; +// tendermint.types.ValidatorParams validator = 3; +// tendermint.types.VersionParams version = 4; +//} // BlockParams contains limits on the block size. -message BlockParams { - // Note: must be greater than 0 - int64 max_bytes = 1; - // Note: must be greater or equal to -1 - int64 max_gas = 2; -} +//message BlockParams { +// // Note: must be greater than 0 +// int64 max_bytes = 1; +// // Note: must be greater or equal to -1 +// int64 max_gas = 2; +//} message LastCommitInfo { int32 round = 1; @@ -330,30 +331,30 @@ message LastCommitInfo { // Event allows application developers to attach additional information to // ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. // Later, transactions may be queried using these events. -message Event { - string type = 1; - repeated EventAttribute attributes = 2 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "attributes,omitempty" - ]; -} +//message Event { +// string type = 1; +// repeated EventAttribute attributes = 2 [ +// (gogoproto.nullable) = false, +// (gogoproto.jsontag) = "attributes,omitempty" +// ]; +//} // EventAttribute is a single key-value pair, associated with an event. -message EventAttribute { - bytes key = 1; - bytes value = 2; - bool index = 3; // nondeterministic -} +//message EventAttribute { +// bytes key = 1; +// bytes value = 2; +// bool index = 3; // nondeterministic +//} // TxResult contains results of executing the transaction. // // One usage is indexing transaction results. -message TxResult { - int64 height = 1; - uint32 index = 2; - bytes tx = 3; - ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; -} +//message TxResult { +// int64 height = 1; +// uint32 index = 2; +// bytes tx = 3; +// ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; +//} //---------------------------------------- // Blockchain Types @@ -377,14 +378,14 @@ message VoteInfo { bool signed_last_block = 2; } -enum EvidenceType { - UNKNOWN = 0; - DUPLICATE_VOTE = 1; - LIGHT_CLIENT_ATTACK = 2; -} +//enum EvidenceType { +// UNKNOWN = 0; +// DUPLICATE_VOTE = 1; +// LIGHT_CLIENT_ATTACK = 2; +//} message Evidence { - EvidenceType type = 1; + tendermint.abci.EvidenceType type = 1; // The offending validator Validator validator = 2 [(gogoproto.nullable) = false]; // The height when the offense occurred @@ -403,33 +404,33 @@ message Evidence { //---------------------------------------- // State Sync Types -message Snapshot { - uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot - bytes hash = 4; // Arbitrary snapshot hash, equal only if identical - bytes metadata = 5; // Arbitrary application metadata -} +//message Snapshot { +// uint64 height = 1; // The height at which the snapshot was taken +// uint32 format = 2; // The application-specific snapshot format +// uint32 chunks = 3; // Number of chunks in the snapshot +// bytes hash = 4; // Arbitrary snapshot hash, equal only if identical +// bytes metadata = 5; // Arbitrary application metadata +//} //---------------------------------------- // Service Definition service ABCIApplication { - rpc Echo(RequestEcho) returns (ResponseEcho); - rpc Flush(RequestFlush) returns (ResponseFlush); - rpc Info(RequestInfo) returns (ResponseInfo); - rpc SetOption(RequestSetOption) returns (ResponseSetOption); - rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); - rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); - rpc Query(RequestQuery) returns (ResponseQuery); - rpc Commit(RequestCommit) returns (ResponseCommit); + rpc Echo(tendermint.abci.RequestEcho) returns (tendermint.abci.ResponseEcho); + rpc Flush(tendermint.abci.RequestFlush) returns (tendermint.abci.ResponseFlush); + rpc Info(tendermint.abci.RequestInfo) returns (tendermint.abci.ResponseInfo); + rpc SetOption(tendermint.abci.RequestSetOption) returns (tendermint.abci.ResponseSetOption); + rpc DeliverTx(tendermint.abci.RequestDeliverTx) returns (tendermint.abci.ResponseDeliverTx); + rpc CheckTx(tendermint.abci.RequestCheckTx) returns (ResponseCheckTx); + rpc Query(tendermint.abci.RequestQuery) returns (tendermint.abci.ResponseQuery); + rpc Commit(tendermint.abci.RequestCommit) returns (tendermint.abci.ResponseCommit); rpc InitChain(RequestInitChain) returns (ResponseInitChain); - rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); - rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); - rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); - rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); - rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); - rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); + rpc BeginBlock(RequestBeginBlock) returns (tendermint.abci.ResponseBeginBlock); + rpc EndBlock(tendermint.abci.RequestEndBlock) returns (ResponseEndBlock); + rpc ListSnapshots(tendermint.abci.RequestListSnapshots) returns (tendermint.abci.ResponseListSnapshots); + rpc OfferSnapshot(tendermint.abci.RequestOfferSnapshot) returns (tendermint.abci.ResponseOfferSnapshot); + rpc LoadSnapshotChunk(tendermint.abci.RequestLoadSnapshotChunk) returns (tendermint.abci.ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(tendermint.abci.RequestApplySnapshotChunk) returns (tendermint.abci.ResponseApplySnapshotChunk); rpc BeginRecheckTx(RequestBeginRecheckTx) returns (ResponseBeginRecheckTx); rpc EndRecheckTx(RequestEndRecheckTx) returns (ResponseEndRecheckTx); } diff --git a/proto/ostracon/rpc/grpc/types.proto b/proto/ostracon/rpc/grpc/types.proto index 0b39c9ec1..b6d933a7c 100644 --- a/proto/ostracon/rpc/grpc/types.proto +++ b/proto/ostracon/rpc/grpc/types.proto @@ -3,6 +3,7 @@ package ostracon.rpc.grpc; option go_package = "github.com/line/ostracon/rpc/grpc;coregrpc"; import "ostracon/abci/types.proto"; +import "tendermint/abci/types.proto"; //---------------------------------------- // Request types @@ -20,7 +21,7 @@ message ResponsePing {} message ResponseBroadcastTx { ostracon.abci.ResponseCheckTx check_tx = 1; - ostracon.abci.ResponseDeliverTx deliver_tx = 2; + tendermint.abci.ResponseDeliverTx deliver_tx = 2; } //---------------------------------------- diff --git a/proto/ostracon/state/types.pb.go b/proto/ostracon/state/types.pb.go index 740541cf3..53145af5c 100644 --- a/proto/ostracon/state/types.pb.go +++ b/proto/ostracon/state/types.pb.go @@ -9,10 +9,11 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - types "github.com/line/ostracon/abci/types" - types1 "github.com/line/ostracon/proto/ostracon/types" + types1 "github.com/line/ostracon/abci/types" + types2 "github.com/line/ostracon/proto/ostracon/types" + types "github.com/tendermint/tendermint/abci/types" state "github.com/tendermint/tendermint/proto/tendermint/state" - types2 "github.com/tendermint/tendermint/proto/tendermint/types" + types3 "github.com/tendermint/tendermint/proto/tendermint/types" _ "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" @@ -37,7 +38,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // It is persisted to disk for each height before calling Commit. type ABCIResponses struct { DeliverTxs []*types.ResponseDeliverTx `protobuf:"bytes,1,rep,name=deliver_txs,json=deliverTxs,proto3" json:"deliver_txs,omitempty"` - EndBlock *types.ResponseEndBlock `protobuf:"bytes,2,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` + EndBlock *types1.ResponseEndBlock `protobuf:"bytes,2,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` BeginBlock *types.ResponseBeginBlock `protobuf:"bytes,3,opt,name=begin_block,json=beginBlock,proto3" json:"begin_block,omitempty"` } @@ -81,7 +82,7 @@ func (m *ABCIResponses) GetDeliverTxs() []*types.ResponseDeliverTx { return nil } -func (m *ABCIResponses) GetEndBlock() *types.ResponseEndBlock { +func (m *ABCIResponses) GetEndBlock() *types1.ResponseEndBlock { if m != nil { return m.EndBlock } @@ -97,7 +98,7 @@ func (m *ABCIResponses) GetBeginBlock() *types.ResponseBeginBlock { // ValidatorsInfo represents the latest validator set, or the last height it changed type ValidatorsInfo struct { - ValidatorSet *types1.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + ValidatorSet *types2.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"` } @@ -134,7 +135,7 @@ func (m *ValidatorsInfo) XXX_DiscardUnknown() { var xxx_messageInfo_ValidatorsInfo proto.InternalMessageInfo -func (m *ValidatorsInfo) GetValidatorSet() *types1.ValidatorSet { +func (m *ValidatorsInfo) GetValidatorSet() *types2.ValidatorSet { if m != nil { return m.ValidatorSet } @@ -155,7 +156,7 @@ type State struct { InitialHeight int64 `protobuf:"varint,14,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockID types2.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` + LastBlockID types3.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` // LastValidators is used to validate block.LastCommit. // Validators are persisted to the database separately every time they change, @@ -163,13 +164,13 @@ type State struct { // Note that if s.LastBlockHeight causes a valset change, // we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1 // Extra +1 due to nextValSet delay. - NextValidators *types1.ValidatorSet `protobuf:"bytes,6,opt,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"` - Validators *types1.ValidatorSet `protobuf:"bytes,7,opt,name=validators,proto3" json:"validators,omitempty"` - LastValidators *types1.ValidatorSet `protobuf:"bytes,8,opt,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"` + NextValidators *types2.ValidatorSet `protobuf:"bytes,6,opt,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"` + Validators *types2.ValidatorSet `protobuf:"bytes,7,opt,name=validators,proto3" json:"validators,omitempty"` + LastValidators *types2.ValidatorSet `protobuf:"bytes,8,opt,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"` LastHeightValidatorsChanged int64 `protobuf:"varint,9,opt,name=last_height_validators_changed,json=lastHeightValidatorsChanged,proto3" json:"last_height_validators_changed,omitempty"` // Consensus parameters used for validating blocks. // Changes returned by EndBlock and updated after Commit. - ConsensusParams types2.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` + ConsensusParams types3.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` LastHeightConsensusParamsChanged int64 `protobuf:"varint,11,opt,name=last_height_consensus_params_changed,json=lastHeightConsensusParamsChanged,proto3" json:"last_height_consensus_params_changed,omitempty"` // Merkle root of the results from executing prev block LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` @@ -240,11 +241,11 @@ func (m *State) GetLastBlockHeight() int64 { return 0 } -func (m *State) GetLastBlockID() types2.BlockID { +func (m *State) GetLastBlockID() types3.BlockID { if m != nil { return m.LastBlockID } - return types2.BlockID{} + return types3.BlockID{} } func (m *State) GetLastBlockTime() time.Time { @@ -254,21 +255,21 @@ func (m *State) GetLastBlockTime() time.Time { return time.Time{} } -func (m *State) GetNextValidators() *types1.ValidatorSet { +func (m *State) GetNextValidators() *types2.ValidatorSet { if m != nil { return m.NextValidators } return nil } -func (m *State) GetValidators() *types1.ValidatorSet { +func (m *State) GetValidators() *types2.ValidatorSet { if m != nil { return m.Validators } return nil } -func (m *State) GetLastValidators() *types1.ValidatorSet { +func (m *State) GetLastValidators() *types2.ValidatorSet { if m != nil { return m.LastValidators } @@ -282,11 +283,11 @@ func (m *State) GetLastHeightValidatorsChanged() int64 { return 0 } -func (m *State) GetConsensusParams() types2.ConsensusParams { +func (m *State) GetConsensusParams() types3.ConsensusParams { if m != nil { return m.ConsensusParams } - return types2.ConsensusParams{} + return types3.ConsensusParams{} } func (m *State) GetLastHeightConsensusParamsChanged() int64 { @@ -326,54 +327,55 @@ func init() { func init() { proto.RegisterFile("ostracon/state/types.proto", fileDescriptor_898987a4421067cd) } var fileDescriptor_898987a4421067cd = []byte{ - // 744 bytes of a gzipped FileDescriptorProto + // 754 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x4f, 0xdb, 0x4a, - 0x14, 0x8d, 0x5f, 0x80, 0x84, 0x31, 0x49, 0xde, 0x1b, 0xde, 0xc2, 0xa4, 0xd4, 0x49, 0x51, 0x3f, - 0x50, 0xa5, 0x3a, 0x12, 0x5d, 0x55, 0x62, 0x83, 0x13, 0x54, 0x22, 0xa1, 0x0a, 0x19, 0xc4, 0xa2, - 0x1b, 0x6b, 0x62, 0x0f, 0xf6, 0xa8, 0x8e, 0xc7, 0xf2, 0x4c, 0x22, 0xba, 0x6e, 0x7f, 0x00, 0x3f, - 0x8b, 0x25, 0x8b, 0x2e, 0xba, 0xa2, 0x55, 0xd8, 0xf4, 0x67, 0x54, 0x33, 0x63, 0x3b, 0x0e, 0x11, - 0x52, 0x76, 0xe3, 0x7b, 0xce, 0x3d, 0x3e, 0xbe, 0xf7, 0xd8, 0x06, 0x6d, 0xca, 0x78, 0x8a, 0x3c, - 0x1a, 0xf7, 0x18, 0x47, 0x1c, 0xf7, 0xf8, 0xd7, 0x04, 0x33, 0x2b, 0x49, 0x29, 0xa7, 0xb0, 0x99, - 0x63, 0x96, 0xc4, 0xda, 0xff, 0x07, 0x34, 0xa0, 0x12, 0xea, 0x89, 0x93, 0x62, 0xb5, 0x77, 0x0a, - 0x05, 0x34, 0xf2, 0x48, 0x59, 0xa0, 0x3d, 0x17, 0x97, 0xd5, 0x05, 0xcc, 0x7c, 0x84, 0x4d, 0x51, - 0x44, 0x7c, 0xc4, 0x69, 0x9a, 0xe1, 0xcf, 0x39, 0x8e, 0x7d, 0x9c, 0x8e, 0x49, 0xc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0xdc, 0x2d, 0xd6, 0xc4, 0x8c, 0x8d, - 0x15, 0xd6, 0xda, 0x14, 0x4d, 0xf3, 0x7c, 0xc0, 0x43, 0x00, 0x4a, 0x0a, 0xb5, 0x15, 0x14, 0x4a, - 0x7c, 0x61, 0x42, 0x3e, 0x52, 0x49, 0xa2, 0xbe, 0x8a, 0x09, 0xd1, 0x54, 0x32, 0xd1, 0x07, 0x66, - 0x39, 0x5d, 0x73, 0xb5, 0x22, 0x68, 0x9b, 0x72, 0x4d, 0xcf, 0xe6, 0x41, 0x9b, 0x77, 0x67, 0x91, - 0x83, 0x0e, 0xf8, 0xd7, 0x13, 0xef, 0x45, 0xcc, 0x26, 0xcc, 0x55, 0x1f, 0x21, 0x03, 0x64, 0x6f, - 0xd0, 0xd2, 0xd6, 0xfa, 0x39, 0xf3, 0x4c, 0x12, 0xb3, 0xe4, 0xb5, 0xbc, 0xc5, 0x32, 0xfc, 0x04, - 0x5e, 0x2e, 0xc4, 0xfe, 0x91, 0x7e, 0x61, 0x4f, 0x97, 0xf6, 0xba, 0xa5, 0xf7, 0x60, 0x51, 0x28, - 0xf7, 0x98, 0x47, 0x30, 0xc5, 0x6c, 0x12, 0x71, 0xe6, 0x86, 0x88, 0x85, 0xc6, 0x56, 0x57, 0xdb, - 0xdf, 0x52, 0x11, 0x74, 0x54, 0xfd, 0x04, 0xb1, 0x10, 0xee, 0x80, 0x3a, 0x4a, 0x12, 0x45, 0x69, - 0x48, 0x4a, 0x0d, 0x25, 0x89, 0x84, 0xde, 0x64, 0x63, 0x4f, 0x52, 0x4a, 0xaf, 0x14, 0xe3, 0x4f, - 0x4d, 0x52, 0x64, 0x48, 0xce, 0x44, 0x59, 0x10, 0xed, 0x8f, 0xb7, 0x33, 0x53, 0xbb, 0x9b, 0x99, - 0xda, 0xef, 0x99, 0xa9, 0xdd, 0x3c, 0x98, 0x95, 0xbb, 0x07, 0xb3, 0xf2, 0xf3, 0xc1, 0xac, 0x7c, - 0x7e, 0x17, 0x10, 0x1e, 0x4e, 0x46, 0x96, 0x47, 0xc7, 0xbd, 0x88, 0xc4, 0xb8, 0x57, 0x7c, 0xe7, - 0xd5, 0x9f, 0x63, 0xf1, 0x7f, 0x33, 0xda, 0x90, 0xd5, 0xf7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, - 0x8d, 0xa7, 0x16, 0x58, 0x88, 0x06, 0x00, 0x00, + 0x14, 0x8d, 0x5f, 0x80, 0x84, 0x31, 0x49, 0xde, 0x1b, 0xde, 0xc2, 0x04, 0x9e, 0x93, 0x97, 0xf7, + 0x51, 0x54, 0xa9, 0x8e, 0x44, 0x57, 0x95, 0xd8, 0xe0, 0x04, 0x95, 0x48, 0xa8, 0x42, 0x06, 0xb1, + 0xe8, 0xc6, 0x9a, 0xd8, 0x83, 0x3d, 0xaa, 0xe3, 0xb1, 0x3c, 0x93, 0x88, 0xae, 0xdb, 0x1f, 0xc0, + 0xcf, 0x62, 0xc9, 0x92, 0x15, 0xad, 0xc2, 0xa6, 0x3f, 0xa3, 0x9a, 0x19, 0xdb, 0x71, 0x88, 0x2a, + 0x65, 0x37, 0xbe, 0xe7, 0xdc, 0x33, 0x67, 0xee, 0xbd, 0xe3, 0x01, 0x6d, 0xca, 0x78, 0x8a, 0x3c, + 0x1a, 0xf7, 0x19, 0x47, 0x1c, 0xf7, 0xf9, 0xe7, 0x04, 0x33, 0x2b, 0x49, 0x29, 0xa7, 0xb0, 0x99, + 0x63, 0x96, 0xc4, 0xda, 0x7f, 0x06, 0x34, 0xa0, 0x12, 0xea, 0x8b, 0x95, 0x62, 0xb5, 0xf7, 0x0a, + 0x05, 0x34, 0xf6, 0x48, 0x59, 0xa0, 0xbd, 0x10, 0x97, 0xd1, 0x25, 0xcc, 0x7c, 0x81, 0xcd, 0x50, + 0x44, 0x7c, 0xc4, 0x69, 0x9a, 0xe1, 0x7f, 0x71, 0x1c, 0xfb, 0x38, 0x9d, 0x90, 0x98, 0x67, 0x8c, + 0x04, 0xa5, 0x68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, 0xb3, 0x59, 0xf9, 0xf8, 0x26, 0x20, 0x3c, 0x9c, 0x8e, + 0x2d, 0x8f, 0x4e, 0xfa, 0x11, 0x89, 0x71, 0xbf, 0x78, 0x08, 0xd4, 0xd3, 0xb2, 0xfc, 0x20, 0x8d, + 0xb7, 0x64, 0xf4, 0xed, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0x5a, 0xa7, 0xe8, 0xa9, 0x06, + 0x00, 0x00, } func (m *ABCIResponses) Marshal() (dAtA []byte, err error) { @@ -830,7 +832,7 @@ func (m *ABCIResponses) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.EndBlock == nil { - m.EndBlock = &types.ResponseEndBlock{} + m.EndBlock = &types1.ResponseEndBlock{} } if err := m.EndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -952,7 +954,7 @@ func (m *ValidatorsInfo) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.ValidatorSet == nil { - m.ValidatorSet = &types1.ValidatorSet{} + m.ValidatorSet = &types2.ValidatorSet{} } if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1207,7 +1209,7 @@ func (m *State) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.NextValidators == nil { - m.NextValidators = &types1.ValidatorSet{} + m.NextValidators = &types2.ValidatorSet{} } if err := m.NextValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1243,7 +1245,7 @@ func (m *State) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Validators == nil { - m.Validators = &types1.ValidatorSet{} + m.Validators = &types2.ValidatorSet{} } if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1279,7 +1281,7 @@ func (m *State) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.LastValidators == nil { - m.LastValidators = &types1.ValidatorSet{} + m.LastValidators = &types2.ValidatorSet{} } if err := m.LastValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index 314a08840..6e487f31d 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -13,14 +13,15 @@ import "tendermint/version/types.proto"; import "google/protobuf/timestamp.proto"; import "tendermint/types/types.proto"; import "tendermint/state/types.proto"; +import "tendermint/abci/types.proto"; // ABCIResponses retains the responses // of the various ABCI calls during block processing. // It is persisted to disk for each height before calling Commit. message ABCIResponses { - repeated ostracon.abci.ResponseDeliverTx deliver_txs = 1; + repeated tendermint.abci.ResponseDeliverTx deliver_txs = 1; ostracon.abci.ResponseEndBlock end_block = 2; - ostracon.abci.ResponseBeginBlock begin_block = 3; + tendermint.abci.ResponseBeginBlock begin_block = 3; } // ValidatorsInfo represents the latest validator set, or the last height it changed diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 9be854cf3..06ab4d489 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -1,8 +1,10 @@ package proxy import ( + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" ) //nolint @@ -15,45 +17,45 @@ type AppConnConsensus interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error) + InitChainSync(abci.RequestInitChain) (*abci.ResponseInitChain, error) - BeginBlockSync(types.RequestBeginBlock) (*types.ResponseBeginBlock, error) - DeliverTxAsync(types.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes - EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error) - CommitSync() (*types.ResponseCommit, error) + BeginBlockSync(abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) + DeliverTxAsync(tmabci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes + EndBlockSync(tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) + CommitSync() (*tmabci.ResponseCommit, error) } type AppConnMempool interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - CheckTxAsync(types.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes - CheckTxSync(types.RequestCheckTx) (*types.ResponseCheckTx, error) + CheckTxAsync(tmabci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes + CheckTxSync(tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) - BeginRecheckTxSync(types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) - EndRecheckTxSync(types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) + BeginRecheckTxSync(abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) + EndRecheckTxSync(abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) FlushAsync(abcicli.ResponseCallback) *abcicli.ReqRes - FlushSync() (*types.ResponseFlush, error) + FlushSync() (*tmabci.ResponseFlush, error) } type AppConnQuery interface { Error() error - EchoSync(string) (*types.ResponseEcho, error) - InfoSync(types.RequestInfo) (*types.ResponseInfo, error) - QuerySync(types.RequestQuery) (*types.ResponseQuery, error) + EchoSync(string) (*tmabci.ResponseEcho, error) + InfoSync(tmabci.RequestInfo) (*tmabci.ResponseInfo, error) + QuerySync(tmabci.RequestQuery) (*tmabci.ResponseQuery, error) - // SetOptionSync(key string, value string) (res types.Result) + // SetOptionSync(key string, value string) (res abci.Result) } type AppConnSnapshot interface { Error() error - ListSnapshotsSync(types.RequestListSnapshots) (*types.ResponseListSnapshots, error) - OfferSnapshotSync(types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) - LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunkSync(types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) + ListSnapshotsSync(tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) + OfferSnapshotSync(tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) + LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) } //----------------------------------------------------------------------------------------- @@ -77,23 +79,23 @@ func (app *appConnConsensus) Error() error { return app.appConn.Error() } -func (app *appConnConsensus) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { +func (app *appConnConsensus) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { return app.appConn.InitChainSync(req) } -func (app *appConnConsensus) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { +func (app *appConnConsensus) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { return app.appConn.BeginBlockSync(req) } -func (app *appConnConsensus) DeliverTxAsync(req types.RequestDeliverTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { +func (app *appConnConsensus) DeliverTxAsync(req tmabci.RequestDeliverTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { return app.appConn.DeliverTxAsync(req, cb) } -func (app *appConnConsensus) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { +func (app *appConnConsensus) EndBlockSync(req tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { return app.appConn.EndBlockSync(req) } -func (app *appConnConsensus) CommitSync() (*types.ResponseCommit, error) { +func (app *appConnConsensus) CommitSync() (*tmabci.ResponseCommit, error) { return app.appConn.CommitSync() } @@ -122,23 +124,23 @@ func (app *appConnMempool) FlushAsync(cb abcicli.ResponseCallback) *abcicli.ReqR return app.appConn.FlushAsync(cb) } -func (app *appConnMempool) FlushSync() (*types.ResponseFlush, error) { +func (app *appConnMempool) FlushSync() (*tmabci.ResponseFlush, error) { return app.appConn.FlushSync() } -func (app *appConnMempool) CheckTxAsync(req types.RequestCheckTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { +func (app *appConnMempool) CheckTxAsync(req tmabci.RequestCheckTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { return app.appConn.CheckTxAsync(req, cb) } -func (app *appConnMempool) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (app *appConnMempool) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { return app.appConn.CheckTxSync(req) } -func (app *appConnMempool) BeginRecheckTxSync(req types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) { +func (app *appConnMempool) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { return app.appConn.BeginRecheckTxSync(req) } -func (app *appConnMempool) EndRecheckTxSync(req types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) { +func (app *appConnMempool) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { return app.appConn.EndRecheckTxSync(req) } @@ -159,15 +161,15 @@ func (app *appConnQuery) Error() error { return app.appConn.Error() } -func (app *appConnQuery) EchoSync(msg string) (*types.ResponseEcho, error) { +func (app *appConnQuery) EchoSync(msg string) (*tmabci.ResponseEcho, error) { return app.appConn.EchoSync(msg) } -func (app *appConnQuery) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { +func (app *appConnQuery) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { return app.appConn.InfoSync(req) } -func (app *appConnQuery) QuerySync(reqQuery types.RequestQuery) (*types.ResponseQuery, error) { +func (app *appConnQuery) QuerySync(reqQuery tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { return app.appConn.QuerySync(reqQuery) } @@ -188,20 +190,20 @@ func (app *appConnSnapshot) Error() error { return app.appConn.Error() } -func (app *appConnSnapshot) ListSnapshotsSync(req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (app *appConnSnapshot) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { return app.appConn.ListSnapshotsSync(req) } -func (app *appConnSnapshot) OfferSnapshotSync(req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (app *appConnSnapshot) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { return app.appConn.OfferSnapshotSync(req) } func (app *appConnSnapshot) LoadSnapshotChunkSync( - req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { + req tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { return app.appConn.LoadSnapshotChunkSync(req) } func (app *appConnSnapshot) ApplySnapshotChunkSync( - req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { + req tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { return app.appConn.ApplySnapshotChunkSync(req) } diff --git a/proxy/app_conn_test.go b/proxy/app_conn_test.go index f802567e1..55dfafb43 100644 --- a/proxy/app_conn_test.go +++ b/proxy/app_conn_test.go @@ -5,10 +5,11 @@ import ( "strings" "testing" + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" "github.com/line/ostracon/abci/server" - "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" ) @@ -16,9 +17,9 @@ import ( //---------------------------------------- type AppConnTest interface { - FlushSync() (*types.ResponseFlush, error) + FlushSync() (*tmabci.ResponseFlush, error) EchoAsync(string, abcicli.ResponseCallback) *abcicli.ReqRes - InfoSync(types.RequestInfo) (*types.ResponseInfo, error) + InfoSync(tmabci.RequestInfo) (*tmabci.ResponseInfo, error) } type appConnTest struct { @@ -33,11 +34,11 @@ func (app *appConnTest) EchoAsync(msg string, cb abcicli.ResponseCallback) *abci return app.appConn.EchoAsync(msg, cb) } -func (app *appConnTest) FlushSync() (*types.ResponseFlush, error) { +func (app *appConnTest) FlushSync() (*tmabci.ResponseFlush, error) { return app.appConn.FlushSync() } -func (app *appConnTest) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { +func (app *appConnTest) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { return app.appConn.InfoSync(req) } @@ -124,7 +125,7 @@ func BenchmarkEcho(b *testing.B) { } b.StopTimer() - // info := proxy.InfoSync(types.RequestInfo{""}) + // info := proxy.InfoSync(tmabci.RequestInfo{""}) // b.Log("N: ", b.N, info) } diff --git a/proxy/client.go b/proxy/client.go index 59f1d73fe..cb034b5b0 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -6,7 +6,7 @@ import ( abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/counter" "github.com/line/ostracon/abci/example/kvstore" - "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" tmsync "github.com/line/ostracon/libs/sync" e2e "github.com/line/ostracon/test/e2e/app" ) @@ -22,12 +22,12 @@ type ClientCreator interface { type localClientCreator struct { mtx *tmsync.Mutex - app types.Application + app abci.Application } // NewLocalClientCreator returns a ClientCreator for the given app, // which will be running locally. -func NewLocalClientCreator(app types.Application) ClientCreator { +func NewLocalClientCreator(app abci.Application) ClientCreator { return &localClientCreator{ mtx: new(tmsync.Mutex), app: app, @@ -87,7 +87,7 @@ func DefaultClientCreator(addr, transport, dbDir string) ClientCreator { } return NewLocalClientCreator(app) case "noop": - return NewLocalClientCreator(types.NewBaseApplication()) + return NewLocalClientCreator(abci.NewBaseApplication()) default: mustConnect := false // loop retrying return NewRemoteClientCreator(addr, transport, mustConnect) diff --git a/proxy/mocks/app_conn_consensus.go b/proxy/mocks/app_conn_consensus.go index f6288916f..9c28df4a6 100644 --- a/proxy/mocks/app_conn_consensus.go +++ b/proxy/mocks/app_conn_consensus.go @@ -3,10 +3,11 @@ package mocks import ( + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" + abci "github.com/line/ostracon/abci/types" mock "github.com/stretchr/testify/mock" - - types "github.com/line/ostracon/abci/types" ) // AppConnConsensus is an autogenerated mock type for the AppConnConsensus type @@ -15,20 +16,20 @@ type AppConnConsensus struct { } // BeginBlockSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) BeginBlockSync(_a0 types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { +func (_m *AppConnConsensus) BeginBlockSync(_a0 abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { ret := _m.Called(_a0) - var r0 *types.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(types.RequestBeginBlock) *types.ResponseBeginBlock); ok { + var r0 *tmabci.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(abci.RequestBeginBlock) *tmabci.ResponseBeginBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseBeginBlock) + r0 = ret.Get(0).(*tmabci.ResponseBeginBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestBeginBlock) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestBeginBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -38,15 +39,15 @@ func (_m *AppConnConsensus) BeginBlockSync(_a0 types.RequestBeginBlock) (*types. } // CommitSync provides a mock function with given fields: -func (_m *AppConnConsensus) CommitSync() (*types.ResponseCommit, error) { +func (_m *AppConnConsensus) CommitSync() (*tmabci.ResponseCommit, error) { ret := _m.Called() - var r0 *types.ResponseCommit - if rf, ok := ret.Get(0).(func() *types.ResponseCommit); ok { + var r0 *tmabci.ResponseCommit + if rf, ok := ret.Get(0).(func() *tmabci.ResponseCommit); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseCommit) + r0 = ret.Get(0).(*tmabci.ResponseCommit) } } @@ -61,11 +62,11 @@ func (_m *AppConnConsensus) CommitSync() (*types.ResponseCommit, error) { } // DeliverTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) DeliverTxAsync(_a0 types.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *AppConnConsensus) DeliverTxAsync(_a0 tmabci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -77,20 +78,20 @@ func (_m *AppConnConsensus) DeliverTxAsync(_a0 types.RequestDeliverTx, _a1 abcic } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) EndBlockSync(_a0 types.RequestEndBlock) (*types.ResponseEndBlock, error) { +func (_m *AppConnConsensus) EndBlockSync(_a0 tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *types.ResponseEndBlock - if rf, ok := ret.Get(0).(func(types.RequestEndBlock) *types.ResponseEndBlock); ok { + var r0 *abci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock) *abci.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseEndBlock) + r0 = ret.Get(0).(*abci.ResponseEndBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestEndBlock) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestEndBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -114,20 +115,20 @@ func (_m *AppConnConsensus) Error() error { } // InitChainSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) InitChainSync(_a0 types.RequestInitChain) (*types.ResponseInitChain, error) { +func (_m *AppConnConsensus) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *types.ResponseInitChain - if rf, ok := ret.Get(0).(func(types.RequestInitChain) *types.ResponseInitChain); ok { + var r0 *abci.ResponseInitChain + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseInitChain) + r0 = ret.Get(0).(*abci.ResponseInitChain) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_mempool.go b/proxy/mocks/app_conn_mempool.go index 446687a69..5e5b62a61 100644 --- a/proxy/mocks/app_conn_mempool.go +++ b/proxy/mocks/app_conn_mempool.go @@ -3,9 +3,10 @@ package mocks import ( - abcicli "github.com/line/ostracon/abci/client" mock "github.com/stretchr/testify/mock" + tmabci "github.com/tendermint/tendermint/abci/types" + abcicli "github.com/line/ostracon/abci/client" types "github.com/line/ostracon/abci/types" ) @@ -38,11 +39,11 @@ func (_m *AppConnMempool) BeginRecheckTxSync(_a0 types.RequestBeginRecheckTx) (* } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *AppConnMempool) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *AppConnMempool) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(types.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -54,11 +55,11 @@ func (_m *AppConnMempool) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcicli.Res } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *AppConnMempool) CheckTxSync(_a0 types.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (_m *AppConnMempool) CheckTxSync(_a0 tmabci.RequestCheckTx) (*types.ResponseCheckTx, error) { ret := _m.Called(_a0) var r0 *types.ResponseCheckTx - if rf, ok := ret.Get(0).(func(types.RequestCheckTx) *types.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { @@ -67,7 +68,7 @@ func (_m *AppConnMempool) CheckTxSync(_a0 types.RequestCheckTx) (*types.Response } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestCheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -130,15 +131,15 @@ func (_m *AppConnMempool) FlushAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqR } // FlushSync provides a mock function with given fields: -func (_m *AppConnMempool) FlushSync() (*types.ResponseFlush, error) { +func (_m *AppConnMempool) FlushSync() (*tmabci.ResponseFlush, error) { ret := _m.Called() - var r0 *types.ResponseFlush - if rf, ok := ret.Get(0).(func() *types.ResponseFlush); ok { + var r0 *tmabci.ResponseFlush + if rf, ok := ret.Get(0).(func() *tmabci.ResponseFlush); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseFlush) + r0 = ret.Get(0).(*tmabci.ResponseFlush) } } diff --git a/proxy/mocks/app_conn_query.go b/proxy/mocks/app_conn_query.go index 43505497a..3c7100770 100644 --- a/proxy/mocks/app_conn_query.go +++ b/proxy/mocks/app_conn_query.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - types "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" ) // AppConnQuery is an autogenerated mock type for the AppConnQuery type @@ -14,15 +14,15 @@ type AppConnQuery struct { } // EchoSync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) EchoSync(_a0 string) (*types.ResponseEcho, error) { +func (_m *AppConnQuery) EchoSync(_a0 string) (*tmabci.ResponseEcho, error) { ret := _m.Called(_a0) - var r0 *types.ResponseEcho - if rf, ok := ret.Get(0).(func(string) *types.ResponseEcho); ok { + var r0 *tmabci.ResponseEcho + if rf, ok := ret.Get(0).(func(string) *tmabci.ResponseEcho); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseEcho) + r0 = ret.Get(0).(*tmabci.ResponseEcho) } } @@ -51,20 +51,20 @@ func (_m *AppConnQuery) Error() error { } // InfoSync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) InfoSync(_a0 types.RequestInfo) (*types.ResponseInfo, error) { +func (_m *AppConnQuery) InfoSync(_a0 tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { ret := _m.Called(_a0) - var r0 *types.ResponseInfo - if rf, ok := ret.Get(0).(func(types.RequestInfo) *types.ResponseInfo); ok { + var r0 *tmabci.ResponseInfo + if rf, ok := ret.Get(0).(func(tmabci.RequestInfo) *tmabci.ResponseInfo); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseInfo) + r0 = ret.Get(0).(*tmabci.ResponseInfo) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestInfo) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -74,20 +74,20 @@ func (_m *AppConnQuery) InfoSync(_a0 types.RequestInfo) (*types.ResponseInfo, er } // QuerySync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) QuerySync(_a0 types.RequestQuery) (*types.ResponseQuery, error) { +func (_m *AppConnQuery) QuerySync(_a0 tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { ret := _m.Called(_a0) - var r0 *types.ResponseQuery - if rf, ok := ret.Get(0).(func(types.RequestQuery) *types.ResponseQuery); ok { + var r0 *tmabci.ResponseQuery + if rf, ok := ret.Get(0).(func(tmabci.RequestQuery) *tmabci.ResponseQuery); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseQuery) + r0 = ret.Get(0).(*tmabci.ResponseQuery) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestQuery) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_snapshot.go b/proxy/mocks/app_conn_snapshot.go index d4389edd5..dabca0f43 100644 --- a/proxy/mocks/app_conn_snapshot.go +++ b/proxy/mocks/app_conn_snapshot.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - types "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" ) // AppConnSnapshot is an autogenerated mock type for the AppConnSnapshot type @@ -14,20 +14,20 @@ type AppConnSnapshot struct { } // ApplySnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) ApplySnapshotChunkSync(_a0 types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { +func (_m *AppConnSnapshot) ApplySnapshotChunkSync(_a0 tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *types.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { + var r0 *tmabci.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk) *tmabci.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*tmabci.ResponseApplySnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -51,20 +51,20 @@ func (_m *AppConnSnapshot) Error() error { } // ListSnapshotsSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { +func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { ret := _m.Called(_a0) - var r0 *types.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(types.RequestListSnapshots) *types.ResponseListSnapshots); ok { + var r0 *tmabci.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots) *tmabci.ResponseListSnapshots); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseListSnapshots) + r0 = ret.Get(0).(*tmabci.ResponseListSnapshots) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestListSnapshots) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -74,20 +74,20 @@ func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 types.RequestListSnapshots) (*t } // LoadSnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { +func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *types.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { + var r0 *tmabci.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk) *tmabci.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*tmabci.ResponseLoadSnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -97,20 +97,20 @@ func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 types.RequestLoadSnapshotCh } // OfferSnapshotSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) OfferSnapshotSync(_a0 types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { +func (_m *AppConnSnapshot) OfferSnapshotSync(_a0 tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { ret := _m.Called(_a0) - var r0 *types.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { + var r0 *tmabci.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot) *tmabci.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseOfferSnapshot) + r0 = ret.Get(0).(*tmabci.ResponseOfferSnapshot) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(tmabci.RequestOfferSnapshot) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/version.go b/proxy/version.go index c2b65d3fc..35601c1ab 100644 --- a/proxy/version.go +++ b/proxy/version.go @@ -1,14 +1,15 @@ package proxy import ( - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/version" ) // RequestInfo contains all the information for sending // the abci.RequestInfo message during handshake with the app. // It contains only compile-time version information. -var RequestInfo = abci.RequestInfo{ +var RequestInfo = tmabci.RequestInfo{ Version: version.OCCoreSemVer, BlockVersion: version.BlockProtocol, P2PVersion: version.P2PProtocol, diff --git a/rpc/client/mock/abci.go b/rpc/client/mock/abci.go index dbeafbfc2..18d96cc3c 100644 --- a/rpc/client/mock/abci.go +++ b/rpc/client/mock/abci.go @@ -3,6 +3,8 @@ package mock import ( "context" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/proxy" @@ -37,7 +39,7 @@ func (a ABCIApp) ABCIQueryWithOptions( path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error) { - q := a.App.Query(abci.RequestQuery{ + q := a.App.Query(tmabci.RequestQuery{ Data: data, Path: path, Height: opts.Height, @@ -51,23 +53,23 @@ func (a ABCIApp) ABCIQueryWithOptions( // TODO: Make it wait for a commit and set res.Height appropriately. func (a ABCIApp) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { res := ctypes.ResultBroadcastTxCommit{} - res.CheckTx = a.App.CheckTxSync(abci.RequestCheckTx{Tx: tx}) + res.CheckTx = a.App.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) if res.CheckTx.IsErr() { return &res, nil } - res.DeliverTx = a.App.DeliverTx(abci.RequestDeliverTx{Tx: tx}) + res.DeliverTx = a.App.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}) res.Height = -1 // TODO return &res, nil } func (a ABCIApp) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { chRes := make(chan abci.ResponseCheckTx, 1) - a.App.CheckTxAsync(abci.RequestCheckTx{Tx: tx}, func(res abci.ResponseCheckTx) { + a.App.CheckTxAsync(tmabci.RequestCheckTx{Tx: tx}, func(res abci.ResponseCheckTx) { chRes <- res }) c := <-chRes // and this gets written in a background thread... - go func() { a.App.DeliverTx(abci.RequestDeliverTx{Tx: tx}) }() + go func() { a.App.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}) }() return &ctypes.ResultBroadcastTx{ Code: c.Code, Data: c.Data, @@ -78,10 +80,10 @@ func (a ABCIApp) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.Res } func (a ABCIApp) BroadcastTxSync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { - c := a.App.CheckTxSync(abci.RequestCheckTx{Tx: tx}) + c := a.App.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) // and this gets written in a background thread... if !c.IsErr() { - go func() { a.App.DeliverTx(abci.RequestDeliverTx{Tx: tx}) }() + go func() { a.App.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}) }() } return &ctypes.ResultBroadcastTx{ Code: c.Code, @@ -107,7 +109,7 @@ func (m ABCIMock) ABCIInfo(ctx context.Context) (*ctypes.ResultABCIInfo, error) if err != nil { return nil, err } - return &ctypes.ResultABCIInfo{Response: res.(abci.ResponseInfo)}, nil + return &ctypes.ResultABCIInfo{Response: res.(tmabci.ResponseInfo)}, nil } func (m ABCIMock) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error) { @@ -123,7 +125,7 @@ func (m ABCIMock) ABCIQueryWithOptions( if err != nil { return nil, err } - resQuery := res.(abci.ResponseQuery) + resQuery := res.(tmabci.ResponseQuery) return &ctypes.ResultABCIQuery{Response: resQuery}, nil } diff --git a/rpc/client/mock/abci_test.go b/rpc/client/mock/abci_test.go index b693dc6f6..11f620e85 100644 --- a/rpc/client/mock/abci_test.go +++ b/rpc/client/mock/abci_test.go @@ -9,6 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/abci/example/kvstore" abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/bytes" @@ -28,7 +30,7 @@ func TestABCIMock(t *testing.T) { m := mock.ABCIMock{ Info: mock.Call{Error: errors.New("foobar")}, - Query: mock.Call{Response: abci.ResponseQuery{ + Query: mock.Call{Response: tmabci.ResponseQuery{ Key: key, Value: value, Height: height, @@ -38,7 +40,7 @@ func TestABCIMock(t *testing.T) { Args: goodTx, Response: &ctypes.ResultBroadcastTxCommit{ CheckTx: abci.ResponseCheckTx{Data: bytes.HexBytes("stand")}, - DeliverTx: abci.ResponseDeliverTx{Data: bytes.HexBytes("deliver")}, + DeliverTx: tmabci.ResponseDeliverTx{Data: bytes.HexBytes("deliver")}, }, Error: errors.New("bad tx"), }, @@ -83,7 +85,7 @@ func TestABCIRecorder(t *testing.T) { // This mock returns errors on everything but Query m := mock.ABCIMock{ - Info: mock.Call{Response: abci.ResponseInfo{ + Info: mock.Call{Response: tmabci.ResponseInfo{ Data: "data", Version: "v0.9.9", }}, diff --git a/rpc/core/abci.go b/rpc/core/abci.go index c20082c55..f05762c4e 100644 --- a/rpc/core/abci.go +++ b/rpc/core/abci.go @@ -1,7 +1,8 @@ package core import ( - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/proxy" ctypes "github.com/line/ostracon/rpc/core/types" @@ -17,7 +18,7 @@ func ABCIQuery( height int64, prove bool, ) (*ctypes.ResultABCIQuery, error) { - resQuery, err := env.ProxyAppQuery.QuerySync(abci.RequestQuery{ + resQuery, err := env.ProxyAppQuery.QuerySync(tmabci.RequestQuery{ Path: path, Data: data, Height: height, diff --git a/rpc/core/blocks_test.go b/rpc/core/blocks_test.go index 49c333513..d3d0dbef7 100644 --- a/rpc/core/blocks_test.go +++ b/rpc/core/blocks_test.go @@ -19,6 +19,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -83,13 +84,13 @@ func TestBlockchainInfo(t *testing.T) { func TestBlockResults(t *testing.T) { results := &ocstate.ABCIResponses{ - DeliverTxs: []*abci.ResponseDeliverTx{ + DeliverTxs: []*tmabci.ResponseDeliverTx{ {Code: 0, Data: []byte{0x01}, Log: "ok"}, {Code: 0, Data: []byte{0x02}, Log: "ok"}, {Code: 1, Log: "not ok"}, }, EndBlock: &abci.ResponseEndBlock{}, - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, } env = &Environment{} @@ -301,7 +302,7 @@ func storeTestBlocks(startHeight, numToMakeBlocks, numToMakeTxs int64, state sm. tx := []byte{byte(height), byte(txIndex)} txs[txIndex] = tx // Indexing - env.TxIndexer.Index(&abci.TxResult{Height: height, Index: uint32(txIndex), Tx: tx}) // nolint:errcheck + env.TxIndexer.Index(&tmabci.TxResult{Height: height, Index: uint32(txIndex), Tx: tx}) // nolint:errcheck } lastCommit := types.NewCommit(lastHeight, round, blockID, commitSigs) block, _ := state.MakeBlock(height, txs, lastCommit, nil, proposer.Address, round, nil) diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index 361633834..55715137a 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -6,6 +6,8 @@ import ( "fmt" "time" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" mempl "github.com/line/ostracon/mempool" ctypes "github.com/line/ostracon/rpc/core/types" @@ -88,7 +90,7 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc if checkTxRes.Code != abci.CodeTypeOK { return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes, - DeliverTx: abci.ResponseDeliverTx{}, + DeliverTx: tmabci.ResponseDeliverTx{}, Hash: tx.Hash(), }, nil } @@ -114,7 +116,7 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc env.Logger.Error("Error on broadcastTxCommit", "err", err) return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes, - DeliverTx: abci.ResponseDeliverTx{}, + DeliverTx: tmabci.ResponseDeliverTx{}, Hash: tx.Hash(), }, err case <-time.After(env.Config.TimeoutBroadcastTxCommit): @@ -122,7 +124,7 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc env.Logger.Error("Error on broadcastTxCommit", "err", err) return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes, - DeliverTx: abci.ResponseDeliverTx{}, + DeliverTx: tmabci.ResponseDeliverTx{}, Hash: tx.Hash(), }, err } @@ -156,7 +158,7 @@ func NumUnconfirmedTxs(ctx *rpctypes.Context) (*ctypes.ResultUnconfirmedTxs, err // be added to the mempool either. // More: https://docs.tendermint.com/master/rpc/#/Tx/check_tx func CheckTx(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultCheckTx, error) { - res, err := env.ProxyAppMempool.CheckTxSync(abci.RequestCheckTx{Tx: tx}) + res, err := env.ProxyAppMempool.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) if err != nil { return nil, err } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index e6bedb515..421c8f3b4 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -4,6 +4,7 @@ import ( "encoding/json" "time" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" abci "github.com/line/ostracon/abci/types" @@ -48,12 +49,12 @@ type ResultCommit struct { // ABCI results from a block type ResultBlockResults struct { - Height int64 `json:"height"` - TxsResults []*abci.ResponseDeliverTx `json:"txs_results"` - BeginBlockEvents []abci.Event `json:"begin_block_events"` - EndBlockEvents []abci.Event `json:"end_block_events"` - ValidatorUpdates []abci.ValidatorUpdate `json:"validator_updates"` - ConsensusParamUpdates *abci.ConsensusParams `json:"consensus_param_updates"` + Height int64 `json:"height"` + TxsResults []*tmabci.ResponseDeliverTx `json:"txs_results"` + BeginBlockEvents []tmabci.Event `json:"begin_block_events"` + EndBlockEvents []tmabci.Event `json:"end_block_events"` + ValidatorUpdates []abci.ValidatorUpdate `json:"validator_updates"` + ConsensusParamUpdates *tmabci.ConsensusParams `json:"consensus_param_updates"` } // NewResultCommit is a helper to initialize the ResultCommit with @@ -180,10 +181,10 @@ type ResultBroadcastTx struct { // CheckTx and DeliverTx results type ResultBroadcastTxCommit struct { - CheckTx abci.ResponseCheckTx `json:"check_tx"` - DeliverTx abci.ResponseDeliverTx `json:"deliver_tx"` - Hash bytes.HexBytes `json:"hash"` - Height int64 `json:"height"` + CheckTx abci.ResponseCheckTx `json:"check_tx"` + DeliverTx tmabci.ResponseDeliverTx `json:"deliver_tx"` + Hash bytes.HexBytes `json:"hash"` + Height int64 `json:"height"` } // ResultCheckTx wraps abci.ResponseCheckTx. @@ -193,12 +194,12 @@ type ResultCheckTx struct { // Result of querying for a tx type ResultTx struct { - Hash bytes.HexBytes `json:"hash"` - Height int64 `json:"height"` - Index uint32 `json:"index"` - TxResult abci.ResponseDeliverTx `json:"tx_result"` - Tx types.Tx `json:"tx"` - Proof types.TxProof `json:"proof,omitempty"` + Hash bytes.HexBytes `json:"hash"` + Height int64 `json:"height"` + Index uint32 `json:"index"` + TxResult tmabci.ResponseDeliverTx `json:"tx_result"` + Tx types.Tx `json:"tx"` + Proof types.TxProof `json:"proof,omitempty"` } // Result of searching for txs @@ -223,12 +224,12 @@ type ResultUnconfirmedTxs struct { // Info abci msg type ResultABCIInfo struct { - Response abci.ResponseInfo `json:"response"` + Response tmabci.ResponseInfo `json:"response"` } // Query abci msg type ResultABCIQuery struct { - Response abci.ResponseQuery `json:"response"` + Response tmabci.ResponseQuery `json:"response"` } // Result of broadcasting evidence diff --git a/rpc/grpc/api.go b/rpc/grpc/api.go index b1efca20a..363c656ee 100644 --- a/rpc/grpc/api.go +++ b/rpc/grpc/api.go @@ -3,6 +3,8 @@ package coregrpc import ( "context" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" core "github.com/line/ostracon/rpc/core" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" @@ -30,7 +32,7 @@ func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcast Data: res.CheckTx.Data, Log: res.CheckTx.Log, }, - DeliverTx: &abci.ResponseDeliverTx{ + DeliverTx: &tmabci.ResponseDeliverTx{ Code: res.DeliverTx.Code, Data: res.DeliverTx.Data, Log: res.DeliverTx.Log, diff --git a/rpc/grpc/types.pb.go b/rpc/grpc/types.pb.go index cf80c8951..cc7103c2c 100644 --- a/rpc/grpc/types.pb.go +++ b/rpc/grpc/types.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" types "github.com/line/ostracon/abci/types" + types1 "github.com/tendermint/tendermint/abci/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -144,8 +145,8 @@ func (m *ResponsePing) XXX_DiscardUnknown() { var xxx_messageInfo_ResponsePing proto.InternalMessageInfo type ResponseBroadcastTx struct { - CheckTx *types.ResponseCheckTx `protobuf:"bytes,1,opt,name=check_tx,json=checkTx,proto3" json:"check_tx,omitempty"` - DeliverTx *types.ResponseDeliverTx `protobuf:"bytes,2,opt,name=deliver_tx,json=deliverTx,proto3" json:"deliver_tx,omitempty"` + CheckTx *types.ResponseCheckTx `protobuf:"bytes,1,opt,name=check_tx,json=checkTx,proto3" json:"check_tx,omitempty"` + DeliverTx *types1.ResponseDeliverTx `protobuf:"bytes,2,opt,name=deliver_tx,json=deliverTx,proto3" json:"deliver_tx,omitempty"` } func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} } @@ -188,7 +189,7 @@ func (m *ResponseBroadcastTx) GetCheckTx() *types.ResponseCheckTx { return nil } -func (m *ResponseBroadcastTx) GetDeliverTx() *types.ResponseDeliverTx { +func (m *ResponseBroadcastTx) GetDeliverTx() *types1.ResponseDeliverTx { if m != nil { return m.DeliverTx } @@ -205,27 +206,28 @@ func init() { func init() { proto.RegisterFile("ostracon/rpc/grpc/types.proto", fileDescriptor_907c7db099111068) } var fileDescriptor_907c7db099111068 = []byte{ - // 316 bytes of a gzipped FileDescriptorProto + // 333 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0x2f, 0x2e, 0x29, 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0x2a, 0x48, 0xd6, 0x4f, 0x07, 0x11, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x82, 0x30, 0x69, 0xbd, 0xa2, 0x82, 0x64, 0x3d, - 0x90, 0xb4, 0x94, 0x24, 0x5c, 0x47, 0x62, 0x52, 0x72, 0x26, 0xb2, 0x6a, 0x25, 0x5e, 0x2e, 0xee, - 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x92, 0x80, 0xcc, 0xbc, 0x74, 0x25, 0x15, 0x2e, 0x21, 0x28, - 0xd7, 0xa9, 0x28, 0x3f, 0x31, 0x25, 0x39, 0xb1, 0xb8, 0x24, 0xa4, 0x42, 0x88, 0x8f, 0x8b, 0xa9, - 0xa4, 0x42, 0x82, 0x51, 0x81, 0x51, 0x83, 0x27, 0x88, 0xa9, 0xa4, 0x42, 0x89, 0x8f, 0x8b, 0x27, - 0x28, 0xb5, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x15, 0xac, 0x6b, 0x22, 0x23, 0x97, 0x30, 0x4c, 0x00, - 0x59, 0x9f, 0x25, 0x17, 0x47, 0x72, 0x46, 0x6a, 0x72, 0x76, 0x3c, 0x54, 0x37, 0xb7, 0x91, 0x9c, - 0x1e, 0xdc, 0x75, 0x20, 0xa7, 0xe8, 0xc1, 0x74, 0x39, 0x83, 0x94, 0x85, 0x54, 0x04, 0xb1, 0x27, - 0x43, 0x18, 0x42, 0xf6, 0x5c, 0x5c, 0x29, 0xa9, 0x39, 0x99, 0x65, 0xa9, 0x45, 0x20, 0xcd, 0x4c, - 0x60, 0xcd, 0x0a, 0x38, 0x34, 0xbb, 0x40, 0x14, 0x86, 0x54, 0x04, 0x71, 0xa6, 0xc0, 0x98, 0x46, - 0x5b, 0x19, 0xb9, 0x78, 0xe0, 0x6e, 0x71, 0x0c, 0xf0, 0x14, 0x72, 0xe7, 0x62, 0x01, 0x39, 0x56, - 0x08, 0xc9, 0x09, 0xb0, 0x00, 0xd2, 0x43, 0x0a, 0x02, 0x29, 0x79, 0xac, 0xf2, 0x08, 0xdf, 0x0a, - 0xc5, 0x70, 0x71, 0x23, 0x7b, 0x52, 0x15, 0xb7, 0x79, 0x48, 0xca, 0xa4, 0xd4, 0xf0, 0x18, 0x8b, - 0xa4, 0xce, 0xc9, 0xe5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, - 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xb4, 0xd2, - 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x73, 0x32, 0xf3, 0x52, 0xf5, 0x31, - 0xd2, 0x81, 0x75, 0x72, 0x7e, 0x51, 0x2a, 0x88, 0x91, 0xc4, 0x06, 0x8e, 0x5d, 0x63, 0x40, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x64, 0xf2, 0x70, 0x9d, 0x2c, 0x02, 0x00, 0x00, + 0x90, 0xb4, 0x94, 0x24, 0x5c, 0x47, 0x62, 0x52, 0x72, 0x26, 0xb2, 0x6a, 0x29, 0xe9, 0x92, 0xd4, + 0xbc, 0x94, 0xd4, 0xa2, 0xdc, 0xcc, 0xbc, 0x12, 0x0c, 0x49, 0x25, 0x5e, 0x2e, 0xee, 0xa0, 0xd4, + 0xc2, 0xd2, 0xd4, 0xe2, 0x92, 0x80, 0xcc, 0xbc, 0x74, 0x25, 0x15, 0x2e, 0x21, 0x28, 0xd7, 0xa9, + 0x28, 0x3f, 0x31, 0x25, 0x39, 0xb1, 0xb8, 0x24, 0xa4, 0x42, 0x88, 0x8f, 0x8b, 0xa9, 0xa4, 0x42, + 0x82, 0x51, 0x81, 0x51, 0x83, 0x27, 0x88, 0xa9, 0xa4, 0x42, 0x89, 0x8f, 0x8b, 0x27, 0x28, 0xb5, + 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x15, 0xac, 0x6b, 0x32, 0x23, 0x97, 0x30, 0x4c, 0x00, 0x59, 0x9f, + 0x25, 0x17, 0x47, 0x72, 0x46, 0x6a, 0x72, 0x76, 0x3c, 0x54, 0x37, 0xb7, 0x91, 0x9c, 0x1e, 0xdc, + 0xe9, 0x20, 0xa7, 0xe8, 0xc1, 0x74, 0x39, 0x83, 0x94, 0x85, 0x54, 0x04, 0xb1, 0x27, 0x43, 0x18, + 0x42, 0x8e, 0x5c, 0x5c, 0x29, 0xa9, 0x39, 0x99, 0x65, 0xa9, 0x45, 0x20, 0xcd, 0x4c, 0x60, 0xcd, + 0x4a, 0x7a, 0x08, 0x9f, 0xa0, 0x6a, 0x77, 0x81, 0x28, 0x0d, 0xa9, 0x08, 0xe2, 0x4c, 0x81, 0x31, + 0x8d, 0xb6, 0x32, 0x72, 0xf1, 0xc0, 0x5d, 0xe3, 0x18, 0xe0, 0x29, 0xe4, 0xce, 0xc5, 0x02, 0x72, + 0xae, 0x10, 0x92, 0x23, 0x60, 0xe1, 0xa7, 0x87, 0x14, 0x08, 0x52, 0xf2, 0x58, 0xe5, 0x11, 0xfe, + 0x15, 0x8a, 0xe1, 0xe2, 0x46, 0xf6, 0xa6, 0x2a, 0x6e, 0xf3, 0x90, 0x94, 0x49, 0xa9, 0xe1, 0x31, + 0x16, 0x49, 0x9d, 0x93, 0xcb, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, + 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, + 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xe7, 0x64, 0xe6, 0xa5, 0xea, + 0x63, 0x24, 0x13, 0xeb, 0xe4, 0xfc, 0xa2, 0x54, 0x10, 0x23, 0x89, 0x0d, 0x1c, 0xbf, 0xc6, 0x80, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x30, 0xb5, 0xd6, 0x4d, 0x4b, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -811,7 +813,7 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.DeliverTx == nil { - m.DeliverTx = &types.ResponseDeliverTx{} + m.DeliverTx = &types1.ResponseDeliverTx{} } if err := m.DeliverTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/state/execution.go b/state/execution.go index 09ead4024..91f8a071d 100644 --- a/state/execution.go +++ b/state/execution.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" abci "github.com/line/ostracon/abci/types" @@ -273,7 +274,7 @@ func (blockExec *BlockExecutor) ApplyBlock( func (blockExec *BlockExecutor) Commit( state State, block *types.Block, - deliverTxResponses []*abci.ResponseDeliverTx, + deliverTxResponses []*tmabci.ResponseDeliverTx, stepTimes *CommitStepTimes, ) ([]byte, int64, error) { blockExec.mempool.Lock() @@ -347,7 +348,7 @@ func execBlockOnProxyApp( txIndex := 0 abciResponses := new(ocstate.ABCIResponses) - dtxs := make([]*abci.ResponseDeliverTx, len(block.Txs)) + dtxs := make([]*tmabci.ResponseDeliverTx, len(block.Txs)) abciResponses.DeliverTxs = dtxs // Execute transactions and get hash. @@ -398,7 +399,7 @@ func execBlockOnProxyApp( startTime := time.Now() // run txs of block for _, tx := range block.Txs { - proxyAppConn.DeliverTxAsync(abci.RequestDeliverTx{Tx: tx}, nil) + proxyAppConn.DeliverTxAsync(tmabci.RequestDeliverTx{Tx: tx}, nil) if err := proxyAppConn.Error(); err != nil { return nil, err } @@ -407,7 +408,7 @@ func execBlockOnProxyApp( execTime := endTime.Sub(startTime) // End block. - abciResponses.EndBlock, err = proxyAppConn.EndBlockSync(abci.RequestEndBlock{Height: block.Height}) + abciResponses.EndBlock, err = proxyAppConn.EndBlockSync(tmabci.RequestEndBlock{Height: block.Height}) if err != nil { logger.Error("error in proxyAppConn.EndBlock", "err", err) return nil, err @@ -599,7 +600,7 @@ func fireEvents( } for i, tx := range block.Data.Txs { - if err := eventBus.PublishEventTx(types.EventDataTx{TxResult: abci.TxResult{ + if err := eventBus.PublishEventTx(types.EventDataTx{TxResult: tmabci.TxResult{ Height: block.Height, Index: uint32(i), Tx: tx, diff --git a/state/execution_test.go b/state/execution_test.go index 3c0695082..3fd794518 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" @@ -184,14 +185,14 @@ func TestBeginBlockByzantineValidators(t *testing.T) { abciEv := []abci.Evidence{ { - Type: abci.EvidenceType_DUPLICATE_VOTE, + Type: tmabci.EvidenceType_DUPLICATE_VOTE, Height: 3, Time: defaultEvidenceTime, Validator: types.OC2PB.Validator(state.Validators.Validators[0]), TotalVotingPower: 10, }, { - Type: abci.EvidenceType_LIGHT_CLIENT_ATTACK, + Type: tmabci.EvidenceType_LIGHT_CLIENT_ATTACK, Height: 8, Time: defaultEvidenceTime, Validator: types.OC2PB.Validator(state.Validators.Validators[0]), diff --git a/state/helpers_test.go b/state/helpers_test.go index e2e5d0888..57284786c 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -175,7 +176,7 @@ func makeHeaderPartsResponsesValPubKeyChange( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } // If the pubkey is new, remove the old and add the new. @@ -199,7 +200,7 @@ func makeHeaderPartsResponsesValPowerChange( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -223,7 +224,7 @@ func makeHeaderPartsResponsesParams( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ConsensusParamUpdates: types.OC2PB.ConsensusParams(¶ms)}, } return block.Header, types.BlockID{Hash: block.Hash(), PartSetHeader: types.PartSetHeader{}}, abciResponses @@ -259,40 +260,40 @@ type testApp struct { var _ abci.Application = (*testApp)(nil) var TestAppVersion uint64 = 66 -func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { - return abci.ResponseInfo{} +func (app *testApp) Info(req tmabci.RequestInfo) (resInfo tmabci.ResponseInfo) { + return tmabci.ResponseInfo{} } -func (app *testApp) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock { +func (app *testApp) BeginBlock(req abci.RequestBeginBlock) tmabci.ResponseBeginBlock { app.CommitVotes = req.LastCommitInfo.Votes app.ByzantineValidators = req.ByzantineValidators - return abci.ResponseBeginBlock{} + return tmabci.ResponseBeginBlock{} } -func (app *testApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { +func (app *testApp) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { return abci.ResponseEndBlock{ ValidatorUpdates: app.ValidatorUpdates, - ConsensusParamUpdates: &abci.ConsensusParams{ + ConsensusParamUpdates: &tmabci.ConsensusParams{ Version: &tmproto.VersionParams{ AppVersion: TestAppVersion}}} } -func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { - return abci.ResponseDeliverTx{Events: []abci.Event{}} +func (app *testApp) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { + return tmabci.ResponseDeliverTx{Events: []tmabci.Event{}} } -func (app *testApp) CheckTxSync(req abci.RequestCheckTx) abci.ResponseCheckTx { +func (app *testApp) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { return abci.ResponseCheckTx{} } -func (app *testApp) CheckTxAsync(req abci.RequestCheckTx, callback abci.CheckTxCallback) { +func (app *testApp) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { callback(abci.ResponseCheckTx{}) } -func (app *testApp) Commit() abci.ResponseCommit { - return abci.ResponseCommit{RetainHeight: 1} +func (app *testApp) Commit() tmabci.ResponseCommit { + return tmabci.ResponseCommit{RetainHeight: 1} } -func (app *testApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { +func (app *testApp) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { return } diff --git a/state/indexer/block/kv/kv.go b/state/indexer/block/kv/kv.go index 7f93478d1..56423a7d4 100644 --- a/state/indexer/block/kv/kv.go +++ b/state/indexer/block/kv/kv.go @@ -9,9 +9,9 @@ import ( "strings" "github.com/google/orderedcode" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/indexer" "github.com/line/ostracon/types" @@ -453,7 +453,7 @@ func (idx *BlockerIndexer) match( return filteredHeights, nil } -func (idx *BlockerIndexer) indexEvents(batch dbm.Batch, events []abci.Event, typ string, height int64) error { +func (idx *BlockerIndexer) indexEvents(batch dbm.Batch, events []tmabci.Event, typ string, height int64) error { heightBz := int64ToBytes(height) for _, event := range events { diff --git a/state/indexer/block/kv/kv_test.go b/state/indexer/block/kv/kv_test.go index 6173197ff..8d1431b0c 100644 --- a/state/indexer/block/kv/kv_test.go +++ b/state/indexer/block/kv/kv_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -19,11 +20,11 @@ func TestBlockIndexer(t *testing.T) { indexer := blockidxkv.New(store) require.NoError(t, indexer.Index(types.EventDataNewBlockHeader{ Header: types.Header{Height: 1}, - ResultBeginBlock: abci.ResponseBeginBlock{ - Events: []abci.Event{ + ResultBeginBlock: tmabci.ResponseBeginBlock{ + Events: []tmabci.Event{ { Type: "begin_event", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ { Key: []byte("proposer"), Value: []byte("FCAA001"), @@ -34,10 +35,10 @@ func TestBlockIndexer(t *testing.T) { }, }, ResultEndBlock: abci.ResponseEndBlock{ - Events: []abci.Event{ + Events: []tmabci.Event{ { Type: "end_event", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ { Key: []byte("foo"), Value: []byte("100"), @@ -57,11 +58,11 @@ func TestBlockIndexer(t *testing.T) { require.NoError(t, indexer.Index(types.EventDataNewBlockHeader{ Header: types.Header{Height: int64(i)}, - ResultBeginBlock: abci.ResponseBeginBlock{ - Events: []abci.Event{ + ResultBeginBlock: tmabci.ResponseBeginBlock{ + Events: []tmabci.Event{ { Type: "begin_event", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ { Key: []byte("proposer"), Value: []byte("FCAA001"), @@ -72,10 +73,10 @@ func TestBlockIndexer(t *testing.T) { }, }, ResultEndBlock: abci.ResponseEndBlock{ - Events: []abci.Event{ + Events: []tmabci.Event{ { Type: "end_event", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ { Key: []byte("foo"), Value: []byte(fmt.Sprintf("%d", i)), diff --git a/state/indexer/sink/psql/backport.go b/state/indexer/sink/psql/backport.go index 6e2a0984e..cffd1875b 100644 --- a/state/indexer/sink/psql/backport.go +++ b/state/indexer/sink/psql/backport.go @@ -17,7 +17,8 @@ import ( "context" "errors" - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/txindex" "github.com/line/ostracon/types" @@ -43,19 +44,19 @@ func (b BackportTxIndexer) AddBatch(batch *txindex.Batch) error { } // Index indexes a single transaction result in Postgres, as part of TxIndexer. -func (b BackportTxIndexer) Index(txr *abci.TxResult) error { - return b.psql.IndexTxEvents([]*abci.TxResult{txr}) +func (b BackportTxIndexer) Index(txr *tmabci.TxResult) error { + return b.psql.IndexTxEvents([]*tmabci.TxResult{txr}) } // Get is implemented to satisfy the TxIndexer interface, but is not supported // by the psql event sink and reports an error for all inputs. -func (BackportTxIndexer) Get([]byte) (*abci.TxResult, error) { +func (BackportTxIndexer) Get([]byte) (*tmabci.TxResult, error) { return nil, errors.New("the TxIndexer.Get method is not supported") } // Search is implemented to satisfy the TxIndexer interface, but it is not // supported by the psql event sink and reports an error for all inputs. -func (BackportTxIndexer) Search(context.Context, *query.Query) ([]*abci.TxResult, error) { +func (BackportTxIndexer) Search(context.Context, *query.Query) ([]*tmabci.TxResult, error) { return nil, errors.New("the TxIndexer.Search method is not supported") } diff --git a/state/indexer/sink/psql/backport_test.go b/state/indexer/sink/psql/backport_test.go index ed36be7d0..24f7660a1 100644 --- a/state/indexer/sink/psql/backport_test.go +++ b/state/indexer/sink/psql/backport_test.go @@ -4,7 +4,8 @@ import ( "context" "testing" - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/indexer" "github.com/line/ostracon/state/txindex" @@ -27,14 +28,14 @@ func TestBackportTxIndexer_AddBatch(t *testing.T) { func TestBackportTxIndexer_Index(t *testing.T) { indexer := &EventSink{store: testDB(), chainID: chainID} txIndexer := indexer.TxIndexer() - err := txIndexer.Index(&abci.TxResult{}) + err := txIndexer.Index(&tmabci.TxResult{}) require.Error(t, err) require.Contains(t, err.Error(), "finding block ID: ") blockIndexer := indexer.BlockIndexer() err = blockIndexer.Index(types.EventDataNewBlockHeader{}) require.NoError(t, err) - err = txIndexer.Index(&abci.TxResult{}) + err = txIndexer.Index(&tmabci.TxResult{}) require.NoError(t, err) } diff --git a/state/indexer/sink/psql/psql.go b/state/indexer/sink/psql/psql.go index 5aebb6863..ed61944d3 100644 --- a/state/indexer/sink/psql/psql.go +++ b/state/indexer/sink/psql/psql.go @@ -9,8 +9,9 @@ import ( "strings" "time" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/gogo/protobuf/proto" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/types" ) @@ -82,7 +83,7 @@ func queryWithID(tx *sql.Tx, query string, args ...interface{}) (uint32, error) // // If txID > 0, the event is attributed to the Tendermint transaction with that // ID; otherwise it is recorded as a block event. -func insertEvents(dbtx *sql.Tx, blockID, txID uint32, evts []abci.Event) error { +func insertEvents(dbtx *sql.Tx, blockID, txID uint32, evts []tmabci.Event) error { // Populate the transaction ID field iff one is defined (> 0). var txIDArg interface{} if txID > 0 { @@ -126,12 +127,12 @@ INSERT INTO `+tableAttributes+` (event_id, key, composite_key, value) // value. If the key has the form "type.name", the event will have a single // attribute with that name and the value; otherwise the event will have only // a type and no attributes. -func makeIndexedEvent(compositeKey, value string) abci.Event { +func makeIndexedEvent(compositeKey, value string) tmabci.Event { i := strings.Index(compositeKey, ".") if i < 0 { - return abci.Event{Type: compositeKey} + return tmabci.Event{Type: compositeKey} } - return abci.Event{Type: compositeKey[:i], Attributes: []abci.EventAttribute{ + return tmabci.Event{Type: compositeKey[:i], Attributes: []tmabci.EventAttribute{ {Key: []byte(compositeKey[i+1:]), Value: []byte(value), Index: true}, }} } @@ -157,7 +158,7 @@ INSERT INTO `+tableBlocks+` (height, chain_id, created_at) } // Insert the special block meta-event for height. - if err := insertEvents(dbtx, blockID, 0, []abci.Event{ + if err := insertEvents(dbtx, blockID, 0, []tmabci.Event{ makeIndexedEvent(types.BlockHeightKey, fmt.Sprint(h.Header.Height)), }); err != nil { return fmt.Errorf("block meta-events: %w", err) @@ -173,7 +174,7 @@ INSERT INTO `+tableBlocks+` (height, chain_id, created_at) }) } -func (es *EventSink) IndexTxEvents(txrs []*abci.TxResult) error { +func (es *EventSink) IndexTxEvents(txrs []*tmabci.TxResult) error { ts := time.Now().UTC() for _, txr := range txrs { @@ -210,7 +211,7 @@ INSERT INTO `+tableTxResults+` (block_id, index, created_at, tx_hash, tx_result) } // Insert the special transaction meta-events for hash and height. - if err := insertEvents(dbtx, blockID, txID, []abci.Event{ + if err := insertEvents(dbtx, blockID, txID, []tmabci.Event{ makeIndexedEvent(types.TxHashKey, txHash), makeIndexedEvent(types.TxHeightKey, fmt.Sprint(txr.Height)), }); err != nil { @@ -235,12 +236,12 @@ func (es *EventSink) SearchBlockEvents(ctx context.Context, q *query.Query) ([]i } // SearchTxEvents is not implemented by this sink, and reports an error for all queries. -func (es *EventSink) SearchTxEvents(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) { +func (es *EventSink) SearchTxEvents(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) { return nil, errors.New("tx search is not supported via the postgres event sink") } // GetTxByHash is not implemented by this sink, and reports an error for all queries. -func (es *EventSink) GetTxByHash(hash []byte) (*abci.TxResult, error) { +func (es *EventSink) GetTxByHash(hash []byte) (*tmabci.TxResult, error) { return nil, errors.New("getTxByHash is not supported via the postgres event sink") } diff --git a/state/indexer/sink/psql/psql_test.go b/state/indexer/sink/psql/psql_test.go index 514a58f03..6652bf78f 100644 --- a/state/indexer/sink/psql/psql_test.go +++ b/state/indexer/sink/psql/psql_test.go @@ -12,6 +12,8 @@ import ( "testing" "time" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/adlio/schema" "github.com/gogo/protobuf/proto" abci "github.com/line/ostracon/abci/types" @@ -159,12 +161,12 @@ func TestIndexing(t *testing.T) { t.Run("IndexTxEvents", func(t *testing.T) { indexer := &EventSink{store: testDB(), chainID: chainID} - txResult := txResultWithEvents([]abci.Event{ + txResult := txResultWithEvents([]tmabci.Event{ makeIndexedEvent("account.number", "1"), makeIndexedEvent("account.owner", "Ivan"), makeIndexedEvent("account.owner", "Yulieta"), - {Type: "", Attributes: []abci.EventAttribute{ + {Type: "", Attributes: []tmabci.EventAttribute{ { Key: []byte("not_allowed"), Value: []byte("Vlad"), @@ -172,7 +174,7 @@ func TestIndexing(t *testing.T) { }, }}, }) - require.NoError(t, indexer.IndexTxEvents([]*abci.TxResult{txResult})) + require.NoError(t, indexer.IndexTxEvents([]*tmabci.TxResult{txResult})) txr, err := loadTxResult(types.Tx(txResult.Tx).Hash()) require.NoError(t, err) @@ -191,7 +193,7 @@ func TestIndexing(t *testing.T) { }) // try to insert the duplicate tx events. - err = indexer.IndexTxEvents([]*abci.TxResult{txResult}) + err = indexer.IndexTxEvents([]*tmabci.TxResult{txResult}) require.NoError(t, err) }) } @@ -206,14 +208,14 @@ func TestStop(t *testing.T) { func newTestBlockHeader() types.EventDataNewBlockHeader { return types.EventDataNewBlockHeader{ Header: types.Header{Height: 1}, - ResultBeginBlock: abci.ResponseBeginBlock{ - Events: []abci.Event{ + ResultBeginBlock: tmabci.ResponseBeginBlock{ + Events: []tmabci.Event{ makeIndexedEvent("begin_event.proposer", "FCAA001"), makeIndexedEvent("thingy.whatzit", "O.O"), }, }, ResultEndBlock: abci.ResponseEndBlock{ - Events: []abci.Event{ + Events: []tmabci.Event{ makeIndexedEvent("end_event.foo", "100"), makeIndexedEvent("thingy.whatzit", "-.O"), }, @@ -250,12 +252,12 @@ func resetDatabase(db *sql.DB) error { // txResultWithEvents constructs a fresh transaction result with fixed values // for testing, that includes the specified events. -func txResultWithEvents(events []abci.Event) *abci.TxResult { - return &abci.TxResult{ +func txResultWithEvents(events []tmabci.Event) *tmabci.TxResult { + return &tmabci.TxResult{ Height: 1, Index: 0, Tx: types.Tx("HELLO WORLD"), - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Data: []byte{0}, Code: abci.CodeTypeOK, Log: "", @@ -264,7 +266,7 @@ func txResultWithEvents(events []abci.Event) *abci.TxResult { } } -func loadTxResult(hash []byte) (*abci.TxResult, error) { +func loadTxResult(hash []byte) (*tmabci.TxResult, error) { hashString := fmt.Sprintf("%X", hash) var resultData []byte if err := testDB().QueryRow(` @@ -273,7 +275,7 @@ SELECT tx_result FROM `+tableTxResults+` WHERE tx_hash = $1; return nil, fmt.Errorf("lookup transaction for hash %q failed: %v", hashString, err) } - txr := new(abci.TxResult) + txr := new(tmabci.TxResult) if err := proto.Unmarshal(resultData, txr); err != nil { return nil, fmt.Errorf("unmarshaling txr: %v", err) } diff --git a/state/state_test.go b/state/state_test.go index 6397eb517..b833209d8 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -107,11 +108,11 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { block := makeBlock(state, 2) abciResponses := new(ocstate.ABCIResponses) - dtxs := make([]*abci.ResponseDeliverTx, 2) + dtxs := make([]*tmabci.ResponseDeliverTx, 2) abciResponses.DeliverTxs = dtxs - abciResponses.DeliverTxs[0] = &abci.ResponseDeliverTx{Data: []byte("foo"), Events: nil} - abciResponses.DeliverTxs[1] = &abci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Events: nil} + abciResponses.DeliverTxs[0] = &tmabci.ResponseDeliverTx{Data: []byte("foo"), Events: nil} + abciResponses.DeliverTxs[1] = &tmabci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Events: nil} abciResponses.EndBlock = &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{ types.OC2PB.NewValidatorUpdate(ed25519.GenPrivKey().PubKey(), 10), }} @@ -136,36 +137,36 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { cases := [...]struct { // Height is implied to equal index+2, // as block 1 is created from genesis. - added []*abci.ResponseDeliverTx - expected []*abci.ResponseDeliverTx + added []*tmabci.ResponseDeliverTx + expected []*tmabci.ResponseDeliverTx }{ 0: { nil, nil, }, 1: { - []*abci.ResponseDeliverTx{ + []*tmabci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, - []*abci.ResponseDeliverTx{ + []*tmabci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello")}, }}, 2: { - []*abci.ResponseDeliverTx{ + []*tmabci.ResponseDeliverTx{ {Code: 383}, { Data: []byte("Gotcha!"), - Events: []abci.Event{ - {Type: "type1", Attributes: []abci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, - {Type: "type2", Attributes: []abci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, + Events: []tmabci.Event{ + {Type: "type1", Attributes: []tmabci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, + {Type: "type2", Attributes: []tmabci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, }, }, }, - []*abci.ResponseDeliverTx{ + []*tmabci.ResponseDeliverTx{ {Code: 383, Data: nil}, - {Code: 0, Data: []byte("Gotcha!"), Events: []abci.Event{ - {Type: "type1", Attributes: []abci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, - {Type: "type2", Attributes: []abci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, + {Code: 0, Data: []byte("Gotcha!"), Events: []tmabci.Event{ + {Type: "type1", Attributes: []tmabci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, + {Type: "type2", Attributes: []tmabci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, }}, }}, 3: { @@ -173,7 +174,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { nil, }, 4: { - []*abci.ResponseDeliverTx{nil}, + []*tmabci.ResponseDeliverTx{nil}, nil, }, } @@ -189,7 +190,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { for i, tc := range cases { h := int64(i + 1) // last block height, one below what we save responses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, DeliverTxs: tc.added, EndBlock: &abci.ResponseEndBlock{}, } @@ -204,7 +205,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { if assert.NoError(err, "%d", i) { t.Log(res) responses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, DeliverTxs: tc.expected, EndBlock: &abci.ResponseEndBlock{}, } @@ -491,7 +492,7 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { block := makeBlock(state, state.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) @@ -608,7 +609,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) @@ -711,7 +712,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { // -> proposers should alternate: oldState := updatedState3 abciResponses = &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) @@ -727,7 +728,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { for i := 0; i < 1000; i++ { // no validator updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) @@ -786,7 +787,7 @@ func TestLargeGenesisValidator(t *testing.T) { for i := 0; i < 10; i++ { // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) @@ -819,7 +820,7 @@ func TestLargeGenesisValidator(t *testing.T) { validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{firstAddedVal}) assert.NoError(t, err) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{firstAddedVal}}, } block := makeBlock(oldState, oldState.LastBlockHeight+1) @@ -831,7 +832,7 @@ func TestLargeGenesisValidator(t *testing.T) { for i := 0; i < 200; i++ { // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) @@ -867,7 +868,7 @@ func TestLargeGenesisValidator(t *testing.T) { assert.NoError(t, err) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{addedVal}}, } block := makeBlock(oldState, oldState.LastBlockHeight+1) @@ -882,7 +883,7 @@ func TestLargeGenesisValidator(t *testing.T) { require.NoError(t, err) removeGenesisVal := abci.ValidatorUpdate{PubKey: gp, Power: 0} abciResponses = &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{removeGenesisVal}}, } block = makeBlock(oldState, oldState.LastBlockHeight+1) @@ -901,7 +902,7 @@ func TestLargeGenesisValidator(t *testing.T) { isProposerUnchanged := true for isProposerUnchanged { abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) @@ -926,7 +927,7 @@ func TestLargeGenesisValidator(t *testing.T) { for i := 0; i < 100; i++ { // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, + BeginBlock: &tmabci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) diff --git a/state/store.go b/state/store.go index 56bc40e54..28b3b5030 100644 --- a/state/store.go +++ b/state/store.go @@ -5,11 +5,11 @@ import ( "fmt" "github.com/gogo/protobuf/proto" + tmabci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" tmmath "github.com/line/ostracon/libs/math" tmos "github.com/line/ostracon/libs/os" ocstate "github.com/line/ostracon/proto/ostracon/state" @@ -406,7 +406,7 @@ func (store dbStore) LoadABCIResponses(height int64) (*ocstate.ABCIResponses, er // // Exposed for testing. func (store dbStore) SaveABCIResponses(height int64, abciResponses *ocstate.ABCIResponses) error { - var dtxs []*abci.ResponseDeliverTx + var dtxs []*tmabci.ResponseDeliverTx // strip nil values, for _, tx := range abciResponses.DeliverTxs { if tx != nil { diff --git a/state/store_test.go b/state/store_test.go index 2df61a5fb..a214d9129 100644 --- a/state/store_test.go +++ b/state/store_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -179,7 +180,7 @@ func TestPruneStates(t *testing.T) { currentHeight := state.LastBlockHeight + int64(1) err = stateStore.SaveABCIResponses(currentHeight, &ocstate.ABCIResponses{ - DeliverTxs: []*abci.ResponseDeliverTx{ + DeliverTxs: []*tmabci.ResponseDeliverTx{ {Data: []byte{1}}, {Data: []byte{2}}, {Data: []byte{3}}, @@ -289,8 +290,8 @@ func TestPruneStatesDeleteErrHandle(t *testing.T) { func TestABCIResponsesResultsHash(t *testing.T) { responses := &ocstate.ABCIResponses{ - BeginBlock: &abci.ResponseBeginBlock{}, - DeliverTxs: []*abci.ResponseDeliverTx{ + BeginBlock: &tmabci.ResponseBeginBlock{}, + DeliverTxs: []*tmabci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, EndBlock: &abci.ResponseEndBlock{}, diff --git a/state/txindex/indexer.go b/state/txindex/indexer.go index 621ab6e4e..ffd8e151f 100644 --- a/state/txindex/indexer.go +++ b/state/txindex/indexer.go @@ -4,7 +4,8 @@ import ( "context" "errors" - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/libs/pubsub/query" ) @@ -16,31 +17,31 @@ type TxIndexer interface { AddBatch(b *Batch) error // Index analyzes, indexes and stores a single transaction. - Index(result *abci.TxResult) error + Index(result *tmabci.TxResult) error // Get returns the transaction specified by hash or nil if the transaction is not indexed // or stored. - Get(hash []byte) (*abci.TxResult, error) + Get(hash []byte) (*tmabci.TxResult, error) // Search allows you to query for transactions. - Search(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) + Search(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) } // Batch groups together multiple Index operations to be performed at the same time. // NOTE: Batch is NOT thread-safe and must not be modified after starting its execution. type Batch struct { - Ops []*abci.TxResult + Ops []*tmabci.TxResult } // NewBatch creates a new Batch. func NewBatch(n int64) *Batch { return &Batch{ - Ops: make([]*abci.TxResult, n), + Ops: make([]*tmabci.TxResult, n), } } // Add or update an entry for the given result.Index. -func (b *Batch) Add(result *abci.TxResult) error { +func (b *Batch) Add(result *tmabci.TxResult) error { b.Ops[result.Index] = result return nil } diff --git a/state/txindex/indexer_service.go b/state/txindex/indexer_service.go index 268cd2239..bd3e9b4c8 100644 --- a/state/txindex/indexer_service.go +++ b/state/txindex/indexer_service.go @@ -3,6 +3,8 @@ package txindex import ( "context" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" "github.com/line/ostracon/state/indexer" @@ -109,8 +111,8 @@ func (is *IndexerService) OnStop() { // if the current one under investigation is NOT OK, then we need to check // whether there's a previously indexed tx. // SKIP the current tx if the previously indexed record is found and successful. -func DeduplicateBatch(ops []*abci.TxResult, txIdxr TxIndexer) ([]*abci.TxResult, error) { - result := make([]*abci.TxResult, 0, len(ops)) +func DeduplicateBatch(ops []*tmabci.TxResult, txIdxr TxIndexer) ([]*tmabci.TxResult, error) { + result := make([]*tmabci.TxResult, 0, len(ops)) // keep track of successful txs in this block in order to suppress latter ones being indexed. var successfulTxsInThisBlock = make(map[string]struct{}) diff --git a/state/txindex/indexer_service_test.go b/state/txindex/indexer_service_test.go index 59ff8fa17..ff26ceb16 100644 --- a/state/txindex/indexer_service_test.go +++ b/state/txindex/indexer_service_test.go @@ -5,6 +5,7 @@ import ( "time" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -48,19 +49,19 @@ func TestIndexerServiceIndexesBlocks(t *testing.T) { NumTxs: int64(2), }) require.NoError(t, err) - txResult1 := &abci.TxResult{ + txResult1 := &tmabci.TxResult{ Height: 1, Index: uint32(0), Tx: types.Tx("foo"), - Result: abci.ResponseDeliverTx{Code: 0}, + Result: tmabci.ResponseDeliverTx{Code: 0}, } err = eventBus.PublishEventTx(types.EventDataTx{TxResult: *txResult1}) require.NoError(t, err) - txResult2 := &abci.TxResult{ + txResult2 := &tmabci.TxResult{ Height: 1, Index: uint32(1), Tx: types.Tx("bar"), - Result: abci.ResponseDeliverTx{Code: 0}, + Result: tmabci.ResponseDeliverTx{Code: 0}, } err = eventBus.PublishEventTx(types.EventDataTx{TxResult: *txResult2}) require.NoError(t, err) @@ -85,119 +86,119 @@ func TestTxIndexDuplicatePreviouslySuccessful(t *testing.T) { testCases := []struct { name string - tx1 abci.TxResult - tx2 abci.TxResult + tx1 tmabci.TxResult + tx2 tmabci.TxResult expSkip bool // do we expect the second tx to be skipped by tx indexer }{ {"skip, previously successful", - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK, }, }, - abci.TxResult{ + tmabci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK + 1, }, }, true, }, {"not skip, previously unsuccessful", - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK + 1, }, }, - abci.TxResult{ + tmabci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK + 1, }, }, false, }, {"not skip, both successful", - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK, }, }, - abci.TxResult{ + tmabci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK, }, }, false, }, {"not skip, both unsuccessful", - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK + 1, }, }, - abci.TxResult{ + tmabci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK + 1, }, }, false, }, {"skip, same block, previously successful", - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK, }, }, - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK + 1, }, }, true, }, {"not skip, same block, previously unsuccessful", - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK + 1, }, }, - abci.TxResult{ + tmabci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Code: abci.CodeTypeOK, }, }, @@ -212,29 +213,29 @@ func TestTxIndexDuplicatePreviouslySuccessful(t *testing.T) { if tc.tx1.Height != tc.tx2.Height { // index the first tx err := indexer.AddBatch(&txindex.Batch{ - Ops: []*abci.TxResult{&tc.tx1}, + Ops: []*tmabci.TxResult{&tc.tx1}, }) require.NoError(t, err) // check if the second one should be skipped. - ops, err := txindex.DeduplicateBatch([]*abci.TxResult{&tc.tx2}, indexer) + ops, err := txindex.DeduplicateBatch([]*tmabci.TxResult{&tc.tx2}, indexer) require.NoError(t, err) if tc.expSkip { require.Empty(t, ops) } else { - require.Equal(t, []*abci.TxResult{&tc.tx2}, ops) + require.Equal(t, []*tmabci.TxResult{&tc.tx2}, ops) } } else { // same block - ops := []*abci.TxResult{&tc.tx1, &tc.tx2} + ops := []*tmabci.TxResult{&tc.tx1, &tc.tx2} ops, err := txindex.DeduplicateBatch(ops, indexer) require.NoError(t, err) if tc.expSkip { // the second one is skipped - require.Equal(t, []*abci.TxResult{&tc.tx1}, ops) + require.Equal(t, []*tmabci.TxResult{&tc.tx1}, ops) } else { - require.Equal(t, []*abci.TxResult{&tc.tx1, &tc.tx2}, ops) + require.Equal(t, []*tmabci.TxResult{&tc.tx1, &tc.tx2}, ops) } } }) diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index 6855cf244..9636ad24e 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -9,9 +9,9 @@ import ( "strings" "github.com/gogo/protobuf/proto" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/indexer" "github.com/line/ostracon/state/txindex" @@ -38,7 +38,7 @@ func NewTxIndex(store dbm.DB) *TxIndex { // Get gets transaction from the TxIndex storage and returns it or nil if the // transaction is not found. -func (txi *TxIndex) Get(hash []byte) (*abci.TxResult, error) { +func (txi *TxIndex) Get(hash []byte) (*tmabci.TxResult, error) { if len(hash) == 0 { return nil, txindex.ErrorEmptyHash } @@ -51,7 +51,7 @@ func (txi *TxIndex) Get(hash []byte) (*abci.TxResult, error) { return nil, nil } - txResult := new(abci.TxResult) + txResult := new(tmabci.TxResult) err = proto.Unmarshal(rawBytes, txResult) if err != nil { return nil, fmt.Errorf("error reading TxResult: %v", err) @@ -101,7 +101,7 @@ func (txi *TxIndex) AddBatch(b *txindex.Batch) error { // that indexed from the tx's events is a composite of the event type and the // respective attribute's key delimited by a "." (eg. "account.number"). // Any event with an empty type is not indexed. -func (txi *TxIndex) Index(result *abci.TxResult) error { +func (txi *TxIndex) Index(result *tmabci.TxResult) error { b := txi.store.NewBatch() defer b.Close() @@ -132,7 +132,7 @@ func (txi *TxIndex) Index(result *abci.TxResult) error { return b.WriteSync() } -func (txi *TxIndex) indexEvents(result *abci.TxResult, hash []byte, store dbm.Batch) error { +func (txi *TxIndex) indexEvents(result *tmabci.TxResult, hash []byte, store dbm.Batch) error { for _, event := range result.Result.Events { // only index events with a non-empty type if len(event.Type) == 0 { @@ -169,10 +169,10 @@ func (txi *TxIndex) indexEvents(result *abci.TxResult, hash []byte, store dbm.Ba // // Search will exit early and return any result fetched so far, // when a message is received on the context chan. -func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) { +func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) { select { case <-ctx.Done(): - return make([]*abci.TxResult, 0), nil + return make([]*tmabci.TxResult, 0), nil default: } @@ -194,11 +194,11 @@ func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResul res, err := txi.Get(hash) switch { case err != nil: - return []*abci.TxResult{}, fmt.Errorf("error while retrieving the result: %w", err) + return []*tmabci.TxResult{}, fmt.Errorf("error while retrieving the result: %w", err) case res == nil: - return []*abci.TxResult{}, nil + return []*tmabci.TxResult{}, nil default: - return []*abci.TxResult{res}, nil + return []*tmabci.TxResult{res}, nil } } @@ -251,7 +251,7 @@ func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResul } } - results := make([]*abci.TxResult, 0, len(filteredHashes)) + results := make([]*tmabci.TxResult, 0, len(filteredHashes)) for _, h := range filteredHashes { res, err := txi.Get(h) if err != nil { @@ -529,7 +529,7 @@ func extractValueFromKey(key []byte) string { return parts[1] } -func keyForEvent(key string, value []byte, result *abci.TxResult) []byte { +func keyForEvent(key string, value []byte, result *tmabci.TxResult) []byte { return []byte(fmt.Sprintf("%s/%s/%d/%d", key, value, @@ -538,7 +538,7 @@ func keyForEvent(key string, value []byte, result *abci.TxResult) []byte { )) } -func keyForHeight(result *abci.TxResult) []byte { +func keyForHeight(result *tmabci.TxResult) []byte { return []byte(fmt.Sprintf("%s/%d/%d/%d", types.TxHeightKey, result.Height, diff --git a/state/txindex/kv/kv_bench_test.go b/state/txindex/kv/kv_bench_test.go index 9f49cf4b9..b6acfdda0 100644 --- a/state/txindex/kv/kv_bench_test.go +++ b/state/txindex/kv/kv_bench_test.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "testing" + tmabci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -28,10 +29,10 @@ func BenchmarkTxSearch(b *testing.B) { indexer := NewTxIndex(db) for i := 0; i < 35000; i++ { - events := []abci.Event{ + events := []tmabci.Event{ { Type: "transfer", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ {Key: []byte("address"), Value: []byte(fmt.Sprintf("address_%d", i%100)), Index: true}, {Key: []byte("amount"), Value: []byte("50"), Index: true}, }, @@ -43,11 +44,11 @@ func BenchmarkTxSearch(b *testing.B) { b.Errorf("failed produce random bytes: %s", err) } - txResult := &abci.TxResult{ + txResult := &tmabci.TxResult{ Height: int64(i), Index: 0, Tx: types.Tx(string(txBz)), - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Data: []byte{0}, Code: abci.CodeTypeOK, Log: "", diff --git a/state/txindex/kv/kv_test.go b/state/txindex/kv/kv_test.go index 3dd8cd2f7..a63850fbf 100644 --- a/state/txindex/kv/kv_test.go +++ b/state/txindex/kv/kv_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" abci "github.com/line/ostracon/abci/types" @@ -24,11 +25,11 @@ func TestTxIndex(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) tx := types.Tx("HELLO WORLD") - txResult := &abci.TxResult{ + txResult := &tmabci.TxResult{ Height: 1, Index: 0, Tx: tx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Data: []byte{0}, Code: abci.CodeTypeOK, Log: "", Events: nil, }, @@ -47,11 +48,11 @@ func TestTxIndex(t *testing.T) { assert.True(t, proto.Equal(txResult, loadedTxResult)) tx2 := types.Tx("BYE BYE WORLD") - txResult2 := &abci.TxResult{ + txResult2 := &tmabci.TxResult{ Height: 1, Index: 0, Tx: tx2, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Data: []byte{0}, Code: abci.CodeTypeOK, Log: "", Events: nil, }, @@ -69,10 +70,10 @@ func TestTxIndex(t *testing.T) { func TestTxSearch(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) - txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, - {Type: "", Attributes: []abci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, + txResult := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, + {Type: "", Attributes: []tmabci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, }) hash := types.Tx(txResult.Tx).Hash() @@ -143,10 +144,10 @@ func TestTxSearch(t *testing.T) { func TestTxSearchWithCancelation(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) - txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, - {Type: "", Attributes: []abci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, + txResult := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, + {Type: "", Attributes: []tmabci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, }) err := indexer.Index(txResult) require.NoError(t, err) @@ -162,8 +163,8 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) // index tx using events indexing (composite key) - txResult1 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + txResult1 := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, }) hash1 := types.Tx(txResult1.Tx).Hash() @@ -198,27 +199,27 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { testCases := []struct { q string - results []*abci.TxResult + results []*tmabci.TxResult }{ // search by hash - {fmt.Sprintf("tx.hash = '%X'", hash1), []*abci.TxResult{txResult1}}, + {fmt.Sprintf("tx.hash = '%X'", hash1), []*tmabci.TxResult{txResult1}}, // search by hash - {fmt.Sprintf("tx.hash = '%X'", hash2), []*abci.TxResult{txResult2}}, + {fmt.Sprintf("tx.hash = '%X'", hash2), []*tmabci.TxResult{txResult2}}, // search by exact match (one key) - {"account.number = 1", []*abci.TxResult{txResult1}}, - {"account.number >= 1 AND account.number <= 5", []*abci.TxResult{txResult1}}, + {"account.number = 1", []*tmabci.TxResult{txResult1}}, + {"account.number >= 1 AND account.number <= 5", []*tmabci.TxResult{txResult1}}, // search by range (lower bound) - {"account.number >= 1", []*abci.TxResult{txResult1}}, + {"account.number >= 1", []*tmabci.TxResult{txResult1}}, // search by range (upper bound) - {"account.number <= 5", []*abci.TxResult{txResult1}}, + {"account.number <= 5", []*tmabci.TxResult{txResult1}}, // search using not allowed key - {"not_allowed = 'boom'", []*abci.TxResult{}}, + {"not_allowed = 'boom'", []*tmabci.TxResult{}}, // search for not existing tx result - {"account.number >= 2 AND account.number <= 5", []*abci.TxResult{}}, + {"account.number >= 2 AND account.number <= 5", []*tmabci.TxResult{}}, // search using not existing key - {"account.date >= TIME 2013-05-03T14:45:00Z", []*abci.TxResult{}}, + {"account.date >= TIME 2013-05-03T14:45:00Z", []*tmabci.TxResult{}}, // search by deprecated key - {"sender = 'addr1'", []*abci.TxResult{txResult2}}, + {"sender = 'addr1'", []*tmabci.TxResult{txResult2}}, } ctx := context.Background() @@ -240,9 +241,9 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { func TestTxSearchOneTxWithMultipleSameTagsButDifferentValues(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) - txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, + txResult := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, }) err := indexer.Index(txResult) @@ -263,8 +264,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) // indexed first, but bigger height (to test the order of transactions) - txResult := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + txResult := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, }) txResult.Tx = types.Tx("Bob's account") @@ -274,8 +275,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { require.NoError(t, err) // indexed second, but smaller height (to test the order of transactions) - txResult2 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, + txResult2 := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, }) txResult2.Tx = types.Tx("Alice's account") txResult2.Height = 1 @@ -285,8 +286,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { require.NoError(t, err) // indexed third (to test the order of transactions) - txResult3 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("3"), Index: true}}}, + txResult3 := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("3"), Index: true}}}, }) txResult3.Tx = types.Tx("Jack's account") txResult3.Height = 1 @@ -296,8 +297,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { // indexed fourth (to test we don't include txs with similar events) // https://github.com/tendermint/tendermint/issues/2908 - txResult4 := txResultWithEvents([]abci.Event{ - {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number.id"), Value: []byte("1"), Index: true}}}, + txResult4 := txResultWithEvents([]tmabci.Event{ + {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number.id"), Value: []byte("1"), Index: true}}}, }) txResult4.Tx = types.Tx("Mike's account") txResult4.Height = 2 @@ -313,13 +314,13 @@ func TestTxSearchMultipleTxs(t *testing.T) { require.Len(t, results, 3) } -func txResultWithEvents(events []abci.Event) *abci.TxResult { +func txResultWithEvents(events []tmabci.Event) *tmabci.TxResult { tx := types.Tx("HELLO WORLD") - return &abci.TxResult{ + return &tmabci.TxResult{ Height: 1, Index: 0, Tx: tx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Data: []byte{0}, Code: abci.CodeTypeOK, Log: "", @@ -341,15 +342,15 @@ func benchmarkTxIndex(txsCount int64, b *testing.B) { txIndex := uint32(0) for i := int64(0); i < txsCount; i++ { tx := tmrand.Bytes(250) - txResult := &abci.TxResult{ + txResult := &tmabci.TxResult{ Height: 1, Index: txIndex, Tx: tx, - Result: abci.ResponseDeliverTx{ + Result: tmabci.ResponseDeliverTx{ Data: []byte{0}, Code: abci.CodeTypeOK, Log: "", - Events: []abci.Event{}, + Events: []tmabci.Event{}, }, } if err := batch.Add(txResult); err != nil { diff --git a/state/txindex/null/null.go b/state/txindex/null/null.go index 5654ced74..75d505c42 100644 --- a/state/txindex/null/null.go +++ b/state/txindex/null/null.go @@ -4,7 +4,8 @@ import ( "context" "errors" - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/txindex" ) @@ -15,7 +16,7 @@ var _ txindex.TxIndexer = (*TxIndex)(nil) type TxIndex struct{} // Get on a TxIndex is disabled and panics when invoked. -func (txi *TxIndex) Get(hash []byte) (*abci.TxResult, error) { +func (txi *TxIndex) Get(hash []byte) (*tmabci.TxResult, error) { return nil, errors.New(`indexing is disabled (set 'tx_index = "kv"' in config)`) } @@ -25,10 +26,10 @@ func (txi *TxIndex) AddBatch(batch *txindex.Batch) error { } // Index is a noop and always returns nil. -func (txi *TxIndex) Index(result *abci.TxResult) error { +func (txi *TxIndex) Index(result *tmabci.TxResult) error { return nil } -func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) { - return []*abci.TxResult{}, nil +func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) { + return []*tmabci.TxResult{}, nil } diff --git a/statesync/reactor.go b/statesync/reactor.go index c0000d692..082f580d2 100644 --- a/statesync/reactor.go +++ b/statesync/reactor.go @@ -5,9 +5,9 @@ import ( "sort" "time" + tmabci "github.com/tendermint/tendermint/abci/types" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" @@ -177,7 +177,7 @@ func (r *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { case *ssproto.ChunkRequest: r.Logger.Debug("Received chunk request", "height", msg.Height, "format", msg.Format, "chunk", msg.Index, "peer", src.ID()) - resp, err := r.conn.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{ + resp, err := r.conn.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{ Height: msg.Height, Format: msg.Format, Chunk: msg.Index, @@ -230,7 +230,7 @@ func (r *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { // recentSnapshots fetches the n most recent snapshots from the app func (r *Reactor) recentSnapshots(n uint32) ([]*snapshot, error) { - resp, err := r.conn.ListSnapshotsSync(abci.RequestListSnapshots{}) + resp, err := r.conn.ListSnapshotsSync(tmabci.RequestListSnapshots{}) if err != nil { return nil, err } diff --git a/statesync/reactor_test.go b/statesync/reactor_test.go index db835e4f4..665c681f9 100644 --- a/statesync/reactor_test.go +++ b/statesync/reactor_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" @@ -51,11 +51,11 @@ func TestReactor_Receive_ChunkRequest(t *testing.T) { t.Run(name, func(t *testing.T) { // Mock ABCI connection to return local snapshots conn := &proxymocks.AppConnSnapshot{} - conn.On("LoadSnapshotChunkSync", abci.RequestLoadSnapshotChunk{ + conn.On("LoadSnapshotChunkSync", tmabci.RequestLoadSnapshotChunk{ Height: tc.request.Height, Format: tc.request.Format, Chunk: tc.request.Index, - }).Return(&abci.ResponseLoadSnapshotChunk{Chunk: tc.chunk}, nil) + }).Return(&tmabci.ResponseLoadSnapshotChunk{Chunk: tc.chunk}, nil) // Mock peer to store response, if found peer := &p2pmocks.Peer{} @@ -92,12 +92,12 @@ func TestReactor_Receive_ChunkRequest(t *testing.T) { func TestReactor_Receive_SnapshotsRequest(t *testing.T) { testcases := map[string]struct { - snapshots []*abci.Snapshot + snapshots []*tmabci.Snapshot expectResponses []*ssproto.SnapshotsResponse }{ "no snapshots": {nil, []*ssproto.SnapshotsResponse{}}, ">10 unordered snapshots": { - []*abci.Snapshot{ + []*tmabci.Snapshot{ {Height: 1, Format: 2, Chunks: 7, Hash: []byte{1, 2}, Metadata: []byte{1}}, {Height: 2, Format: 2, Chunks: 7, Hash: []byte{2, 2}, Metadata: []byte{2}}, {Height: 3, Format: 2, Chunks: 7, Hash: []byte{3, 2}, Metadata: []byte{3}}, @@ -131,7 +131,7 @@ func TestReactor_Receive_SnapshotsRequest(t *testing.T) { t.Run(name, func(t *testing.T) { // Mock ABCI connection to return local snapshots conn := &proxymocks.AppConnSnapshot{} - conn.On("ListSnapshotsSync", abci.RequestListSnapshots{}).Return(&abci.ResponseListSnapshots{ + conn.On("ListSnapshotsSync", tmabci.RequestListSnapshots{}).Return(&tmabci.ResponseListSnapshots{ Snapshots: tc.snapshots, }, nil) @@ -207,18 +207,18 @@ func makeTestStateSyncReactor( func makeMockAppConnSnapshot(appHash string, snapshot *snapshot, chunks []*chunk) *proxymocks.AppConnSnapshot { connSnapshot := &proxymocks.AppConnSnapshot{} - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ - Snapshot: &abci.Snapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + Snapshot: &tmabci.Snapshot{ Height: snapshot.Height, Format: snapshot.Format, Chunks: snapshot.Chunks, Hash: snapshot.Hash, }, AppHash: []byte(appHash), - }).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) + }).Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT}, nil) - connSnapshot.On("ListSnapshotsSync", abci.RequestListSnapshots{}).Return(&abci.ResponseListSnapshots{ - Snapshots: []*abci.Snapshot{{ + connSnapshot.On("ListSnapshotsSync", tmabci.RequestListSnapshots{}).Return(&tmabci.ResponseListSnapshots{ + Snapshots: []*tmabci.Snapshot{{ Height: snapshot.Height, Format: snapshot.Format, Chunks: snapshot.Chunks, @@ -230,10 +230,10 @@ func makeMockAppConnSnapshot(appHash string, snapshot *snapshot, chunks []*chunk index := len(chunks) for i := 0; i < index; i++ { connSnapshot.On("ApplySnapshotChunkSync", - mock.Anything).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("LoadSnapshotChunkSync", abci.RequestLoadSnapshotChunk{ + mock.Anything).Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("LoadSnapshotChunkSync", tmabci.RequestLoadSnapshotChunk{ Height: chunks[i].Height, Format: chunks[i].Format, Chunk: chunks[i].Index, - }).Return(&abci.ResponseLoadSnapshotChunk{Chunk: chunks[i].Chunk}, nil) + }).Return(&tmabci.ResponseLoadSnapshotChunk{Chunk: chunks[i].Chunk}, nil) } return connSnapshot @@ -241,7 +241,7 @@ func makeMockAppConnSnapshot(appHash string, snapshot *snapshot, chunks []*chunk func makeMockAppConnQuery(appHash string, height int64) *proxymocks.AppConnQuery { connQuery := &proxymocks.AppConnQuery{} - connQuery.On("InfoSync", proxy.RequestInfo).Return(&abci.ResponseInfo{ + connQuery.On("InfoSync", proxy.RequestInfo).Return(&tmabci.ResponseInfo{ AppVersion: testAppVersion, LastBlockHeight: height, LastBlockAppHash: []byte(appHash), diff --git a/statesync/syncer.go b/statesync/syncer.go index 391e2dde4..0f51d323c 100644 --- a/statesync/syncer.go +++ b/statesync/syncer.go @@ -7,9 +7,9 @@ import ( "fmt" "time" + tmabci "github.com/tendermint/tendermint/abci/types" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmsync "github.com/line/ostracon/libs/sync" @@ -332,8 +332,8 @@ func (s *syncer) Sync(snapshot *snapshot, chunks *chunkQueue) (sm.State, sm.Stat func (s *syncer) offerSnapshot(snapshot *snapshot) error { s.logger.Info("Offering snapshot to ABCI app", "height", snapshot.Height, "format", snapshot.Format, "hash", snapshot.Hash) - resp, err := s.conn.OfferSnapshotSync(abci.RequestOfferSnapshot{ - Snapshot: &abci.Snapshot{ + resp, err := s.conn.OfferSnapshotSync(tmabci.RequestOfferSnapshot{ + Snapshot: &tmabci.Snapshot{ Height: snapshot.Height, Format: snapshot.Format, Chunks: snapshot.Chunks, @@ -346,17 +346,17 @@ func (s *syncer) offerSnapshot(snapshot *snapshot) error { return fmt.Errorf("failed to offer snapshot: %w", err) } switch resp.Result { - case abci.ResponseOfferSnapshot_ACCEPT: + case tmabci.ResponseOfferSnapshot_ACCEPT: s.logger.Info("Snapshot accepted, restoring", "height", snapshot.Height, "format", snapshot.Format, "hash", snapshot.Hash) return nil - case abci.ResponseOfferSnapshot_ABORT: + case tmabci.ResponseOfferSnapshot_ABORT: return errAbort - case abci.ResponseOfferSnapshot_REJECT: + case tmabci.ResponseOfferSnapshot_REJECT: return errRejectSnapshot - case abci.ResponseOfferSnapshot_REJECT_FORMAT: + case tmabci.ResponseOfferSnapshot_REJECT_FORMAT: return errRejectFormat - case abci.ResponseOfferSnapshot_REJECT_SENDER: + case tmabci.ResponseOfferSnapshot_REJECT_SENDER: return errRejectSender default: return fmt.Errorf("unknown ResponseOfferSnapshot result %v", resp.Result) @@ -374,7 +374,7 @@ func (s *syncer) applyChunks(chunks *chunkQueue) error { return fmt.Errorf("failed to fetch chunk: %w", err) } - resp, err := s.conn.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{ + resp, err := s.conn.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{ Index: chunk.Index, Chunk: chunk.Chunk, Sender: string(chunk.Sender), @@ -405,14 +405,14 @@ func (s *syncer) applyChunks(chunks *chunkQueue) error { } switch resp.Result { - case abci.ResponseApplySnapshotChunk_ACCEPT: - case abci.ResponseApplySnapshotChunk_ABORT: + case tmabci.ResponseApplySnapshotChunk_ACCEPT: + case tmabci.ResponseApplySnapshotChunk_ABORT: return errAbort - case abci.ResponseApplySnapshotChunk_RETRY: + case tmabci.ResponseApplySnapshotChunk_RETRY: chunks.Retry(chunk.Index) - case abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT: + case tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT: return errRetrySnapshot - case abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT: + case tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT: return errRejectSnapshot default: return fmt.Errorf("unknown ResponseApplySnapshotChunk result %v", resp.Result) diff --git a/statesync/syncer_test.go b/statesync/syncer_test.go index 7983b7fc1..ca489efd6 100644 --- a/statesync/syncer_test.go +++ b/statesync/syncer_test.go @@ -12,11 +12,11 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmsync "github.com/line/ostracon/libs/sync" @@ -129,17 +129,17 @@ func TestSyncer_SyncAny(t *testing.T) { // We start a sync, with peers sending back chunks when requested. We first reject the snapshot // with height 2 format 2, and accept the snapshot at height 1. - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ - Snapshot: &abci.Snapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + Snapshot: &tmabci.Snapshot{ Height: 2, Format: 2, Chunks: 3, Hash: []byte{1}, }, AppHash: []byte("app_hash_2"), - }).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ - Snapshot: &abci.Snapshot{ + }).Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + Snapshot: &tmabci.Snapshot{ Height: s.Height, Format: s.Format, Chunks: s.Chunks, @@ -147,7 +147,7 @@ func TestSyncer_SyncAny(t *testing.T) { Metadata: s.Metadata, }, AppHash: []byte("app_hash"), - }).Times(2).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) + }).Times(2).Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT}, nil) chunkRequests := make(map[uint32]int) chunkRequestsMtx := tmsync.Mutex{} @@ -173,24 +173,24 @@ func TestSyncer_SyncAny(t *testing.T) { // The first time we're applying chunk 2 we tell it to retry the snapshot and discard chunk 1, // which should cause it to keep the existing chunk 0 and 2, and restart restoration from // beginning. We also wait for a little while, to exercise the retry logic in fetchChunks(). - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{1, 1, 2}, }).Once().Run(func(args mock.Arguments) { time.Sleep(2 * time.Second) }).Return( - &abci.ResponseApplySnapshotChunk{ - Result: abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, + &tmabci.ResponseApplySnapshotChunk{ + Result: tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, RefetchChunks: []uint32{1}, }, nil) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 0, Chunk: []byte{1, 1, 0}, - }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + }).Times(2).Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 1, Chunk: []byte{1, 1, 1}, - }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + }).Times(2).Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{1, 1, 2}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connQuery.On("InfoSync", proxy.RequestInfo).Return(&abci.ResponseInfo{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connQuery.On("InfoSync", proxy.RequestInfo).Return(&tmabci.ResponseInfo{ AppVersion: testAppVersion, LastBlockHeight: 1, LastBlockAppHash: []byte("app_hash"), @@ -230,9 +230,9 @@ func TestSyncer_SyncAny_abort(t *testing.T) { s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} _, err := syncer.AddSnapshot(simplePeer("id"), s) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ABORT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errAbort, err) @@ -253,17 +253,17 @@ func TestSyncer_SyncAny_reject(t *testing.T) { _, err = syncer.AddSnapshot(simplePeer("id"), s11) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s12), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errNoSnapshots, err) @@ -284,13 +284,13 @@ func TestSyncer_SyncAny_reject_format(t *testing.T) { _, err = syncer.AddSnapshot(simplePeer("id"), s11) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ABORT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errAbort, err) @@ -322,13 +322,13 @@ func TestSyncer_SyncAny_reject_sender(t *testing.T) { _, err = syncer.AddSnapshot(peerC, sbc) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(sbc), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_SENDER}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT_SENDER}, nil) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(sa), AppHash: []byte("app_hash"), - }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errNoSnapshots, err) @@ -342,7 +342,7 @@ func TestSyncer_SyncAny_abciError(t *testing.T) { s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} _, err := syncer.AddSnapshot(simplePeer("id"), s) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), }).Once().Return(nil, errBoom) @@ -356,16 +356,16 @@ func TestSyncer_offerSnapshot(t *testing.T) { boom := errors.New("boom") testcases := map[string]struct { - result abci.ResponseOfferSnapshot_Result + result tmabci.ResponseOfferSnapshot_Result err error expectErr error }{ - "accept": {abci.ResponseOfferSnapshot_ACCEPT, nil, nil}, - "abort": {abci.ResponseOfferSnapshot_ABORT, nil, errAbort}, - "reject": {abci.ResponseOfferSnapshot_REJECT, nil, errRejectSnapshot}, - "reject_format": {abci.ResponseOfferSnapshot_REJECT_FORMAT, nil, errRejectFormat}, - "reject_sender": {abci.ResponseOfferSnapshot_REJECT_SENDER, nil, errRejectSender}, - "unknown": {abci.ResponseOfferSnapshot_UNKNOWN, nil, unknownErr}, + "accept": {tmabci.ResponseOfferSnapshot_ACCEPT, nil, nil}, + "abort": {tmabci.ResponseOfferSnapshot_ABORT, nil, errAbort}, + "reject": {tmabci.ResponseOfferSnapshot_REJECT, nil, errRejectSnapshot}, + "reject_format": {tmabci.ResponseOfferSnapshot_REJECT_FORMAT, nil, errRejectFormat}, + "reject_sender": {tmabci.ResponseOfferSnapshot_REJECT_SENDER, nil, errRejectSender}, + "unknown": {tmabci.ResponseOfferSnapshot_UNKNOWN, nil, unknownErr}, "error": {0, boom, boom}, "unknown non-zero": {9, nil, unknownErr}, } @@ -374,10 +374,10 @@ func TestSyncer_offerSnapshot(t *testing.T) { t.Run(name, func(t *testing.T) { syncer, connSnapshot := setupOfferSyncer(t) s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} - connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Return(&abci.ResponseOfferSnapshot{Result: tc.result}, tc.err) + }).Return(&tmabci.ResponseOfferSnapshot{Result: tc.result}, tc.err) err := syncer.offerSnapshot(s) if tc.expectErr == unknownErr { require.Error(t, err) @@ -397,16 +397,16 @@ func TestSyncer_applyChunks_Results(t *testing.T) { boom := errors.New("boom") testcases := map[string]struct { - result abci.ResponseApplySnapshotChunk_Result + result tmabci.ResponseApplySnapshotChunk_Result err error expectErr error }{ - "accept": {abci.ResponseApplySnapshotChunk_ACCEPT, nil, nil}, - "abort": {abci.ResponseApplySnapshotChunk_ABORT, nil, errAbort}, - "retry": {abci.ResponseApplySnapshotChunk_RETRY, nil, nil}, - "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, nil, errRetrySnapshot}, - "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT, nil, errRejectSnapshot}, - "unknown": {abci.ResponseApplySnapshotChunk_UNKNOWN, nil, unknownErr}, + "accept": {tmabci.ResponseApplySnapshotChunk_ACCEPT, nil, nil}, + "abort": {tmabci.ResponseApplySnapshotChunk_ABORT, nil, errAbort}, + "retry": {tmabci.ResponseApplySnapshotChunk_RETRY, nil, nil}, + "retry_snapshot": {tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, nil, errRetrySnapshot}, + "reject_snapshot": {tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT, nil, errRejectSnapshot}, + "unknown": {tmabci.ResponseApplySnapshotChunk_UNKNOWN, nil, unknownErr}, "error": {0, boom, boom}, "unknown non-zero": {9, nil, unknownErr}, } @@ -427,14 +427,14 @@ func TestSyncer_applyChunks_Results(t *testing.T) { _, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 0, Chunk: body}) require.NoError(t, err) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 0, Chunk: body, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: tc.result}, tc.err) - if tc.result == abci.ResponseApplySnapshotChunk_RETRY { - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tc.result}, tc.err) + if tc.result == tmabci.ResponseApplySnapshotChunk_RETRY { + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 0, Chunk: body, - }).Once().Return(&abci.ResponseApplySnapshotChunk{ - Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{ + Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) } err = syncer.applyChunks(chunks) @@ -455,13 +455,13 @@ func TestSyncer_applyChunks_Results(t *testing.T) { func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { // Discarding chunks via refetch_chunks should work the same for all results testcases := map[string]struct { - result abci.ResponseApplySnapshotChunk_Result + result tmabci.ResponseApplySnapshotChunk_Result }{ - "accept": {abci.ResponseApplySnapshotChunk_ACCEPT}, - "abort": {abci.ResponseApplySnapshotChunk_ABORT}, - "retry": {abci.ResponseApplySnapshotChunk_RETRY}, - "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, - "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, + "accept": {tmabci.ResponseApplySnapshotChunk_ACCEPT}, + "abort": {tmabci.ResponseApplySnapshotChunk_ABORT}, + "retry": {tmabci.ResponseApplySnapshotChunk_RETRY}, + "retry_snapshot": {tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, + "reject_snapshot": {tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, } for name, tc := range testcases { tc := tc @@ -487,15 +487,15 @@ func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { require.NoError(t, err) // The first two chunks are accepted, before the last one asks for 1 to be refetched - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 0, Chunk: []byte{0}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 1, Chunk: []byte{1}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{2}, - }).Once().Return(&abci.ResponseApplySnapshotChunk{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{ Result: tc.result, RefetchChunks: []uint32{1}, }, nil) @@ -520,13 +520,13 @@ func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { func TestSyncer_applyChunks_RejectSenders(t *testing.T) { // Banning chunks senders via ban_chunk_senders should work the same for all results testcases := map[string]struct { - result abci.ResponseApplySnapshotChunk_Result + result tmabci.ResponseApplySnapshotChunk_Result }{ - "accept": {abci.ResponseApplySnapshotChunk_ACCEPT}, - "abort": {abci.ResponseApplySnapshotChunk_ABORT}, - "retry": {abci.ResponseApplySnapshotChunk_RETRY}, - "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, - "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, + "accept": {tmabci.ResponseApplySnapshotChunk_ACCEPT}, + "abort": {tmabci.ResponseApplySnapshotChunk_ABORT}, + "retry": {tmabci.ResponseApplySnapshotChunk_RETRY}, + "retry_snapshot": {tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, + "reject_snapshot": {tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, } for name, tc := range testcases { tc := tc @@ -573,24 +573,24 @@ func TestSyncer_applyChunks_RejectSenders(t *testing.T) { require.NoError(t, err) // The first two chunks are accepted, before the last one asks for b sender to be rejected - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 0, Chunk: []byte{0}, Sender: "a", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 1, Chunk: []byte{1}, Sender: "b", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{2}, Sender: "c", - }).Once().Return(&abci.ResponseApplySnapshotChunk{ + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{ Result: tc.result, RejectSenders: []string{string(peerB.ID())}, }, nil) // On retry, the last chunk will be tried again, so we just accept it then. - if tc.result == abci.ResponseApplySnapshotChunk_RETRY { - connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ + if tc.result == tmabci.ResponseApplySnapshotChunk_RETRY { + connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{2}, Sender: "c", - }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) } // We don't really care about the result of applyChunks, since it has separate test. @@ -626,26 +626,26 @@ func TestSyncer_verifyApp(t *testing.T) { s := &snapshot{Height: 3, Format: 1, Chunks: 5, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} testcases := map[string]struct { - response *abci.ResponseInfo + response *tmabci.ResponseInfo err error expectErr error }{ - "verified": {&abci.ResponseInfo{ + "verified": {&tmabci.ResponseInfo{ LastBlockHeight: 3, LastBlockAppHash: []byte("app_hash"), AppVersion: appVersion, }, nil, nil}, - "invalid app version": {&abci.ResponseInfo{ + "invalid app version": {&tmabci.ResponseInfo{ LastBlockHeight: 3, LastBlockAppHash: []byte("app_hash"), AppVersion: invalidAppVersion, }, nil, appVersionMismatchErr}, - "invalid height": {&abci.ResponseInfo{ + "invalid height": {&tmabci.ResponseInfo{ LastBlockHeight: 5, LastBlockAppHash: []byte("app_hash"), AppVersion: appVersion, }, nil, errVerifyFailed}, - "invalid hash": {&abci.ResponseInfo{ + "invalid hash": {&tmabci.ResponseInfo{ LastBlockHeight: 3, LastBlockAppHash: []byte("xxx"), AppVersion: appVersion, @@ -706,7 +706,7 @@ func TestSyncer_Sync(t *testing.T) { stateProvider.On("AppHash", mock.Anything, mock.Anything).Return([]byte("app_hash"), nil) connSnapshot.On("OfferSnapshotSync", mock.Anything).Return( - &abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) + &tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT}, nil) snapshot.Height = 2 { @@ -780,8 +780,8 @@ func TestSyncer_Sync(t *testing.T) { } } -func toABCI(s *snapshot) *abci.Snapshot { - return &abci.Snapshot{ +func toABCI(s *snapshot) *tmabci.Snapshot { + return &tmabci.Snapshot{ Height: s.Height, Format: s.Format, Chunks: s.Chunks, diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index 643e21372..82c26c478 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/abci/example/code" abci "github.com/line/ostracon/abci/types" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -30,7 +32,7 @@ type Application struct { state *State snapshots *SnapshotStore cfg *Config - restoreSnapshot *abci.Snapshot + restoreSnapshot *tmabci.Snapshot restoreChunks [][]byte } @@ -109,8 +111,8 @@ func NewApplication(cfg *Config) (*Application, error) { } // Info implements ABCI. -func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo { - return abci.ResponseInfo{ +func (app *Application) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { + return tmabci.ResponseInfo{ Version: version.ABCIVersion, AppVersion: E2EAppVersion, LastBlockHeight: int64(app.state.Height), @@ -138,7 +140,7 @@ func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitCh } // CheckTx implements ABCI. -func (app *Application) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { +func (app *Application) CheckTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { _, _, err := parseTx(req.Tx) if err != nil { return abci.ResponseCheckTx{ @@ -155,17 +157,17 @@ func (app *Application) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { } // DeliverTx implements ABCI. -func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { key, value, err := parseTx(req.Tx) if err != nil { panic(err) // shouldn't happen since we verified it in CheckTx } app.state.Set(key, value) - return abci.ResponseDeliverTx{Code: code.CodeTypeOK} + return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} } // EndBlock implements ABCI. -func (app *Application) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { +func (app *Application) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { valUpdates, err := app.validatorUpdates(uint64(req.Height)) if err != nil { panic(err) @@ -173,10 +175,10 @@ func (app *Application) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock return abci.ResponseEndBlock{ ValidatorUpdates: valUpdates, - Events: []abci.Event{ + Events: []tmabci.Event{ { Type: "val_updates", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ { Key: []byte("size"), Value: []byte(strconv.Itoa(valUpdates.Len())), @@ -192,7 +194,7 @@ func (app *Application) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock } // Commit implements ABCI. -func (app *Application) Commit() abci.ResponseCommit { +func (app *Application) Commit() tmabci.ResponseCommit { height, hash, err := app.state.Commit() if err != nil { panic(err) @@ -208,15 +210,15 @@ func (app *Application) Commit() abci.ResponseCommit { if app.cfg.RetainBlocks > 0 { retainHeight = int64(height - app.cfg.RetainBlocks + 1) } - return abci.ResponseCommit{ + return tmabci.ResponseCommit{ Data: hash, RetainHeight: retainHeight, } } // Query implements ABCI. -func (app *Application) Query(req abci.RequestQuery) abci.ResponseQuery { - return abci.ResponseQuery{ +func (app *Application) Query(req tmabci.RequestQuery) tmabci.ResponseQuery { + return tmabci.ResponseQuery{ Height: int64(app.state.Height), Key: req.Data, Value: []byte(app.state.Get(string(req.Data))), @@ -224,35 +226,35 @@ func (app *Application) Query(req abci.RequestQuery) abci.ResponseQuery { } // ListSnapshots implements ABCI. -func (app *Application) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots { +func (app *Application) ListSnapshots(req tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { snapshots, err := app.snapshots.List() if err != nil { panic(err) } - return abci.ResponseListSnapshots{Snapshots: snapshots} + return tmabci.ResponseListSnapshots{Snapshots: snapshots} } // LoadSnapshotChunk implements ABCI. -func (app *Application) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { +func (app *Application) LoadSnapshotChunk(req tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { chunk, err := app.snapshots.LoadChunk(req.Height, req.Format, req.Chunk) if err != nil { panic(err) } - return abci.ResponseLoadSnapshotChunk{Chunk: chunk} + return tmabci.ResponseLoadSnapshotChunk{Chunk: chunk} } // OfferSnapshot implements ABCI. -func (app *Application) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { +func (app *Application) OfferSnapshot(req tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { if app.restoreSnapshot != nil { panic("A snapshot is already being restored") } app.restoreSnapshot = req.Snapshot app.restoreChunks = [][]byte{} - return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT} + return tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT} } // ApplySnapshotChunk implements ABCI. -func (app *Application) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { +func (app *Application) ApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { if app.restoreSnapshot == nil { panic("No restore in progress") } @@ -269,7 +271,7 @@ func (app *Application) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) a app.restoreSnapshot = nil app.restoreChunks = nil } - return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT} + return tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT} } func (app *Application) Rollback() error { diff --git a/test/e2e/app/snapshots.go b/test/e2e/app/snapshots.go index 724d4de5c..6c766b14b 100644 --- a/test/e2e/app/snapshots.go +++ b/test/e2e/app/snapshots.go @@ -9,7 +9,7 @@ import ( "path/filepath" "sync" - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" ) const ( @@ -22,7 +22,7 @@ const ( type SnapshotStore struct { sync.RWMutex dir string - metadata []abci.Snapshot + metadata []tmabci.Snapshot } // NewSnapshotStore creates a new snapshot store. @@ -41,7 +41,7 @@ func NewSnapshotStore(dir string) (*SnapshotStore, error) { // called internally on construction. func (s *SnapshotStore) loadMetadata() error { file := filepath.Join(s.dir, "metadata.json") - metadata := []abci.Snapshot{} + metadata := []tmabci.Snapshot{} bz, err := os.ReadFile(file) switch { @@ -78,14 +78,14 @@ func (s *SnapshotStore) saveMetadata() error { } // Create creates a snapshot of the given application state's key/value pairs. -func (s *SnapshotStore) Create(state *State) (abci.Snapshot, error) { +func (s *SnapshotStore) Create(state *State) (tmabci.Snapshot, error) { s.Lock() defer s.Unlock() bz, err := state.Export() if err != nil { - return abci.Snapshot{}, err + return tmabci.Snapshot{}, err } - snapshot := abci.Snapshot{ + snapshot := tmabci.Snapshot{ Height: state.Height, Format: 1, Hash: hashItems(state.Values), @@ -93,21 +93,21 @@ func (s *SnapshotStore) Create(state *State) (abci.Snapshot, error) { } err = os.WriteFile(filepath.Join(s.dir, fmt.Sprintf("%v.json", state.Height)), bz, 0o644) //nolint:gosec if err != nil { - return abci.Snapshot{}, err + return tmabci.Snapshot{}, err } s.metadata = append(s.metadata, snapshot) err = s.saveMetadata() if err != nil { - return abci.Snapshot{}, err + return tmabci.Snapshot{}, err } return snapshot, nil } // List lists available snapshots. -func (s *SnapshotStore) List() ([]*abci.Snapshot, error) { +func (s *SnapshotStore) List() ([]*tmabci.Snapshot, error) { s.RLock() defer s.RUnlock() - snapshots := make([]*abci.Snapshot, len(s.metadata)) + snapshots := make([]*tmabci.Snapshot, len(s.metadata)) for idx := range s.metadata { snapshots[idx] = &s.metadata[idx] } diff --git a/types/event_bus.go b/types/event_bus.go index 2bd602e6e..11e4ab6f1 100644 --- a/types/event_bus.go +++ b/types/event_bus.go @@ -4,7 +4,8 @@ import ( "context" "fmt" - "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/libs/log" tmpubsub "github.com/line/ostracon/libs/pubsub" "github.com/line/ostracon/libs/service" @@ -29,7 +30,7 @@ type Subscription interface { // EventBus is a common bus for all events going through the system. All calls // are proxied to underlying pubsub server. All events must be published using -// EventBus to ensure correct data types. +// EventBus to ensure correct data abci. type EventBus struct { service.BaseService pubsub *tmpubsub.Server @@ -109,7 +110,7 @@ func (b *EventBus) Publish(eventType string, eventData OCEventData) error { // map of stringified events where each key is composed of the event // type and each of the event's attributes keys in the form of // "{event.Type}.{attribute.Key}" and the value is each attribute's value. -func (b *EventBus) validateAndStringifyEvents(events []types.Event, logger log.Logger) map[string][]string { +func (b *EventBus) validateAndStringifyEvents(events []tmabci.Event, logger log.Logger) map[string][]string { result := make(map[string][]string) for _, event := range events { if len(event.Type) == 0 { diff --git a/types/event_bus_test.go b/types/event_bus_test.go index f0e93a754..94a21b2f2 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" tmpubsub "github.com/line/ostracon/libs/pubsub" tmquery "github.com/line/ostracon/libs/pubsub/query" @@ -27,10 +29,10 @@ func TestEventBusPublishEventTx(t *testing.T) { }) tx := Tx("foo") - result := abci.ResponseDeliverTx{ + result := tmabci.ResponseDeliverTx{ Data: []byte("bar"), - Events: []abci.Event{ - {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, + Events: []tmabci.Event{ + {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } @@ -50,7 +52,7 @@ func TestEventBusPublishEventTx(t *testing.T) { close(done) }() - err = eventBus.PublishEventTx(EventDataTx{abci.TxResult{ + err = eventBus.PublishEventTx(EventDataTx{tmabci.TxResult{ Height: 1, Index: 0, Tx: tx, @@ -76,14 +78,14 @@ func TestEventBusPublishEventNewBlock(t *testing.T) { }) block := MakeBlock(0, []Tx{}, nil, []Evidence{}, TestConsensusVersion) - resultBeginBlock := abci.ResponseBeginBlock{ - Events: []abci.Event{ - {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, + resultBeginBlock := tmabci.ResponseBeginBlock{ + Events: []tmabci.Event{ + {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } resultEndBlock := abci.ResponseEndBlock{ - Events: []abci.Event{ - {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, + Events: []tmabci.Event{ + {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, }, } @@ -127,12 +129,12 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }) tx := Tx("foo") - result := abci.ResponseDeliverTx{ + result := tmabci.ResponseDeliverTx{ Data: []byte("bar"), - Events: []abci.Event{ + Events: []tmabci.Event{ { Type: "transfer", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ {Key: []byte("sender"), Value: []byte("foo")}, {Key: []byte("recipient"), Value: []byte("bar")}, {Key: []byte("amount"), Value: []byte("5")}, @@ -140,7 +142,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }, { Type: "transfer", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ {Key: []byte("sender"), Value: []byte("baz")}, {Key: []byte("recipient"), Value: []byte("cat")}, {Key: []byte("amount"), Value: []byte("13")}, @@ -148,7 +150,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }, { Type: "withdraw.rewards", - Attributes: []abci.EventAttribute{ + Attributes: []tmabci.EventAttribute{ {Key: []byte("address"), Value: []byte("bar")}, {Key: []byte("source"), Value: []byte("iceman")}, {Key: []byte("amount"), Value: []byte("33")}, @@ -203,7 +205,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { } }() - err = eventBus.PublishEventTx(EventDataTx{abci.TxResult{ + err = eventBus.PublishEventTx(EventDataTx{tmabci.TxResult{ Height: 1, Index: 0, Tx: tx, @@ -235,14 +237,14 @@ func TestEventBusPublishEventNewBlockHeader(t *testing.T) { }) block := MakeBlock(0, []Tx{}, nil, []Evidence{}, TestConsensusVersion) - resultBeginBlock := abci.ResponseBeginBlock{ - Events: []abci.Event{ - {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, + resultBeginBlock := tmabci.ResponseBeginBlock{ + Events: []tmabci.Event{ + {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } resultEndBlock := abci.ResponseEndBlock{ - Events: []abci.Event{ - {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, + Events: []tmabci.Event{ + {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, }, } diff --git a/types/events.go b/types/events.go index 770b06bab..2e620f120 100644 --- a/types/events.go +++ b/types/events.go @@ -3,6 +3,8 @@ package types import ( "fmt" + tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/line/ostracon/abci/types" tmjson "github.com/line/ostracon/libs/json" tmpubsub "github.com/line/ostracon/libs/pubsub" @@ -64,16 +66,16 @@ func init() { type EventDataNewBlock struct { Block *Block `json:"block"` - ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` - ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` + ResultBeginBlock tmabci.ResponseBeginBlock `json:"result_begin_block"` + ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` } type EventDataNewBlockHeader struct { Header Header `json:"header"` - NumTxs int64 `json:"num_txs"` // Number of txs in a block - ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` - ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` + NumTxs int64 `json:"num_txs"` // Number of txs in a block + ResultBeginBlock tmabci.ResponseBeginBlock `json:"result_begin_block"` + ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` } type EventDataNewEvidence struct { @@ -84,7 +86,7 @@ type EventDataNewEvidence struct { // All txs fire EventDataTx type EventDataTx struct { - abci.TxResult + tmabci.TxResult } // NOTE: This goes into the replay WAL diff --git a/types/evidence.go b/types/evidence.go index 7f3779d16..dd9c47c3d 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -9,6 +9,7 @@ import ( "strings" "time" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" abci "github.com/line/ostracon/abci/types" @@ -93,7 +94,7 @@ func NewDuplicateVoteEvidence(vote1, vote2 *Vote, blockTime time.Time, valSet *V // ABCI returns the application relevant representation of the evidence func (dve *DuplicateVoteEvidence) ABCI() []abci.Evidence { return []abci.Evidence{{ - Type: abci.EvidenceType_DUPLICATE_VOTE, + Type: tmabci.EvidenceType_DUPLICATE_VOTE, Validator: abci.Validator{ Address: dve.VoteA.ValidatorAddress, Power: dve.ValidatorPower, @@ -222,7 +223,7 @@ func (l *LightClientAttackEvidence) ABCI() []abci.Evidence { abciEv := make([]abci.Evidence, len(l.ByzantineValidators)) for idx, val := range l.ByzantineValidators { abciEv[idx] = abci.Evidence{ - Type: abci.EvidenceType_LIGHT_CLIENT_ATTACK, + Type: tmabci.EvidenceType_LIGHT_CLIENT_ATTACK, Validator: OC2PB.Validator(val), Height: l.Height(), Time: l.Timestamp, diff --git a/types/params.go b/types/params.go index 62826c5f9..70e34904b 100644 --- a/types/params.go +++ b/types/params.go @@ -5,9 +5,9 @@ import ( "fmt" "time" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/version" ) @@ -158,7 +158,7 @@ func HashConsensusParams(params tmproto.ConsensusParams) []byte { // Update returns a copy of the params with updates from the non-zero fields of p2. // NOTE: note: must not modify the original -func UpdateConsensusParams(params tmproto.ConsensusParams, params2 *abci.ConsensusParams) tmproto.ConsensusParams { +func UpdateConsensusParams(params tmproto.ConsensusParams, params2 *tmabci.ConsensusParams) tmproto.ConsensusParams { res := params // explicit copy if params2 == nil { diff --git a/types/params_test.go b/types/params_test.go index a343baf25..51ac80e77 100644 --- a/types/params_test.go +++ b/types/params_test.go @@ -6,11 +6,10 @@ import ( "testing" "time" + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" - - abci "github.com/line/ostracon/abci/types" ) var ( @@ -106,20 +105,20 @@ func TestConsensusParamsHash(t *testing.T) { func TestConsensusParamsUpdate(t *testing.T) { testCases := []struct { params tmproto.ConsensusParams - updates *abci.ConsensusParams + updates *tmabci.ConsensusParams updatedParams tmproto.ConsensusParams }{ // empty updates { makeParams(1, 2, 10, 3, 0, valEd25519), - &abci.ConsensusParams{}, + &tmabci.ConsensusParams{}, makeParams(1, 2, 10, 3, 0, valEd25519), }, // fine updates { makeParams(1, 2, 10, 3, 0, valEd25519), - &abci.ConsensusParams{ - Block: &abci.BlockParams{ + &tmabci.ConsensusParams{ + Block: &tmabci.BlockParams{ MaxBytes: 100, MaxGas: 200, }, @@ -146,7 +145,7 @@ func TestConsensusParamsUpdate_AppVersion(t *testing.T) { assert.EqualValues(t, 0, params.Version.AppVersion) updated := UpdateConsensusParams(params, - &abci.ConsensusParams{Version: &tmproto.VersionParams{AppVersion: 77}}) + &tmabci.ConsensusParams{Version: &tmproto.VersionParams{AppVersion: 77}}) assert.EqualValues(t, 77, updated.Version.AppVersion) } diff --git a/types/protobuf.go b/types/protobuf.go index 156ef8b90..16f51c15d 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -1,6 +1,7 @@ package types import ( + tmabci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" abci "github.com/line/ostracon/abci/types" @@ -103,9 +104,9 @@ func (oc2pb) ValidatorUpdates(vals *ValidatorSet) []abci.ValidatorUpdate { return validators } -func (oc2pb) ConsensusParams(params *tmproto.ConsensusParams) *abci.ConsensusParams { - return &abci.ConsensusParams{ - Block: &abci.BlockParams{ +func (oc2pb) ConsensusParams(params *tmproto.ConsensusParams) *tmabci.ConsensusParams { + return &tmabci.ConsensusParams{ + Block: &tmabci.BlockParams{ MaxBytes: params.Block.MaxBytes, MaxGas: params.Block.MaxGas, }, diff --git a/types/results.go b/types/results.go index 6560d89d3..1390eb56f 100644 --- a/types/results.go +++ b/types/results.go @@ -1,16 +1,17 @@ package types import ( - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/crypto/merkle" ) // ABCIResults wraps the deliver tx results to return a proof. -type ABCIResults []*abci.ResponseDeliverTx +type ABCIResults []*tmabci.ResponseDeliverTx // NewResults strips non-deterministic fields from ResponseDeliverTx responses // and returns ABCIResults. -func NewResults(responses []*abci.ResponseDeliverTx) ABCIResults { +func NewResults(responses []*tmabci.ResponseDeliverTx) ABCIResults { res := make(ABCIResults, len(responses)) for i, d := range responses { res[i] = deterministicResponseDeliverTx(d) @@ -44,8 +45,8 @@ func (a ABCIResults) toByteSlices() [][]byte { // deterministicResponseDeliverTx strips non-deterministic fields from // ResponseDeliverTx and returns another ResponseDeliverTx. -func deterministicResponseDeliverTx(response *abci.ResponseDeliverTx) *abci.ResponseDeliverTx { - return &abci.ResponseDeliverTx{ +func deterministicResponseDeliverTx(response *tmabci.ResponseDeliverTx) *tmabci.ResponseDeliverTx { + return &tmabci.ResponseDeliverTx{ Code: response.Code, Data: response.Data, GasWanted: response.GasWanted, diff --git a/types/results_test.go b/types/results_test.go index ef505c48c..c7eba0b9a 100644 --- a/types/results_test.go +++ b/types/results_test.go @@ -6,16 +6,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/line/ostracon/abci/types" + tmabci "github.com/tendermint/tendermint/abci/types" ) func TestABCIResults(t *testing.T) { - a := &abci.ResponseDeliverTx{Code: 0, Data: nil} - b := &abci.ResponseDeliverTx{Code: 0, Data: []byte{}} - c := &abci.ResponseDeliverTx{Code: 0, Data: []byte("one")} - d := &abci.ResponseDeliverTx{Code: 14, Data: nil} - e := &abci.ResponseDeliverTx{Code: 14, Data: []byte("foo")} - f := &abci.ResponseDeliverTx{Code: 14, Data: []byte("bar")} + a := &tmabci.ResponseDeliverTx{Code: 0, Data: nil} + b := &tmabci.ResponseDeliverTx{Code: 0, Data: []byte{}} + c := &tmabci.ResponseDeliverTx{Code: 0, Data: []byte("one")} + d := &tmabci.ResponseDeliverTx{Code: 14, Data: nil} + e := &tmabci.ResponseDeliverTx{Code: 14, Data: []byte("foo")} + f := &tmabci.ResponseDeliverTx{Code: 14, Data: []byte("bar")} // Nil and []byte{} should produce the same bytes bzA, err := a.Marshal() From 3f3c9b72d54a346c4ec9864edf7b10f1b22536f4 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Tue, 10 Jan 2023 15:34:48 +0900 Subject: [PATCH 12/25] chore: change import alias * abci -> ocabci * tmabci -> abci --- abci/client/client.go | 80 ++++---- abci/client/grpc_client.go | 144 ++++++------- abci/client/grpc_client_test.go | 62 +++--- abci/client/local_client.go | 148 +++++++------- abci/client/local_client_test.go | 66 +++--- abci/client/mocks/client.go | 224 ++++++++++----------- abci/client/socket_client.go | 222 ++++++++++---------- abci/client/socket_client_test.go | 78 +++---- abci/cmd/abci-cli/abci-cli.go | 26 +-- abci/example/counter/counter.go | 50 ++--- abci/example/example_test.go | 24 +-- abci/example/kvstore/helpers.go | 12 +- abci/example/kvstore/kvstore.go | 34 ++-- abci/example/kvstore/kvstore_test.go | 74 +++---- abci/example/kvstore/persistent_kvstore.go | 94 ++++----- abci/server/grpc_server.go | 8 +- abci/server/server.go | 6 +- abci/server/socket_server.go | 94 ++++----- abci/tests/benchmarks/parallel/parallel.go | 10 +- abci/tests/benchmarks/simple/simple.go | 20 +- abci/tests/server/client.go | 16 +- abci/tests/test_app/app.go | 6 +- abci/tests/test_app/main.go | 12 +- abci/types/application.go | 108 +++++----- abci/types/messages.go | 54 ++--- abci/types/messages_test.go | 16 +- abci/types/mocks/application.go | 126 ++++++------ blockchain/v0/reactor_test.go | 38 ++-- blockchain/v1/reactor_test.go | 4 +- blockchain/v2/reactor_test.go | 4 +- consensus/byzantine_test.go | 7 +- consensus/common_test.go | 28 +-- consensus/mempool_test.go | 44 ++-- consensus/reactor_test.go | 4 +- consensus/replay.go | 4 +- consensus/replay_stubs.go | 22 +- consensus/replay_test.go | 42 ++-- consensus/state_test.go | 18 +- light/rpc/client.go | 8 +- mempool/cache_test.go | 4 +- mempool/clist_mempool.go | 58 +++--- mempool/clist_mempool_system_test.go | 18 +- mempool/clist_mempool_test.go | 56 +++--- mempool/mempool.go | 14 +- mempool/mempool_test.go | 12 +- mempool/mock/mempool.go | 10 +- mempool/reactor_test.go | 8 +- node/node.go | 6 +- proxy/app_conn.go | 74 +++---- proxy/app_conn_test.go | 12 +- proxy/client.go | 8 +- proxy/mocks/app_conn_consensus.go | 46 ++--- proxy/mocks/app_conn_mempool.go | 46 ++--- proxy/mocks/app_conn_query.go | 30 +-- proxy/mocks/app_conn_snapshot.go | 42 ++-- proxy/version.go | 4 +- rpc/client/event_test.go | 4 +- rpc/client/evidence_test.go | 11 +- rpc/client/mock/abci.go | 26 +-- rpc/client/mock/abci_test.go | 12 +- rpc/client/rpc_test.go | 14 +- rpc/core/abci.go | 4 +- rpc/core/blocks_test.go | 12 +- rpc/core/mempool.go | 14 +- rpc/core/types/responses.go | 48 ++--- rpc/grpc/api.go | 8 +- rpc/test/helpers.go | 7 +- state/execution.go | 37 ++-- state/execution_test.go | 38 ++-- state/export_test.go | 4 +- state/helpers_test.go | 66 +++--- state/indexer/block/kv/kv.go | 4 +- state/indexer/block/kv/kv_test.go | 28 +-- state/indexer/sink/psql/backport.go | 10 +- state/indexer/sink/psql/backport_test.go | 6 +- state/indexer/sink/psql/psql.go | 20 +- state/indexer/sink/psql/psql_test.go | 32 +-- state/state_test.go | 112 +++++------ state/store.go | 4 +- state/store_test.go | 12 +- state/txindex/indexer.go | 14 +- state/txindex/indexer_service.go | 10 +- state/txindex/indexer_service_test.go | 100 ++++----- state/txindex/kv/kv.go | 26 +-- state/txindex/kv/kv_bench_test.go | 14 +- state/txindex/kv/kv_test.go | 96 ++++----- state/txindex/null/null.go | 10 +- state/validation_test.go | 4 +- statesync/reactor.go | 6 +- statesync/reactor_test.go | 30 +-- statesync/syncer.go | 28 +-- statesync/syncer_test.go | 182 ++++++++--------- test/e2e/app/app.go | 64 +++--- test/e2e/app/snapshots.go | 20 +- types/event_bus.go | 4 +- types/event_bus_test.go | 48 ++--- types/events.go | 16 +- types/evidence.go | 34 ++-- types/params.go | 4 +- types/params_test.go | 12 +- types/protobuf.go | 28 +-- types/protobuf_test.go | 10 +- types/results.go | 10 +- types/results_test.go | 14 +- 104 files changed, 1903 insertions(+), 1899 deletions(-) diff --git a/abci/client/client.go b/abci/client/client.go index 351eacad8..d3e4f7c56 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -4,9 +4,9 @@ import ( "fmt" "sync" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" ) @@ -31,39 +31,39 @@ type Client interface { FlushAsync(ResponseCallback) *ReqRes EchoAsync(string, ResponseCallback) *ReqRes - InfoAsync(tmabci.RequestInfo, ResponseCallback) *ReqRes - SetOptionAsync(tmabci.RequestSetOption, ResponseCallback) *ReqRes - DeliverTxAsync(tmabci.RequestDeliverTx, ResponseCallback) *ReqRes - CheckTxAsync(tmabci.RequestCheckTx, ResponseCallback) *ReqRes - QueryAsync(tmabci.RequestQuery, ResponseCallback) *ReqRes + InfoAsync(abci.RequestInfo, ResponseCallback) *ReqRes + SetOptionAsync(abci.RequestSetOption, ResponseCallback) *ReqRes + DeliverTxAsync(abci.RequestDeliverTx, ResponseCallback) *ReqRes + CheckTxAsync(abci.RequestCheckTx, ResponseCallback) *ReqRes + QueryAsync(abci.RequestQuery, ResponseCallback) *ReqRes CommitAsync(ResponseCallback) *ReqRes - InitChainAsync(types.RequestInitChain, ResponseCallback) *ReqRes - BeginBlockAsync(types.RequestBeginBlock, ResponseCallback) *ReqRes - EndBlockAsync(tmabci.RequestEndBlock, ResponseCallback) *ReqRes - BeginRecheckTxAsync(types.RequestBeginRecheckTx, ResponseCallback) *ReqRes - EndRecheckTxAsync(types.RequestEndRecheckTx, ResponseCallback) *ReqRes - ListSnapshotsAsync(tmabci.RequestListSnapshots, ResponseCallback) *ReqRes - OfferSnapshotAsync(tmabci.RequestOfferSnapshot, ResponseCallback) *ReqRes - LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk, ResponseCallback) *ReqRes - ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk, ResponseCallback) *ReqRes - - FlushSync() (*tmabci.ResponseFlush, error) - EchoSync(string) (*tmabci.ResponseEcho, error) - InfoSync(tmabci.RequestInfo) (*tmabci.ResponseInfo, error) - SetOptionSync(tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) - DeliverTxSync(tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) - CheckTxSync(tmabci.RequestCheckTx) (*types.ResponseCheckTx, error) - QuerySync(tmabci.RequestQuery) (*tmabci.ResponseQuery, error) - CommitSync() (*tmabci.ResponseCommit, error) - InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error) - BeginBlockSync(types.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) - EndBlockSync(tmabci.RequestEndBlock) (*types.ResponseEndBlock, error) - BeginRecheckTxSync(types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) - EndRecheckTxSync(types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) - ListSnapshotsSync(tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) - OfferSnapshotSync(tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) - LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) + InitChainAsync(ocabci.RequestInitChain, ResponseCallback) *ReqRes + BeginBlockAsync(ocabci.RequestBeginBlock, ResponseCallback) *ReqRes + EndBlockAsync(abci.RequestEndBlock, ResponseCallback) *ReqRes + BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx, ResponseCallback) *ReqRes + EndRecheckTxAsync(ocabci.RequestEndRecheckTx, ResponseCallback) *ReqRes + ListSnapshotsAsync(abci.RequestListSnapshots, ResponseCallback) *ReqRes + OfferSnapshotAsync(abci.RequestOfferSnapshot, ResponseCallback) *ReqRes + LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk, ResponseCallback) *ReqRes + ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk, ResponseCallback) *ReqRes + + FlushSync() (*abci.ResponseFlush, error) + EchoSync(string) (*abci.ResponseEcho, error) + InfoSync(abci.RequestInfo) (*abci.ResponseInfo, error) + SetOptionSync(abci.RequestSetOption) (*abci.ResponseSetOption, error) + DeliverTxSync(abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) + CheckTxSync(abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) + QuerySync(abci.RequestQuery) (*abci.ResponseQuery, error) + CommitSync() (*abci.ResponseCommit, error) + InitChainSync(ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) + BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) + EndBlockSync(abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) + BeginRecheckTxSync(ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) + EndRecheckTxSync(ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) + ListSnapshotsSync(abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) + OfferSnapshotSync(abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) + LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) } //---------------------------------------- @@ -82,12 +82,12 @@ func NewClient(addr, transport string, mustConnect bool) (client Client, err err return } -type GlobalCallback func(*types.Request, *types.Response) -type ResponseCallback func(*types.Response) +type GlobalCallback func(*ocabci.Request, *ocabci.Response) +type ResponseCallback func(*ocabci.Response) type ReqRes struct { - *types.Request - *types.Response // Not set atomically, so be sure to use WaitGroup. + *ocabci.Request + *ocabci.Response // Not set atomically, so be sure to use WaitGroup. mtx tmsync.Mutex wg *sync.WaitGroup @@ -95,7 +95,7 @@ type ReqRes struct { cb ResponseCallback // A single callback that may be set. } -func NewReqRes(req *types.Request, cb ResponseCallback) *ReqRes { +func NewReqRes(req *ocabci.Request, cb ResponseCallback) *ReqRes { return &ReqRes{ Request: req, Response: nil, @@ -117,7 +117,7 @@ func (reqRes *ReqRes) InvokeCallback() { } } -func (reqRes *ReqRes) SetDone(res *types.Response) (set bool) { +func (reqRes *ReqRes) SetDone(res *ocabci.Response) (set bool) { reqRes.mtx.Lock() // TODO should we panic if it's already done? set = !reqRes.done diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index a4d5d65d2..b72a8436a 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -9,9 +9,9 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" @@ -25,7 +25,7 @@ type grpcClient struct { service.BaseService mustConnect bool - client abci.ABCIApplicationClient + client ocabci.ABCIApplicationClient conn *grpc.ClientConn mtx tmsync.Mutex @@ -33,7 +33,7 @@ type grpcClient struct { err error globalCbMtx sync.Mutex - globalCb func(*abci.Request, *abci.Response) // listens to all callbacks + globalCb func(*ocabci.Request, *ocabci.Response) // listens to all callbacks } func NewGRPCClient(addr string, mustConnect bool) Client { @@ -68,12 +68,12 @@ RETRY_LOOP: } cli.Logger.Info("Dialed server. Waiting for echo.", "addr", cli.addr) - client := abci.NewABCIApplicationClient(conn) + client := ocabci.NewABCIApplicationClient(conn) cli.conn = conn ENSURE_CONNECTED: for { - _, err := client.Echo(context.Background(), &tmabci.RequestEcho{Message: "hello"}, grpc.WaitForReady(true)) + _, err := client.Echo(context.Background(), &abci.RequestEcho{Message: "hello"}, grpc.WaitForReady(true)) if err == nil { break ENSURE_CONNECTED } @@ -139,160 +139,160 @@ func (cli *grpcClient) GetGlobalCallback() (cb GlobalCallback) { // but hopefully not :D func (cli *grpcClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { - req := abci.ToRequestEcho(msg) + req := ocabci.ToRequestEcho(msg) res, err := cli.client.Echo(context.Background(), req.GetEcho(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Echo{Echo: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Echo{Echo: res}}, cb) } func (cli *grpcClient) FlushAsync(cb ResponseCallback) *ReqRes { - req := abci.ToRequestFlush() + req := ocabci.ToRequestFlush() res, err := cli.client.Flush(context.Background(), req.GetFlush(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Flush{Flush: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Flush{Flush: res}}, cb) } -func (cli *grpcClient) InfoAsync(params tmabci.RequestInfo, cb ResponseCallback) *ReqRes { - req := abci.ToRequestInfo(params) +func (cli *grpcClient) InfoAsync(params abci.RequestInfo, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestInfo(params) res, err := cli.client.Info(context.Background(), req.GetInfo(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Info{Info: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Info{Info: res}}, cb) } -func (cli *grpcClient) SetOptionAsync(params tmabci.RequestSetOption, cb ResponseCallback) *ReqRes { - req := abci.ToRequestSetOption(params) +func (cli *grpcClient) SetOptionAsync(params abci.RequestSetOption, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestSetOption(params) res, err := cli.client.SetOption(context.Background(), req.GetSetOption(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_SetOption{SetOption: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_SetOption{SetOption: res}}, cb) } -func (cli *grpcClient) DeliverTxAsync(params tmabci.RequestDeliverTx, cb ResponseCallback) *ReqRes { - req := abci.ToRequestDeliverTx(params) +func (cli *grpcClient) DeliverTxAsync(params abci.RequestDeliverTx, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestDeliverTx(params) res, err := cli.client.DeliverTx(context.Background(), req.GetDeliverTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_DeliverTx{DeliverTx: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_DeliverTx{DeliverTx: res}}, cb) } -func (cli *grpcClient) CheckTxAsync(params tmabci.RequestCheckTx, cb ResponseCallback) *ReqRes { - req := abci.ToRequestCheckTx(params) +func (cli *grpcClient) CheckTxAsync(params abci.RequestCheckTx, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestCheckTx(params) res, err := cli.client.CheckTx(context.Background(), req.GetCheckTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_CheckTx{CheckTx: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_CheckTx{CheckTx: res}}, cb) } -func (cli *grpcClient) QueryAsync(params tmabci.RequestQuery, cb ResponseCallback) *ReqRes { - req := abci.ToRequestQuery(params) +func (cli *grpcClient) QueryAsync(params abci.RequestQuery, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestQuery(params) res, err := cli.client.Query(context.Background(), req.GetQuery(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Query{Query: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Query{Query: res}}, cb) } func (cli *grpcClient) CommitAsync(cb ResponseCallback) *ReqRes { - req := abci.ToRequestCommit() + req := ocabci.ToRequestCommit() res, err := cli.client.Commit(context.Background(), req.GetCommit(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_Commit{Commit: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Commit{Commit: res}}, cb) } -func (cli *grpcClient) InitChainAsync(params abci.RequestInitChain, cb ResponseCallback) *ReqRes { - req := abci.ToRequestInitChain(params) +func (cli *grpcClient) InitChainAsync(params ocabci.RequestInitChain, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestInitChain(params) res, err := cli.client.InitChain(context.Background(), req.GetInitChain(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_InitChain{InitChain: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_InitChain{InitChain: res}}, cb) } -func (cli *grpcClient) BeginBlockAsync(params abci.RequestBeginBlock, cb ResponseCallback) *ReqRes { - req := abci.ToRequestBeginBlock(params) +func (cli *grpcClient) BeginBlockAsync(params ocabci.RequestBeginBlock, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestBeginBlock(params) res, err := cli.client.BeginBlock(context.Background(), req.GetBeginBlock(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_BeginBlock{BeginBlock: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_BeginBlock{BeginBlock: res}}, cb) } -func (cli *grpcClient) EndBlockAsync(params tmabci.RequestEndBlock, cb ResponseCallback) *ReqRes { - req := abci.ToRequestEndBlock(params) +func (cli *grpcClient) EndBlockAsync(params abci.RequestEndBlock, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestEndBlock(params) res, err := cli.client.EndBlock(context.Background(), req.GetEndBlock(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_EndBlock{EndBlock: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_EndBlock{EndBlock: res}}, cb) } -func (cli *grpcClient) BeginRecheckTxAsync(params abci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { - req := abci.ToRequestBeginRecheckTx(params) +func (cli *grpcClient) BeginRecheckTxAsync(params ocabci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestBeginRecheckTx(params) res, err := cli.client.BeginRecheckTx(context.Background(), req.GetBeginRecheckTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_BeginRecheckTx{BeginRecheckTx: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_BeginRecheckTx{BeginRecheckTx: res}}, cb) } -func (cli *grpcClient) EndRecheckTxAsync(params abci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { - req := abci.ToRequestEndRecheckTx(params) +func (cli *grpcClient) EndRecheckTxAsync(params ocabci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestEndRecheckTx(params) res, err := cli.client.EndRecheckTx(context.Background(), req.GetEndRecheckTx(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_EndRecheckTx{EndRecheckTx: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_EndRecheckTx{EndRecheckTx: res}}, cb) } -func (cli *grpcClient) ListSnapshotsAsync(params tmabci.RequestListSnapshots, cb ResponseCallback) *ReqRes { - req := abci.ToRequestListSnapshots(params) +func (cli *grpcClient) ListSnapshotsAsync(params abci.RequestListSnapshots, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestListSnapshots(params) res, err := cli.client.ListSnapshots(context.Background(), req.GetListSnapshots(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_ListSnapshots{ListSnapshots: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_ListSnapshots{ListSnapshots: res}}, cb) } -func (cli *grpcClient) OfferSnapshotAsync(params tmabci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { - req := abci.ToRequestOfferSnapshot(params) +func (cli *grpcClient) OfferSnapshotAsync(params abci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestOfferSnapshot(params) res, err := cli.client.OfferSnapshot(context.Background(), req.GetOfferSnapshot(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_OfferSnapshot{OfferSnapshot: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_OfferSnapshot{OfferSnapshot: res}}, cb) } -func (cli *grpcClient) LoadSnapshotChunkAsync(params tmabci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { - req := abci.ToRequestLoadSnapshotChunk(params) +func (cli *grpcClient) LoadSnapshotChunkAsync(params abci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestLoadSnapshotChunk(params) res, err := cli.client.LoadSnapshotChunk(context.Background(), req.GetLoadSnapshotChunk(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &abci.Response{Value: &abci.Response_LoadSnapshotChunk{LoadSnapshotChunk: res}}, cb) + return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_LoadSnapshotChunk{LoadSnapshotChunk: res}}, cb) } -func (cli *grpcClient) ApplySnapshotChunkAsync(params tmabci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { - req := abci.ToRequestApplySnapshotChunk(params) +func (cli *grpcClient) ApplySnapshotChunkAsync(params abci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { + req := ocabci.ToRequestApplySnapshotChunk(params) res, err := cli.client.ApplySnapshotChunk(context.Background(), req.GetApplySnapshotChunk(), grpc.WaitForReady(true)) if err != nil { cli.StopForError(err) } return cli.finishAsyncCall(req, - &abci.Response{Value: &abci.Response_ApplySnapshotChunk{ApplySnapshotChunk: res}}, cb) + &ocabci.Response{Value: &ocabci.Response_ApplySnapshotChunk{ApplySnapshotChunk: res}}, cb) } -func (cli *grpcClient) finishAsyncCall(req *abci.Request, res *abci.Response, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) finishAsyncCall(req *ocabci.Request, res *ocabci.Response, cb ResponseCallback) *ReqRes { reqRes := NewReqRes(req, cb) // goroutine for callbacks @@ -310,106 +310,106 @@ func (cli *grpcClient) finishAsyncCall(req *abci.Request, res *abci.Response, cb } //---------------------------------------- -func (cli *grpcClient) FlushSync() (*tmabci.ResponseFlush, error) { +func (cli *grpcClient) FlushSync() (*abci.ResponseFlush, error) { reqres := cli.FlushAsync(nil) reqres.Wait() return reqres.Response.GetFlush(), cli.Error() } -func (cli *grpcClient) EchoSync(msg string) (*tmabci.ResponseEcho, error) { +func (cli *grpcClient) EchoSync(msg string) (*abci.ResponseEcho, error) { reqres := cli.EchoAsync(msg, nil) reqres.Wait() // StopForError should already have been called if error is set return reqres.Response.GetEcho(), cli.Error() } -func (cli *grpcClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { +func (cli *grpcClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { reqres := cli.InfoAsync(req, nil) reqres.Wait() return reqres.Response.GetInfo(), cli.Error() } -func (cli *grpcClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { +func (cli *grpcClient) SetOptionSync(req abci.RequestSetOption) (*abci.ResponseSetOption, error) { reqres := cli.SetOptionAsync(req, nil) reqres.Wait() return reqres.Response.GetSetOption(), cli.Error() } -func (cli *grpcClient) DeliverTxSync(params tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { +func (cli *grpcClient) DeliverTxSync(params abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { reqres := cli.DeliverTxAsync(params, nil) reqres.Wait() return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *grpcClient) CheckTxSync(params tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { +func (cli *grpcClient) CheckTxSync(params abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { reqres := cli.CheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetCheckTx(), cli.Error() } -func (cli *grpcClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { +func (cli *grpcClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, error) { reqres := cli.QueryAsync(req, nil) reqres.Wait() return reqres.Response.GetQuery(), cli.Error() } -func (cli *grpcClient) CommitSync() (*tmabci.ResponseCommit, error) { +func (cli *grpcClient) CommitSync() (*abci.ResponseCommit, error) { reqres := cli.CommitAsync(nil) reqres.Wait() return reqres.Response.GetCommit(), cli.Error() } -func (cli *grpcClient) InitChainSync(params abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (cli *grpcClient) InitChainSync(params ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { reqres := cli.InitChainAsync(params, nil) reqres.Wait() return reqres.Response.GetInitChain(), cli.Error() } -func (cli *grpcClient) BeginBlockSync(params abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { +func (cli *grpcClient) BeginBlockSync(params ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { reqres := cli.BeginBlockAsync(params, nil) reqres.Wait() return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *grpcClient) EndBlockSync(params tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (cli *grpcClient) EndBlockSync(params abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { reqres := cli.EndBlockAsync(params, nil) reqres.Wait() return reqres.Response.GetEndBlock(), cli.Error() } -func (cli *grpcClient) BeginRecheckTxSync(params abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { +func (cli *grpcClient) BeginRecheckTxSync(params ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) { reqres := cli.BeginRecheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetBeginRecheckTx(), cli.Error() } -func (cli *grpcClient) EndRecheckTxSync(params abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { +func (cli *grpcClient) EndRecheckTxSync(params ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) { reqres := cli.EndRecheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetEndRecheckTx(), cli.Error() } -func (cli *grpcClient) ListSnapshotsSync(params tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { +func (cli *grpcClient) ListSnapshotsSync(params abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { reqres := cli.ListSnapshotsAsync(params, nil) reqres.Wait() return reqres.Response.GetListSnapshots(), cli.Error() } -func (cli *grpcClient) OfferSnapshotSync(params tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { +func (cli *grpcClient) OfferSnapshotSync(params abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { reqres := cli.OfferSnapshotAsync(params, nil) reqres.Wait() return reqres.Response.GetOfferSnapshot(), cli.Error() } func (cli *grpcClient) LoadSnapshotChunkSync( - params tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { + params abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { reqres := cli.LoadSnapshotChunkAsync(params, nil) reqres.Wait() return reqres.Response.GetLoadSnapshotChunk(), cli.Error() } func (cli *grpcClient) ApplySnapshotChunkSync( - params tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { + params abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { reqres := cli.ApplySnapshotChunkAsync(params, nil) reqres.Wait() return reqres.Response.GetApplySnapshotChunk(), cli.Error() diff --git a/abci/client/grpc_client_test.go b/abci/client/grpc_client_test.go index eeec39201..6a2c62aad 100644 --- a/abci/client/grpc_client_test.go +++ b/abci/client/grpc_client_test.go @@ -4,10 +4,10 @@ import ( "fmt" "testing" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/abci/server" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/rand" "github.com/stretchr/testify/require" ) @@ -24,28 +24,28 @@ func TestGrpcClientCalls(t *testing.T) { require.NoError(t, err0) c := NewGRPCClient(addr, true) - c.SetGlobalCallback(func(*abci.Request, *abci.Response) { + c.SetGlobalCallback(func(*ocabci.Request, *ocabci.Response) { }) err0 = c.Start() require.NoError(t, err0) c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(tmabci.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(tmabci.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(tmabci.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(tmabci.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(tmabci.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(abci.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(abci.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(abci.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) - c.BeginBlockAsync(abci.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(tmabci.RequestEndBlock{}, getResponseCallback(t)) - c.BeginRecheckTxAsync(abci.RequestBeginRecheckTx{}, getResponseCallback(t)) - c.EndRecheckTxAsync(abci.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(tmabci.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(tmabci.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.InitChainAsync(ocabci.RequestInitChain{}, getResponseCallback(t)) + c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) + c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) + c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) + c.EndRecheckTxAsync(ocabci.RequestEndRecheckTx{}, getResponseCallback(t)) + c.ListSnapshotsAsync(abci.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(abci.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -53,48 +53,48 @@ func TestGrpcClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(tmabci.RequestInfo{}) + _, err = c.InfoSync(abci.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(tmabci.RequestSetOption{}) + _, err = c.SetOptionSync(abci.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(tmabci.RequestDeliverTx{}) + _, err = c.DeliverTxSync(abci.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(tmabci.RequestCheckTx{}) + _, err = c.CheckTxSync(abci.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(tmabci.RequestQuery{}) + _, err = c.QuerySync(abci.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(abci.RequestInitChain{}) + _, err = c.InitChainSync(ocabci.RequestInitChain{}) require.NoError(t, err) - _, err = c.BeginBlockSync(abci.RequestBeginBlock{}) + _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(tmabci.RequestEndBlock{}) + _, err = c.EndBlockSync(abci.RequestEndBlock{}) require.NoError(t, err) - _, err = c.BeginRecheckTxSync(abci.RequestBeginRecheckTx{}) + _, err = c.BeginRecheckTxSync(ocabci.RequestBeginRecheckTx{}) require.NoError(t, err) - _, err = c.EndRecheckTxSync(abci.RequestEndRecheckTx{}) + _, err = c.EndRecheckTxSync(ocabci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(tmabci.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(abci.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(tmabci.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(abci.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{}) require.NoError(t, err) } diff --git a/abci/client/local_client.go b/abci/client/local_client.go index ef19fe158..4c586ee6b 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -1,9 +1,9 @@ package abcicli import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" ) @@ -19,8 +19,8 @@ type localClient struct { // TODO: remove `mtx` to increase concurrency. We could remove it because the app should protect itself. mtx *tmsync.Mutex - // CONTRACT: The application should protect itself from concurrency as an abci server. - abci.Application + // CONTRACT: The application should protect itself from concurrency as an ocabci server. + ocabci.Application globalCbMtx tmsync.Mutex globalCb GlobalCallback @@ -32,7 +32,7 @@ var _ Client = (*localClient)(nil) // methods of the given app. // // Both Async and Sync methods ignore the given context.Context parameter. -func NewLocalClient(mtx *tmsync.Mutex, app abci.Application) Client { +func NewLocalClient(mtx *tmsync.Mutex, app ocabci.Application) Client { if mtx == nil { mtx = new(tmsync.Mutex) } @@ -64,8 +64,8 @@ func (app *localClient) Error() error { func (app *localClient) FlushAsync(cb ResponseCallback) *ReqRes { // Do nothing - reqRes := NewReqRes(abci.ToRequestFlush(), cb) - return app.done(reqRes, abci.ToResponseFlush()) + reqRes := NewReqRes(ocabci.ToRequestFlush(), cb) + return app.done(reqRes, ocabci.ToResponseFlush()) } func (app *localClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { @@ -73,167 +73,167 @@ func (app *localClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestEcho(msg), cb) - return app.done(reqRes, abci.ToResponseEcho(msg)) + reqRes := NewReqRes(ocabci.ToRequestEcho(msg), cb) + return app.done(reqRes, ocabci.ToResponseEcho(msg)) } -func (app *localClient) InfoAsync(req tmabci.RequestInfo, cb ResponseCallback) *ReqRes { +func (app *localClient) InfoAsync(req abci.RequestInfo, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestInfo(req), cb) + reqRes := NewReqRes(ocabci.ToRequestInfo(req), cb) res := app.Application.Info(req) - return app.done(reqRes, abci.ToResponseInfo(res)) + return app.done(reqRes, ocabci.ToResponseInfo(res)) } -func (app *localClient) SetOptionAsync(req tmabci.RequestSetOption, cb ResponseCallback) *ReqRes { +func (app *localClient) SetOptionAsync(req abci.RequestSetOption, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestSetOption(req), cb) + reqRes := NewReqRes(ocabci.ToRequestSetOption(req), cb) res := app.Application.SetOption(req) - return app.done(reqRes, abci.ToResponseSetOption(res)) + return app.done(reqRes, ocabci.ToResponseSetOption(res)) } -func (app *localClient) DeliverTxAsync(req tmabci.RequestDeliverTx, cb ResponseCallback) *ReqRes { +func (app *localClient) DeliverTxAsync(req abci.RequestDeliverTx, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestDeliverTx(req), cb) + reqRes := NewReqRes(ocabci.ToRequestDeliverTx(req), cb) res := app.Application.DeliverTx(req) - return app.done(reqRes, abci.ToResponseDeliverTx(res)) + return app.done(reqRes, ocabci.ToResponseDeliverTx(res)) } -func (app *localClient) CheckTxAsync(req tmabci.RequestCheckTx, cb ResponseCallback) *ReqRes { +func (app *localClient) CheckTxAsync(req abci.RequestCheckTx, cb ResponseCallback) *ReqRes { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestCheckTx(req), cb) + reqRes := NewReqRes(ocabci.ToRequestCheckTx(req), cb) - app.Application.CheckTxAsync(req, func(r abci.ResponseCheckTx) { - res := abci.ToResponseCheckTx(r) + app.Application.CheckTxAsync(req, func(r ocabci.ResponseCheckTx) { + res := ocabci.ToResponseCheckTx(r) app.done(reqRes, res) }) return reqRes } -func (app *localClient) QueryAsync(req tmabci.RequestQuery, cb ResponseCallback) *ReqRes { +func (app *localClient) QueryAsync(req abci.RequestQuery, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestQuery(req), cb) + reqRes := NewReqRes(ocabci.ToRequestQuery(req), cb) res := app.Application.Query(req) - return app.done(reqRes, abci.ToResponseQuery(res)) + return app.done(reqRes, ocabci.ToResponseQuery(res)) } func (app *localClient) CommitAsync(cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestCommit(), cb) + reqRes := NewReqRes(ocabci.ToRequestCommit(), cb) res := app.Application.Commit() - return app.done(reqRes, abci.ToResponseCommit(res)) + return app.done(reqRes, ocabci.ToResponseCommit(res)) } -func (app *localClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { +func (app *localClient) InitChainAsync(req ocabci.RequestInitChain, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestInitChain(req), cb) + reqRes := NewReqRes(ocabci.ToRequestInitChain(req), cb) res := app.Application.InitChain(req) - return app.done(reqRes, abci.ToResponseInitChain(res)) + return app.done(reqRes, ocabci.ToResponseInitChain(res)) } -func (app *localClient) BeginBlockAsync(req abci.RequestBeginBlock, cb ResponseCallback) *ReqRes { +func (app *localClient) BeginBlockAsync(req ocabci.RequestBeginBlock, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestBeginBlock(req), cb) + reqRes := NewReqRes(ocabci.ToRequestBeginBlock(req), cb) res := app.Application.BeginBlock(req) - return app.done(reqRes, abci.ToResponseBeginBlock(res)) + return app.done(reqRes, ocabci.ToResponseBeginBlock(res)) } -func (app *localClient) EndBlockAsync(req tmabci.RequestEndBlock, cb ResponseCallback) *ReqRes { +func (app *localClient) EndBlockAsync(req abci.RequestEndBlock, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestEndBlock(req), cb) + reqRes := NewReqRes(ocabci.ToRequestEndBlock(req), cb) res := app.Application.EndBlock(req) - return app.done(reqRes, abci.ToResponseEndBlock(res)) + return app.done(reqRes, ocabci.ToResponseEndBlock(res)) } -func (app *localClient) BeginRecheckTxAsync(req abci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { +func (app *localClient) BeginRecheckTxAsync(req ocabci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestBeginRecheckTx(req), cb) + reqRes := NewReqRes(ocabci.ToRequestBeginRecheckTx(req), cb) res := app.Application.BeginRecheckTx(req) - return app.done(reqRes, abci.ToResponseBeginRecheckTx(res)) + return app.done(reqRes, ocabci.ToResponseBeginRecheckTx(res)) } -func (app *localClient) EndRecheckTxAsync(req abci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { +func (app *localClient) EndRecheckTxAsync(req ocabci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestEndRecheckTx(req), cb) + reqRes := NewReqRes(ocabci.ToRequestEndRecheckTx(req), cb) res := app.Application.EndRecheckTx(req) - return app.done(reqRes, abci.ToResponseEndRecheckTx(res)) + return app.done(reqRes, ocabci.ToResponseEndRecheckTx(res)) } -func (app *localClient) ListSnapshotsAsync(req tmabci.RequestListSnapshots, cb ResponseCallback) *ReqRes { +func (app *localClient) ListSnapshotsAsync(req abci.RequestListSnapshots, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestListSnapshots(req), cb) + reqRes := NewReqRes(ocabci.ToRequestListSnapshots(req), cb) res := app.Application.ListSnapshots(req) - return app.done(reqRes, abci.ToResponseListSnapshots(res)) + return app.done(reqRes, ocabci.ToResponseListSnapshots(res)) } -func (app *localClient) OfferSnapshotAsync(req tmabci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { +func (app *localClient) OfferSnapshotAsync(req abci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestOfferSnapshot(req), cb) + reqRes := NewReqRes(ocabci.ToRequestOfferSnapshot(req), cb) res := app.Application.OfferSnapshot(req) - return app.done(reqRes, abci.ToResponseOfferSnapshot(res)) + return app.done(reqRes, ocabci.ToResponseOfferSnapshot(res)) } -func (app *localClient) LoadSnapshotChunkAsync(req tmabci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { +func (app *localClient) LoadSnapshotChunkAsync(req abci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestLoadSnapshotChunk(req), cb) + reqRes := NewReqRes(ocabci.ToRequestLoadSnapshotChunk(req), cb) res := app.Application.LoadSnapshotChunk(req) - return app.done(reqRes, abci.ToResponseLoadSnapshotChunk(res)) + return app.done(reqRes, ocabci.ToResponseLoadSnapshotChunk(res)) } -func (app *localClient) ApplySnapshotChunkAsync(req tmabci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { +func (app *localClient) ApplySnapshotChunkAsync(req abci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() - reqRes := NewReqRes(abci.ToRequestApplySnapshotChunk(req), cb) + reqRes := NewReqRes(ocabci.ToRequestApplySnapshotChunk(req), cb) res := app.Application.ApplySnapshotChunk(req) - return app.done(reqRes, abci.ToResponseApplySnapshotChunk(res)) + return app.done(reqRes, ocabci.ToResponseApplySnapshotChunk(res)) } //------------------------------------------------------- -func (app *localClient) FlushSync() (*tmabci.ResponseFlush, error) { - return &tmabci.ResponseFlush{}, nil +func (app *localClient) FlushSync() (*abci.ResponseFlush, error) { + return &abci.ResponseFlush{}, nil } -func (app *localClient) EchoSync(msg string) (*tmabci.ResponseEcho, error) { +func (app *localClient) EchoSync(msg string) (*abci.ResponseEcho, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - return &tmabci.ResponseEcho{Message: msg}, nil + return &abci.ResponseEcho{Message: msg}, nil } -func (app *localClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { +func (app *localClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -241,7 +241,7 @@ func (app *localClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, return &res, nil } -func (app *localClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { +func (app *localClient) SetOptionSync(req abci.RequestSetOption) (*abci.ResponseSetOption, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -249,7 +249,7 @@ func (app *localClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.Resp return &res, nil } -func (app *localClient) DeliverTxSync(req tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { +func (app *localClient) DeliverTxSync(req abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -257,7 +257,7 @@ func (app *localClient) DeliverTxSync(req tmabci.RequestDeliverTx) (*tmabci.Resp return &res, nil } -func (app *localClient) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { +func (app *localClient) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -266,7 +266,7 @@ func (app *localClient) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseCh return &res, nil } -func (app *localClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { +func (app *localClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -274,7 +274,7 @@ func (app *localClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQuer return &res, nil } -func (app *localClient) CommitSync() (*tmabci.ResponseCommit, error) { +func (app *localClient) CommitSync() (*abci.ResponseCommit, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -282,7 +282,7 @@ func (app *localClient) CommitSync() (*tmabci.ResponseCommit, error) { return &res, nil } -func (app *localClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (app *localClient) InitChainSync(req ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -290,7 +290,7 @@ func (app *localClient) InitChainSync(req abci.RequestInitChain) (*abci.Response return &res, nil } -func (app *localClient) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { +func (app *localClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -298,7 +298,7 @@ func (app *localClient) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.Resp return &res, nil } -func (app *localClient) EndBlockSync(req tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (app *localClient) EndBlockSync(req abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -306,7 +306,7 @@ func (app *localClient) EndBlockSync(req tmabci.RequestEndBlock) (*abci.Response return &res, nil } -func (app *localClient) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { +func (app *localClient) BeginRecheckTxSync(req ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -315,7 +315,7 @@ func (app *localClient) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*abc return &res, nil } -func (app *localClient) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { +func (app *localClient) EndRecheckTxSync(req ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -324,7 +324,7 @@ func (app *localClient) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.Re return &res, nil } -func (app *localClient) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { +func (app *localClient) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -332,7 +332,7 @@ func (app *localClient) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tma return &res, nil } -func (app *localClient) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { +func (app *localClient) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -341,7 +341,7 @@ func (app *localClient) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tma } func (app *localClient) LoadSnapshotChunkSync( - req tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { + req abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -350,7 +350,7 @@ func (app *localClient) LoadSnapshotChunkSync( } func (app *localClient) ApplySnapshotChunkSync( - req tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { + req abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -360,7 +360,7 @@ func (app *localClient) ApplySnapshotChunkSync( //------------------------------------------------------- -func (app *localClient) done(reqRes *ReqRes, res *abci.Response) *ReqRes { +func (app *localClient) done(reqRes *ReqRes, res *ocabci.Response) *ReqRes { set := reqRes.SetDone(res) if set { if globalCb := app.GetGlobalCallback(); globalCb != nil { diff --git a/abci/client/local_client_test.go b/abci/client/local_client_test.go index bb8936f66..20d12394c 100644 --- a/abci/client/local_client_test.go +++ b/abci/client/local_client_test.go @@ -4,14 +4,14 @@ import ( "testing" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/stretchr/testify/require" ) type sampleApp struct { - types.BaseApplication + ocabci.BaseApplication } func newDoneChan(t *testing.T) chan struct{} { @@ -29,7 +29,7 @@ func newDoneChan(t *testing.T) chan struct{} { func getResponseCallback(t *testing.T) ResponseCallback { doneChan := newDoneChan(t) - return func(res *types.Response) { + return func(res *ocabci.Response) { require.NotNil(t, res) doneChan <- struct{}{} } @@ -39,26 +39,26 @@ func TestLocalClientCalls(t *testing.T) { app := sampleApp{} c := NewLocalClient(nil, app) - c.SetGlobalCallback(func(*types.Request, *types.Response) { + c.SetGlobalCallback(func(*ocabci.Request, *ocabci.Response) { }) c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(tmabci.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(tmabci.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(tmabci.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(tmabci.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(tmabci.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(abci.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(abci.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(abci.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(types.RequestInitChain{}, getResponseCallback(t)) - c.BeginBlockAsync(types.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(tmabci.RequestEndBlock{}, getResponseCallback(t)) - c.BeginRecheckTxAsync(types.RequestBeginRecheckTx{}, getResponseCallback(t)) - c.EndRecheckTxAsync(types.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(tmabci.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(tmabci.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.InitChainAsync(ocabci.RequestInitChain{}, getResponseCallback(t)) + c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) + c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) + c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) + c.EndRecheckTxAsync(ocabci.RequestEndRecheckTx{}, getResponseCallback(t)) + c.ListSnapshotsAsync(abci.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(abci.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -66,48 +66,48 @@ func TestLocalClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(tmabci.RequestInfo{}) + _, err = c.InfoSync(abci.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(tmabci.RequestSetOption{}) + _, err = c.SetOptionSync(abci.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(tmabci.RequestDeliverTx{}) + _, err = c.DeliverTxSync(abci.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(tmabci.RequestCheckTx{}) + _, err = c.CheckTxSync(abci.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(tmabci.RequestQuery{}) + _, err = c.QuerySync(abci.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(types.RequestInitChain{}) + _, err = c.InitChainSync(ocabci.RequestInitChain{}) require.NoError(t, err) - _, err = c.BeginBlockSync(types.RequestBeginBlock{}) + _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(tmabci.RequestEndBlock{}) + _, err = c.EndBlockSync(abci.RequestEndBlock{}) require.NoError(t, err) - _, err = c.BeginRecheckTxSync(types.RequestBeginRecheckTx{}) + _, err = c.BeginRecheckTxSync(ocabci.RequestBeginRecheckTx{}) require.NoError(t, err) - _, err = c.EndRecheckTxSync(types.RequestEndRecheckTx{}) + _, err = c.EndRecheckTxSync(ocabci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(tmabci.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(abci.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(tmabci.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(abci.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{}) require.NoError(t, err) } diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index ab8cd355e..1f7833083 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -5,10 +5,10 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" log "github.com/line/ostracon/libs/log" ) @@ -18,11 +18,11 @@ type Client struct { } // ApplySnapshotChunkAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) ApplySnapshotChunkAsync(_a0 tmabci.RequestApplySnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) ApplySnapshotChunkAsync(_a0 abci.RequestApplySnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -34,20 +34,20 @@ func (_m *Client) ApplySnapshotChunkAsync(_a0 tmabci.RequestApplySnapshotChunk, } // ApplySnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *Client) ApplySnapshotChunkSync(_a0 tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { +func (_m *Client) ApplySnapshotChunkSync(_a0 abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk) *tmabci.ResponseApplySnapshotChunk); ok { + var r0 *abci.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk) *abci.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*abci.ResponseApplySnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -57,11 +57,11 @@ func (_m *Client) ApplySnapshotChunkSync(_a0 tmabci.RequestApplySnapshotChunk) ( } // BeginBlockAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) BeginBlockAsync(_a0 abci.RequestBeginBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) BeginBlockAsync(_a0 ocabci.RequestBeginBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestBeginBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -73,20 +73,20 @@ func (_m *Client) BeginBlockAsync(_a0 abci.RequestBeginBlock, _a1 abcicli.Respon } // BeginBlockSync provides a mock function with given fields: _a0 -func (_m *Client) BeginBlockSync(_a0 abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { +func (_m *Client) BeginBlockSync(_a0 ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(abci.RequestBeginBlock) *tmabci.ResponseBeginBlock); ok { + var r0 *abci.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) *abci.ResponseBeginBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseBeginBlock) + r0 = ret.Get(0).(*abci.ResponseBeginBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestBeginBlock) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestBeginBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -96,11 +96,11 @@ func (_m *Client) BeginBlockSync(_a0 abci.RequestBeginBlock) (*tmabci.ResponseBe } // BeginRecheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) BeginRecheckTxAsync(_a0 abci.RequestBeginRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) BeginRecheckTxAsync(_a0 ocabci.RequestBeginRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestBeginRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -112,20 +112,20 @@ func (_m *Client) BeginRecheckTxAsync(_a0 abci.RequestBeginRecheckTx, _a1 abcicl } // BeginRecheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) BeginRecheckTxSync(_a0 abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { +func (_m *Client) BeginRecheckTxSync(_a0 ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseBeginRecheckTx - if rf, ok := ret.Get(0).(func(abci.RequestBeginRecheckTx) *abci.ResponseBeginRecheckTx); ok { + var r0 *ocabci.ResponseBeginRecheckTx + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginRecheckTx) *ocabci.ResponseBeginRecheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseBeginRecheckTx) + r0 = ret.Get(0).(*ocabci.ResponseBeginRecheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestBeginRecheckTx) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestBeginRecheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -135,11 +135,11 @@ func (_m *Client) BeginRecheckTxSync(_a0 abci.RequestBeginRecheckTx) (*abci.Resp } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -151,20 +151,20 @@ func (_m *Client) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 abcicli.ResponseCa } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) CheckTxSync(_a0 tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { +func (_m *Client) CheckTxSync(_a0 abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseCheckTx - if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx) *abci.ResponseCheckTx); ok { + var r0 *ocabci.ResponseCheckTx + if rf, ok := ret.Get(0).(func(abci.RequestCheckTx) *ocabci.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseCheckTx) + r0 = ret.Get(0).(*ocabci.ResponseCheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestCheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -190,15 +190,15 @@ func (_m *Client) CommitAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqRes { } // CommitSync provides a mock function with given fields: -func (_m *Client) CommitSync() (*tmabci.ResponseCommit, error) { +func (_m *Client) CommitSync() (*abci.ResponseCommit, error) { ret := _m.Called() - var r0 *tmabci.ResponseCommit - if rf, ok := ret.Get(0).(func() *tmabci.ResponseCommit); ok { + var r0 *abci.ResponseCommit + if rf, ok := ret.Get(0).(func() *abci.ResponseCommit); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseCommit) + r0 = ret.Get(0).(*abci.ResponseCommit) } } @@ -213,11 +213,11 @@ func (_m *Client) CommitSync() (*tmabci.ResponseCommit, error) { } // DeliverTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) DeliverTxAsync(_a0 tmabci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) DeliverTxAsync(_a0 abci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -229,20 +229,20 @@ func (_m *Client) DeliverTxAsync(_a0 tmabci.RequestDeliverTx, _a1 abcicli.Respon } // DeliverTxSync provides a mock function with given fields: _a0 -func (_m *Client) DeliverTxSync(_a0 tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { +func (_m *Client) DeliverTxSync(_a0 abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseDeliverTx - if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx) *tmabci.ResponseDeliverTx); ok { + var r0 *abci.ResponseDeliverTx + if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx) *abci.ResponseDeliverTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseDeliverTx) + r0 = ret.Get(0).(*abci.ResponseDeliverTx) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestDeliverTx) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestDeliverTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -268,15 +268,15 @@ func (_m *Client) EchoAsync(_a0 string, _a1 abcicli.ResponseCallback) *abcicli.R } // EchoSync provides a mock function with given fields: _a0 -func (_m *Client) EchoSync(_a0 string) (*tmabci.ResponseEcho, error) { +func (_m *Client) EchoSync(_a0 string) (*abci.ResponseEcho, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseEcho - if rf, ok := ret.Get(0).(func(string) *tmabci.ResponseEcho); ok { + var r0 *abci.ResponseEcho + if rf, ok := ret.Get(0).(func(string) *abci.ResponseEcho); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseEcho) + r0 = ret.Get(0).(*abci.ResponseEcho) } } @@ -291,11 +291,11 @@ func (_m *Client) EchoSync(_a0 string) (*tmabci.ResponseEcho, error) { } // EndBlockAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) EndBlockAsync(_a0 tmabci.RequestEndBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) EndBlockAsync(_a0 abci.RequestEndBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestEndBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -307,20 +307,20 @@ func (_m *Client) EndBlockAsync(_a0 tmabci.RequestEndBlock, _a1 abcicli.Response } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *Client) EndBlockSync(_a0 tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (_m *Client) EndBlockSync(_a0 abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock) *abci.ResponseEndBlock); ok { + var r0 *ocabci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *ocabci.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseEndBlock) + r0 = ret.Get(0).(*ocabci.ResponseEndBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestEndBlock) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestEndBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -330,11 +330,11 @@ func (_m *Client) EndBlockSync(_a0 tmabci.RequestEndBlock) (*abci.ResponseEndBlo } // EndRecheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) EndRecheckTxAsync(_a0 abci.RequestEndRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) EndRecheckTxAsync(_a0 ocabci.RequestEndRecheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestEndRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(ocabci.RequestEndRecheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -346,20 +346,20 @@ func (_m *Client) EndRecheckTxAsync(_a0 abci.RequestEndRecheckTx, _a1 abcicli.Re } // EndRecheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) EndRecheckTxSync(_a0 abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { +func (_m *Client) EndRecheckTxSync(_a0 ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseEndRecheckTx - if rf, ok := ret.Get(0).(func(abci.RequestEndRecheckTx) *abci.ResponseEndRecheckTx); ok { + var r0 *ocabci.ResponseEndRecheckTx + if rf, ok := ret.Get(0).(func(ocabci.RequestEndRecheckTx) *ocabci.ResponseEndRecheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseEndRecheckTx) + r0 = ret.Get(0).(*ocabci.ResponseEndRecheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestEndRecheckTx) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestEndRecheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -399,15 +399,15 @@ func (_m *Client) FlushAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqRes { } // FlushSync provides a mock function with given fields: -func (_m *Client) FlushSync() (*tmabci.ResponseFlush, error) { +func (_m *Client) FlushSync() (*abci.ResponseFlush, error) { ret := _m.Called() - var r0 *tmabci.ResponseFlush - if rf, ok := ret.Get(0).(func() *tmabci.ResponseFlush); ok { + var r0 *abci.ResponseFlush + if rf, ok := ret.Get(0).(func() *abci.ResponseFlush); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseFlush) + r0 = ret.Get(0).(*abci.ResponseFlush) } } @@ -438,11 +438,11 @@ func (_m *Client) GetGlobalCallback() abcicli.GlobalCallback { } // InfoAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) InfoAsync(_a0 tmabci.RequestInfo, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) InfoAsync(_a0 abci.RequestInfo, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestInfo, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestInfo, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -454,20 +454,20 @@ func (_m *Client) InfoAsync(_a0 tmabci.RequestInfo, _a1 abcicli.ResponseCallback } // InfoSync provides a mock function with given fields: _a0 -func (_m *Client) InfoSync(_a0 tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { +func (_m *Client) InfoSync(_a0 abci.RequestInfo) (*abci.ResponseInfo, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseInfo - if rf, ok := ret.Get(0).(func(tmabci.RequestInfo) *tmabci.ResponseInfo); ok { + var r0 *abci.ResponseInfo + if rf, ok := ret.Get(0).(func(abci.RequestInfo) *abci.ResponseInfo); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseInfo) + r0 = ret.Get(0).(*abci.ResponseInfo) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestInfo) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -477,11 +477,11 @@ func (_m *Client) InfoSync(_a0 tmabci.RequestInfo) (*tmabci.ResponseInfo, error) } // InitChainAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) InitChainAsync(_a0 abci.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) InitChainAsync(_a0 ocabci.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -493,20 +493,20 @@ func (_m *Client) InitChainAsync(_a0 abci.RequestInitChain, _a1 abcicli.Response } // InitChainSync provides a mock function with given fields: _a0 -func (_m *Client) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (_m *Client) InitChainSync(_a0 ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { + var r0 *ocabci.ResponseInitChain + if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain) *ocabci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseInitChain) + r0 = ret.Get(0).(*ocabci.ResponseInitChain) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -530,11 +530,11 @@ func (_m *Client) IsRunning() bool { } // ListSnapshotsAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) ListSnapshotsAsync(_a0 tmabci.RequestListSnapshots, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) ListSnapshotsAsync(_a0 abci.RequestListSnapshots, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -546,20 +546,20 @@ func (_m *Client) ListSnapshotsAsync(_a0 tmabci.RequestListSnapshots, _a1 abcicl } // ListSnapshotsSync provides a mock function with given fields: _a0 -func (_m *Client) ListSnapshotsSync(_a0 tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { +func (_m *Client) ListSnapshotsSync(_a0 abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots) *tmabci.ResponseListSnapshots); ok { + var r0 *abci.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots) *abci.ResponseListSnapshots); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseListSnapshots) + r0 = ret.Get(0).(*abci.ResponseListSnapshots) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestListSnapshots) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -569,11 +569,11 @@ func (_m *Client) ListSnapshotsSync(_a0 tmabci.RequestListSnapshots) (*tmabci.Re } // LoadSnapshotChunkAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) LoadSnapshotChunkAsync(_a0 tmabci.RequestLoadSnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) LoadSnapshotChunkAsync(_a0 abci.RequestLoadSnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -585,20 +585,20 @@ func (_m *Client) LoadSnapshotChunkAsync(_a0 tmabci.RequestLoadSnapshotChunk, _a } // LoadSnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *Client) LoadSnapshotChunkSync(_a0 tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { +func (_m *Client) LoadSnapshotChunkSync(_a0 abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk) *tmabci.ResponseLoadSnapshotChunk); ok { + var r0 *abci.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk) *abci.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*abci.ResponseLoadSnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -608,11 +608,11 @@ func (_m *Client) LoadSnapshotChunkSync(_a0 tmabci.RequestLoadSnapshotChunk) (*t } // OfferSnapshotAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) OfferSnapshotAsync(_a0 tmabci.RequestOfferSnapshot, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) OfferSnapshotAsync(_a0 abci.RequestOfferSnapshot, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -624,20 +624,20 @@ func (_m *Client) OfferSnapshotAsync(_a0 tmabci.RequestOfferSnapshot, _a1 abcicl } // OfferSnapshotSync provides a mock function with given fields: _a0 -func (_m *Client) OfferSnapshotSync(_a0 tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { +func (_m *Client) OfferSnapshotSync(_a0 abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot) *tmabci.ResponseOfferSnapshot); ok { + var r0 *abci.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot) *abci.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseOfferSnapshot) + r0 = ret.Get(0).(*abci.ResponseOfferSnapshot) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestOfferSnapshot) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -680,11 +680,11 @@ func (_m *Client) OnStop() { } // QueryAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) QueryAsync(_a0 tmabci.RequestQuery, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) QueryAsync(_a0 abci.RequestQuery, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestQuery, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestQuery, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -696,20 +696,20 @@ func (_m *Client) QueryAsync(_a0 tmabci.RequestQuery, _a1 abcicli.ResponseCallba } // QuerySync provides a mock function with given fields: _a0 -func (_m *Client) QuerySync(_a0 tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { +func (_m *Client) QuerySync(_a0 abci.RequestQuery) (*abci.ResponseQuery, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseQuery - if rf, ok := ret.Get(0).(func(tmabci.RequestQuery) *tmabci.ResponseQuery); ok { + var r0 *abci.ResponseQuery + if rf, ok := ret.Get(0).(func(abci.RequestQuery) *abci.ResponseQuery); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseQuery) + r0 = ret.Get(0).(*abci.ResponseQuery) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestQuery) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -759,11 +759,11 @@ func (_m *Client) SetLogger(_a0 log.Logger) { } // SetOptionAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) SetOptionAsync(_a0 tmabci.RequestSetOption, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) SetOptionAsync(_a0 abci.RequestSetOption, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestSetOption, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestSetOption, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -775,20 +775,20 @@ func (_m *Client) SetOptionAsync(_a0 tmabci.RequestSetOption, _a1 abcicli.Respon } // SetOptionSync provides a mock function with given fields: _a0 -func (_m *Client) SetOptionSync(_a0 tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { +func (_m *Client) SetOptionSync(_a0 abci.RequestSetOption) (*abci.ResponseSetOption, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseSetOption - if rf, ok := ret.Get(0).(func(tmabci.RequestSetOption) *tmabci.ResponseSetOption); ok { + var r0 *abci.ResponseSetOption + if rf, ok := ret.Get(0).(func(abci.RequestSetOption) *abci.ResponseSetOption); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseSetOption) + r0 = ret.Get(0).(*abci.ResponseSetOption) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestSetOption) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestSetOption) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index aca2dc8d7..c4a095649 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -10,9 +10,9 @@ import ( "reflect" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" @@ -131,14 +131,14 @@ func (cli *socketClient) sendRequestsRoutine(conn io.Writer) { // cli.Logger.Debug("Sent request", "requestType", reflect.TypeOf(reqres.Request), "request", reqres.Request) cli.willSendReq(reqres) - err := abci.WriteMessage(reqres.Request, w) + err := ocabci.WriteMessage(reqres.Request, w) if err != nil { cli.stopForError(fmt.Errorf("write to buffer: %w", err)) return } // If it's a flush request, flush the current buffer. - if _, ok := reqres.Request.Value.(*abci.Request_Flush); ok { + if _, ok := reqres.Request.Value.(*ocabci.Request_Flush); ok { err = w.Flush() if err != nil { cli.stopForError(fmt.Errorf("flush buffer: %w", err)) @@ -147,7 +147,7 @@ func (cli *socketClient) sendRequestsRoutine(conn io.Writer) { } case <-cli.flushTimer.Ch: // flush queue select { - case cli.reqQueue <- NewReqRes(abci.ToRequestFlush(), nil): + case cli.reqQueue <- NewReqRes(ocabci.ToRequestFlush(), nil): default: // Probably will fill the buffer, or retry later. } @@ -160,8 +160,8 @@ func (cli *socketClient) sendRequestsRoutine(conn io.Writer) { func (cli *socketClient) recvResponseRoutine(conn io.Reader) { r := bufio.NewReader(conn) for { - var res = &abci.Response{} - err := abci.ReadMessage(r, res) + var res = &ocabci.Response{} + err := ocabci.ReadMessage(r, res) if err != nil { cli.stopForError(fmt.Errorf("read message: %w", err)) return @@ -170,7 +170,7 @@ func (cli *socketClient) recvResponseRoutine(conn io.Reader) { // cli.Logger.Debug("Received response", "responseType", reflect.TypeOf(res), "response", res) switch r := res.Value.(type) { - case *abci.Response_Exception: // app responded with error + case *ocabci.Response_Exception: // app responded with error // XXX After setting cli.err, release waiters (e.g. reqres.Done()) cli.stopForError(errors.New(r.Exception.Error)) return @@ -190,7 +190,7 @@ func (cli *socketClient) willSendReq(reqres *ReqRes) { cli.reqSent.PushBack(reqres) } -func (cli *socketClient) didRecvResponse(res *abci.Response) error { +func (cli *socketClient) didRecvResponse(res *ocabci.Response) error { cli.mtx.Lock() defer cli.mtx.Unlock() @@ -227,77 +227,77 @@ func (cli *socketClient) didRecvResponse(res *abci.Response) error { //---------------------------------------- func (cli *socketClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestEcho(msg), cb) + return cli.queueRequest(ocabci.ToRequestEcho(msg), cb) } func (cli *socketClient) FlushAsync(cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestFlush(), cb) + return cli.queueRequest(ocabci.ToRequestFlush(), cb) } -func (cli *socketClient) InfoAsync(req tmabci.RequestInfo, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestInfo(req), cb) +func (cli *socketClient) InfoAsync(req abci.RequestInfo, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestInfo(req), cb) } -func (cli *socketClient) SetOptionAsync(req tmabci.RequestSetOption, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestSetOption(req), cb) +func (cli *socketClient) SetOptionAsync(req abci.RequestSetOption, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestSetOption(req), cb) } -func (cli *socketClient) DeliverTxAsync(req tmabci.RequestDeliverTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestDeliverTx(req), cb) +func (cli *socketClient) DeliverTxAsync(req abci.RequestDeliverTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestDeliverTx(req), cb) } -func (cli *socketClient) CheckTxAsync(req tmabci.RequestCheckTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestCheckTx(req), cb) +func (cli *socketClient) CheckTxAsync(req abci.RequestCheckTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestCheckTx(req), cb) } -func (cli *socketClient) QueryAsync(req tmabci.RequestQuery, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestQuery(req), cb) +func (cli *socketClient) QueryAsync(req abci.RequestQuery, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestQuery(req), cb) } func (cli *socketClient) CommitAsync(cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestCommit(), cb) + return cli.queueRequest(ocabci.ToRequestCommit(), cb) } -func (cli *socketClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestInitChain(req), cb) +func (cli *socketClient) InitChainAsync(req ocabci.RequestInitChain, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestInitChain(req), cb) } -func (cli *socketClient) BeginBlockAsync(req abci.RequestBeginBlock, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestBeginBlock(req), cb) +func (cli *socketClient) BeginBlockAsync(req ocabci.RequestBeginBlock, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestBeginBlock(req), cb) } -func (cli *socketClient) EndBlockAsync(req tmabci.RequestEndBlock, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestEndBlock(req), cb) +func (cli *socketClient) EndBlockAsync(req abci.RequestEndBlock, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestEndBlock(req), cb) } -func (cli *socketClient) BeginRecheckTxAsync(req abci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestBeginRecheckTx(req), cb) +func (cli *socketClient) BeginRecheckTxAsync(req ocabci.RequestBeginRecheckTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestBeginRecheckTx(req), cb) } -func (cli *socketClient) EndRecheckTxAsync(req abci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestEndRecheckTx(req), cb) +func (cli *socketClient) EndRecheckTxAsync(req ocabci.RequestEndRecheckTx, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestEndRecheckTx(req), cb) } -func (cli *socketClient) ListSnapshotsAsync(req tmabci.RequestListSnapshots, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestListSnapshots(req), cb) +func (cli *socketClient) ListSnapshotsAsync(req abci.RequestListSnapshots, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestListSnapshots(req), cb) } -func (cli *socketClient) OfferSnapshotAsync(req tmabci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestOfferSnapshot(req), cb) +func (cli *socketClient) OfferSnapshotAsync(req abci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestOfferSnapshot(req), cb) } -func (cli *socketClient) LoadSnapshotChunkAsync(req tmabci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestLoadSnapshotChunk(req), cb) +func (cli *socketClient) LoadSnapshotChunkAsync(req abci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestLoadSnapshotChunk(req), cb) } -func (cli *socketClient) ApplySnapshotChunkAsync(req tmabci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { - return cli.queueRequest(abci.ToRequestApplySnapshotChunk(req), cb) +func (cli *socketClient) ApplySnapshotChunkAsync(req abci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { + return cli.queueRequest(ocabci.ToRequestApplySnapshotChunk(req), cb) } //---------------------------------------- -func (cli *socketClient) FlushSync() (*tmabci.ResponseFlush, error) { - reqRes := cli.queueRequest(abci.ToRequestFlush(), nil) +func (cli *socketClient) FlushSync() (*abci.ResponseFlush, error) { + reqRes := cli.queueRequest(ocabci.ToRequestFlush(), nil) if err := cli.Error(); err != nil { return nil, err } @@ -305,8 +305,8 @@ func (cli *socketClient) FlushSync() (*tmabci.ResponseFlush, error) { return reqRes.Response.GetFlush(), cli.Error() } -func (cli *socketClient) EchoSync(msg string) (*tmabci.ResponseEcho, error) { - reqres := cli.queueRequest(abci.ToRequestEcho(msg), nil) +func (cli *socketClient) EchoSync(msg string) (*abci.ResponseEcho, error) { + reqres := cli.queueRequest(ocabci.ToRequestEcho(msg), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -314,8 +314,8 @@ func (cli *socketClient) EchoSync(msg string) (*tmabci.ResponseEcho, error) { return reqres.Response.GetEcho(), cli.Error() } -func (cli *socketClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { - reqres := cli.queueRequest(abci.ToRequestInfo(req), nil) +func (cli *socketClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { + reqres := cli.queueRequest(ocabci.ToRequestInfo(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -323,8 +323,8 @@ func (cli *socketClient) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, return reqres.Response.GetInfo(), cli.Error() } -func (cli *socketClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { - reqres := cli.queueRequest(abci.ToRequestSetOption(req), nil) +func (cli *socketClient) SetOptionSync(req abci.RequestSetOption) (*abci.ResponseSetOption, error) { + reqres := cli.queueRequest(ocabci.ToRequestSetOption(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -332,8 +332,8 @@ func (cli *socketClient) SetOptionSync(req tmabci.RequestSetOption) (*tmabci.Res return reqres.Response.GetSetOption(), cli.Error() } -func (cli *socketClient) DeliverTxSync(req tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { - reqres := cli.queueRequest(abci.ToRequestDeliverTx(req), nil) +func (cli *socketClient) DeliverTxSync(req abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { + reqres := cli.queueRequest(ocabci.ToRequestDeliverTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -341,8 +341,8 @@ func (cli *socketClient) DeliverTxSync(req tmabci.RequestDeliverTx) (*tmabci.Res return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *socketClient) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { - reqres := cli.queueRequest(abci.ToRequestCheckTx(req), nil) +func (cli *socketClient) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { + reqres := cli.queueRequest(ocabci.ToRequestCheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -350,8 +350,8 @@ func (cli *socketClient) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseC return reqres.Response.GetCheckTx(), cli.Error() } -func (cli *socketClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { - reqres := cli.queueRequest(abci.ToRequestQuery(req), nil) +func (cli *socketClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, error) { + reqres := cli.queueRequest(ocabci.ToRequestQuery(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -359,8 +359,8 @@ func (cli *socketClient) QuerySync(req tmabci.RequestQuery) (*tmabci.ResponseQue return reqres.Response.GetQuery(), cli.Error() } -func (cli *socketClient) CommitSync() (*tmabci.ResponseCommit, error) { - reqres := cli.queueRequest(abci.ToRequestCommit(), nil) +func (cli *socketClient) CommitSync() (*abci.ResponseCommit, error) { + reqres := cli.queueRequest(ocabci.ToRequestCommit(), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -368,8 +368,8 @@ func (cli *socketClient) CommitSync() (*tmabci.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { - reqres := cli.queueRequest(abci.ToRequestInitChain(req), nil) +func (cli *socketClient) InitChainSync(req ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { + reqres := cli.queueRequest(ocabci.ToRequestInitChain(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -377,8 +377,8 @@ func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*abci.Respons return reqres.Response.GetInitChain(), cli.Error() } -func (cli *socketClient) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { - reqres := cli.queueRequest(abci.ToRequestBeginBlock(req), nil) +func (cli *socketClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { + reqres := cli.queueRequest(ocabci.ToRequestBeginBlock(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -386,8 +386,8 @@ func (cli *socketClient) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.Res return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *socketClient) EndBlockSync(req tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { - reqres := cli.queueRequest(abci.ToRequestEndBlock(req), nil) +func (cli *socketClient) EndBlockSync(req abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { + reqres := cli.queueRequest(ocabci.ToRequestEndBlock(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -395,8 +395,8 @@ func (cli *socketClient) EndBlockSync(req tmabci.RequestEndBlock) (*abci.Respons return reqres.Response.GetEndBlock(), cli.Error() } -func (cli *socketClient) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { - reqres := cli.queueRequest(abci.ToRequestBeginRecheckTx(req), nil) +func (cli *socketClient) BeginRecheckTxSync(req ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) { + reqres := cli.queueRequest(ocabci.ToRequestBeginRecheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -404,8 +404,8 @@ func (cli *socketClient) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*ab return reqres.Response.GetBeginRecheckTx(), cli.Error() } -func (cli *socketClient) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { - reqres := cli.queueRequest(abci.ToRequestEndRecheckTx(req), nil) +func (cli *socketClient) EndRecheckTxSync(req ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) { + reqres := cli.queueRequest(ocabci.ToRequestEndRecheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -413,8 +413,8 @@ func (cli *socketClient) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.R return reqres.Response.GetEndRecheckTx(), cli.Error() } -func (cli *socketClient) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { - reqres := cli.queueRequest(abci.ToRequestListSnapshots(req), nil) +func (cli *socketClient) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { + reqres := cli.queueRequest(ocabci.ToRequestListSnapshots(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -422,8 +422,8 @@ func (cli *socketClient) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tm return reqres.Response.GetListSnapshots(), cli.Error() } -func (cli *socketClient) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { - reqres := cli.queueRequest(abci.ToRequestOfferSnapshot(req), nil) +func (cli *socketClient) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { + reqres := cli.queueRequest(ocabci.ToRequestOfferSnapshot(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -432,8 +432,8 @@ func (cli *socketClient) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tm } func (cli *socketClient) LoadSnapshotChunkSync( - req tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { - reqres := cli.queueRequest(abci.ToRequestLoadSnapshotChunk(req), nil) + req abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { + reqres := cli.queueRequest(ocabci.ToRequestLoadSnapshotChunk(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -442,8 +442,8 @@ func (cli *socketClient) LoadSnapshotChunkSync( } func (cli *socketClient) ApplySnapshotChunkSync( - req tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { - reqres := cli.queueRequest(abci.ToRequestApplySnapshotChunk(req), nil) + req abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { + reqres := cli.queueRequest(ocabci.ToRequestApplySnapshotChunk(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err } @@ -452,7 +452,7 @@ func (cli *socketClient) ApplySnapshotChunkSync( //---------------------------------------- -func (cli *socketClient) queueRequest(req *abci.Request, cb ResponseCallback) *ReqRes { +func (cli *socketClient) queueRequest(req *ocabci.Request, cb ResponseCallback) *ReqRes { reqres := NewReqRes(req, cb) // TODO: set cli.err if reqQueue times out @@ -460,7 +460,7 @@ func (cli *socketClient) queueRequest(req *abci.Request, cb ResponseCallback) *R // Maybe auto-flush, or unset auto-flush switch req.Value.(type) { - case *abci.Request_Flush: + case *ocabci.Request_Flush: cli.flushTimer.Unset() default: cli.flushTimer.Set() @@ -493,42 +493,42 @@ LOOP: //---------------------------------------- -func resMatchesReq(req *abci.Request, res *abci.Response) (ok bool) { +func resMatchesReq(req *ocabci.Request, res *ocabci.Response) (ok bool) { switch req.Value.(type) { - case *abci.Request_Echo: - _, ok = res.Value.(*abci.Response_Echo) - case *abci.Request_Flush: - _, ok = res.Value.(*abci.Response_Flush) - case *abci.Request_Info: - _, ok = res.Value.(*abci.Response_Info) - case *abci.Request_SetOption: - _, ok = res.Value.(*abci.Response_SetOption) - case *abci.Request_DeliverTx: - _, ok = res.Value.(*abci.Response_DeliverTx) - case *abci.Request_CheckTx: - _, ok = res.Value.(*abci.Response_CheckTx) - case *abci.Request_Commit: - _, ok = res.Value.(*abci.Response_Commit) - case *abci.Request_Query: - _, ok = res.Value.(*abci.Response_Query) - case *abci.Request_InitChain: - _, ok = res.Value.(*abci.Response_InitChain) - case *abci.Request_BeginBlock: - _, ok = res.Value.(*abci.Response_BeginBlock) - case *abci.Request_EndBlock: - _, ok = res.Value.(*abci.Response_EndBlock) - case *abci.Request_BeginRecheckTx: - _, ok = res.Value.(*abci.Response_BeginRecheckTx) - case *abci.Request_EndRecheckTx: - _, ok = res.Value.(*abci.Response_EndRecheckTx) - case *abci.Request_ApplySnapshotChunk: - _, ok = res.Value.(*abci.Response_ApplySnapshotChunk) - case *abci.Request_LoadSnapshotChunk: - _, ok = res.Value.(*abci.Response_LoadSnapshotChunk) - case *abci.Request_ListSnapshots: - _, ok = res.Value.(*abci.Response_ListSnapshots) - case *abci.Request_OfferSnapshot: - _, ok = res.Value.(*abci.Response_OfferSnapshot) + case *ocabci.Request_Echo: + _, ok = res.Value.(*ocabci.Response_Echo) + case *ocabci.Request_Flush: + _, ok = res.Value.(*ocabci.Response_Flush) + case *ocabci.Request_Info: + _, ok = res.Value.(*ocabci.Response_Info) + case *ocabci.Request_SetOption: + _, ok = res.Value.(*ocabci.Response_SetOption) + case *ocabci.Request_DeliverTx: + _, ok = res.Value.(*ocabci.Response_DeliverTx) + case *ocabci.Request_CheckTx: + _, ok = res.Value.(*ocabci.Response_CheckTx) + case *ocabci.Request_Commit: + _, ok = res.Value.(*ocabci.Response_Commit) + case *ocabci.Request_Query: + _, ok = res.Value.(*ocabci.Response_Query) + case *ocabci.Request_InitChain: + _, ok = res.Value.(*ocabci.Response_InitChain) + case *ocabci.Request_BeginBlock: + _, ok = res.Value.(*ocabci.Response_BeginBlock) + case *ocabci.Request_EndBlock: + _, ok = res.Value.(*ocabci.Response_EndBlock) + case *ocabci.Request_BeginRecheckTx: + _, ok = res.Value.(*ocabci.Response_BeginRecheckTx) + case *ocabci.Request_EndRecheckTx: + _, ok = res.Value.(*ocabci.Response_EndRecheckTx) + case *ocabci.Request_ApplySnapshotChunk: + _, ok = res.Value.(*ocabci.Response_ApplySnapshotChunk) + case *ocabci.Request_LoadSnapshotChunk: + _, ok = res.Value.(*ocabci.Response_LoadSnapshotChunk) + case *ocabci.Request_ListSnapshots: + _, ok = res.Value.(*ocabci.Response_ListSnapshots) + case *ocabci.Request_OfferSnapshot: + _, ok = res.Value.(*ocabci.Response_OfferSnapshot) } return ok } diff --git a/abci/client/socket_client_test.go b/abci/client/socket_client_test.go index c5b32a062..e482fbbe8 100644 --- a/abci/client/socket_client_test.go +++ b/abci/client/socket_client_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/server" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/libs/service" ) @@ -35,7 +35,7 @@ func TestProperSyncCalls(t *testing.T) { resp := make(chan error, 1) go func() { // This is BeginBlockSync unrolled.... - reqres := c.BeginBlockAsync(abci.RequestBeginBlock{}, nil) + reqres := c.BeginBlockAsync(ocabci.RequestBeginBlock{}, nil) _, err := c.FlushSync() require.NoError(t, err) res := reqres.Response.GetBeginBlock() @@ -70,7 +70,7 @@ func TestHangingSyncCalls(t *testing.T) { resp := make(chan error, 1) go func() { // Start BeginBlock and flush it - reqres := c.BeginBlockAsync(abci.RequestBeginBlock{}, nil) + reqres := c.BeginBlockAsync(ocabci.RequestBeginBlock{}, nil) flush := c.FlushAsync(nil) // wait 20 ms for all events to travel socket, but // no response yet from server @@ -94,7 +94,7 @@ func TestHangingSyncCalls(t *testing.T) { } } -func setupClientServer(t *testing.T, app abci.Application) ( +func setupClientServer(t *testing.T, app ocabci.Application) ( service.Service, abcicli.Client) { // some port between 20k and 30k port := 20000 + tmrand.Int32()%10000 @@ -113,12 +113,12 @@ func setupClientServer(t *testing.T, app abci.Application) ( } type slowApp struct { - abci.BaseApplication + ocabci.BaseApplication } -func (slowApp) BeginBlock(req abci.RequestBeginBlock) tmabci.ResponseBeginBlock { +func (slowApp) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { time.Sleep(200 * time.Millisecond) - return tmabci.ResponseBeginBlock{} + return abci.ResponseBeginBlock{} } func TestSockerClientCalls(t *testing.T) { @@ -136,26 +136,26 @@ func TestSockerClientCalls(t *testing.T) { } }) - c.SetGlobalCallback(func(*abci.Request, *abci.Response) { + c.SetGlobalCallback(func(*ocabci.Request, *ocabci.Response) { }) c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(tmabci.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(tmabci.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(tmabci.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(tmabci.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(tmabci.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(abci.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(abci.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(abci.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) - c.BeginBlockAsync(abci.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(tmabci.RequestEndBlock{}, getResponseCallback(t)) - c.BeginRecheckTxAsync(abci.RequestBeginRecheckTx{}, getResponseCallback(t)) - c.EndRecheckTxAsync(abci.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(tmabci.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(tmabci.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(tmabci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(tmabci.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.InitChainAsync(ocabci.RequestInitChain{}, getResponseCallback(t)) + c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) + c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) + c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) + c.EndRecheckTxAsync(ocabci.RequestEndRecheckTx{}, getResponseCallback(t)) + c.ListSnapshotsAsync(abci.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(abci.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -163,54 +163,54 @@ func TestSockerClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(tmabci.RequestInfo{}) + _, err = c.InfoSync(abci.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(tmabci.RequestSetOption{}) + _, err = c.SetOptionSync(abci.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(tmabci.RequestDeliverTx{}) + _, err = c.DeliverTxSync(abci.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(tmabci.RequestCheckTx{}) + _, err = c.CheckTxSync(abci.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(tmabci.RequestQuery{}) + _, err = c.QuerySync(abci.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(abci.RequestInitChain{}) + _, err = c.InitChainSync(ocabci.RequestInitChain{}) require.NoError(t, err) - _, err = c.BeginBlockSync(abci.RequestBeginBlock{}) + _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(tmabci.RequestEndBlock{}) + _, err = c.EndBlockSync(abci.RequestEndBlock{}) require.NoError(t, err) - _, err = c.BeginRecheckTxSync(abci.RequestBeginRecheckTx{}) + _, err = c.BeginRecheckTxSync(ocabci.RequestBeginRecheckTx{}) require.NoError(t, err) - _, err = c.EndRecheckTxSync(abci.RequestEndRecheckTx{}) + _, err = c.EndRecheckTxSync(ocabci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(tmabci.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(abci.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(tmabci.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(abci.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{}) require.NoError(t, err) } type sampleApp struct { - abci.BaseApplication + ocabci.BaseApplication } func newDoneChan(t *testing.T) chan struct{} { @@ -228,7 +228,7 @@ func newDoneChan(t *testing.T) chan struct{} { func getResponseCallback(t *testing.T) abcicli.ResponseCallback { doneChan := newDoneChan(t) - return func(res *abci.Response) { + return func(res *ocabci.Response) { require.NotNil(t, res) doneChan <- struct{}{} } diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 4ee8535c7..ad5f14681 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -13,7 +13,7 @@ import ( "github.com/spf13/cobra" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" abcicli "github.com/line/ostracon/abci/client" @@ -22,7 +22,7 @@ import ( "github.com/line/ostracon/abci/example/kvstore" "github.com/line/ostracon/abci/server" servertest "github.com/line/ostracon/abci/tests/server" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/abci/version" "github.com/line/ostracon/config" "github.com/line/ostracon/crypto/encoding" @@ -519,7 +519,7 @@ func cmdInfo(cmd *cobra.Command, args []string) error { if len(args) == 1 { version = args[0] } - res, err := client.InfoSync(tmabci.RequestInfo{Version: version}) + res, err := client.InfoSync(abci.RequestInfo{Version: version}) if err != nil { return err } @@ -542,7 +542,7 @@ func cmdSetOption(cmd *cobra.Command, args []string) error { } key, val := args[0], args[1] - _, err := client.SetOptionSync(tmabci.RequestSetOption{Key: key, Value: val}) + _, err := client.SetOptionSync(abci.RequestSetOption{Key: key, Value: val}) if err != nil { return err } @@ -563,7 +563,7 @@ func cmdDeliverTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res, err := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) + res, err := client.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) if err != nil { return err } @@ -589,7 +589,7 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res, err := client.CheckTxSync(tmabci.RequestCheckTx{Tx: txBytes}) + res, err := client.CheckTxSync(abci.RequestCheckTx{Tx: txBytes}) if err != nil { return err } @@ -629,7 +629,7 @@ func cmdQuery(cmd *cobra.Command, args []string) error { return err } - resQuery, err := client.QuerySync(tmabci.RequestQuery{ + resQuery, err := client.QuerySync(abci.RequestQuery{ Data: queryBytes, Path: flagPath, Height: int64(flagHeight), @@ -682,7 +682,7 @@ func cmdKVStore(cmd *cobra.Command, args []string) error { logger := log.NewOCLogger(log.NewSyncWriter(os.Stdout)) // Create the application - in memory or persisted to disk - var app types.Application + var app ocabci.Application if flagPersist == "" { app = kvstore.NewApplication() } else { @@ -734,7 +734,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro pubStr, tx := kvstore.MakeValSetChangeTxAndMore(publicKey, flagVotingPower) { fmt.Printf("DeliverTxSync: data=%s, tx=%s\n", pubStr, tx) - res, err := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: []byte(tx)}) + res, err := client.DeliverTxSync(abci.RequestDeliverTx{Tx: []byte(tx)}) if err != nil { return err } @@ -747,7 +747,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro } { fmt.Printf("QuerySync: data=%s\n", pubStr) - res, err := client.QuerySync(tmabci.RequestQuery{Path: "/val", Data: []byte(pubStr)}) + res, err := client.QuerySync(abci.RequestQuery{Path: "/val", Data: []byte(pubStr)}) if err != nil { return err } @@ -757,8 +757,8 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro Log: res.Log, }) fmt.Printf("original:publicKey:%s\n", publicKey) - validatorUpdate := types.ValidatorUpdate{} - err = types.ReadMessage(bytes.NewReader(res.Value), &validatorUpdate) + validatorUpdate := ocabci.ValidatorUpdate{} + err = ocabci.ReadMessage(bytes.NewReader(res.Value), &validatorUpdate) if err != nil { panic(err) } @@ -776,7 +776,7 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) { } // Always print the status code. - if rsp.Code == types.CodeTypeOK { + if rsp.Code == ocabci.CodeTypeOK { fmt.Printf("-> code: OK\n") } else { fmt.Printf("-> code: %d\n", rsp.Code) diff --git a/abci/example/counter/counter.go b/abci/example/counter/counter.go index e8953c6a1..e9d83691d 100644 --- a/abci/example/counter/counter.go +++ b/abci/example/counter/counter.go @@ -4,14 +4,14 @@ import ( "encoding/binary" "fmt" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/abci/example/code" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" ) type Application struct { - abci.BaseApplication + ocabci.BaseApplication hashCount int txCount int @@ -22,11 +22,11 @@ func NewApplication(serial bool) *Application { return &Application{serial: serial} } -func (app *Application) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { - return tmabci.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} +func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo { + return abci.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } -func (app *Application) SetOption(req tmabci.RequestSetOption) tmabci.ResponseSetOption { +func (app *Application) SetOption(req abci.RequestSetOption) abci.ResponseSetOption { key, value := req.Key, req.Value if key == "serial" && value == "on" { app.serial = true @@ -38,16 +38,16 @@ func (app *Application) SetOption(req tmabci.RequestSetOption) tmabci.ResponseSe Error: fmt.Sprintf("Unknown key (%s) or value (%s)", key, value), } */ - return tmabci.ResponseSetOption{} + return abci.ResponseSetOption{} } - return tmabci.ResponseSetOption{} + return abci.ResponseSetOption{} } -func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { +func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { if app.serial { if len(req.Tx) > 8 { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))} } @@ -55,27 +55,27 @@ func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDe copy(tx8[len(tx8)-len(req.Tx):], req.Tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } } app.txCount++ - return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} + return abci.ResponseDeliverTx{Code: code.CodeTypeOK} } -func (app *Application) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { +func (app *Application) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { return app.checkTx(req) } -func (app *Application) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { +func (app *Application) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *Application) checkTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { +func (app *Application) checkTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { if app.serial { if len(req.Tx) > 8 { - return abci.ResponseCheckTx{ + return ocabci.ResponseCheckTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))} } @@ -83,31 +83,31 @@ func (app *Application) checkTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx copy(tx8[len(tx8)-len(req.Tx):], req.Tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return abci.ResponseCheckTx{ + return ocabci.ResponseCheckTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return abci.ResponseCheckTx{Code: code.CodeTypeOK} + return ocabci.ResponseCheckTx{Code: code.CodeTypeOK} } -func (app *Application) Commit() (resp tmabci.ResponseCommit) { +func (app *Application) Commit() (resp abci.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return tmabci.ResponseCommit{} + return abci.ResponseCommit{} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return tmabci.ResponseCommit{Data: hash} + return abci.ResponseCommit{Data: hash} } -func (app *Application) Query(reqQuery tmabci.RequestQuery) tmabci.ResponseQuery { +func (app *Application) Query(reqQuery abci.RequestQuery) abci.ResponseQuery { switch reqQuery.Path { case "hash": - return tmabci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))} + return abci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))} case "tx": - return tmabci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))} + return abci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))} default: - return tmabci.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} + return abci.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } diff --git a/abci/example/example_test.go b/abci/example/example_test.go index 6753bafd2..3b1c79b38 100644 --- a/abci/example/example_test.go +++ b/abci/example/example_test.go @@ -15,7 +15,7 @@ import ( "golang.org/x/net/context" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" @@ -24,7 +24,7 @@ import ( "github.com/line/ostracon/abci/example/code" "github.com/line/ostracon/abci/example/kvstore" abciserver "github.com/line/ostracon/abci/server" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" ) func init() { @@ -38,15 +38,15 @@ func TestKVStore(t *testing.T) { func TestBaseApp(t *testing.T) { fmt.Println("### Testing BaseApp") - testStream(t, abci.NewBaseApplication()) + testStream(t, ocabci.NewBaseApplication()) } func TestGRPC(t *testing.T) { fmt.Println("### Testing GRPC") - testGRPCSync(t, abci.NewGRPCApplication(abci.NewBaseApplication())) + testGRPCSync(t, ocabci.NewGRPCApplication(ocabci.NewBaseApplication())) } -func testStream(t *testing.T, app abci.Application) { +func testStream(t *testing.T, app ocabci.Application) { numDeliverTxs := 20000 socketFile := fmt.Sprintf("test-%08x.sock", rand.Int31n(1<<30)) defer os.Remove(socketFile) @@ -78,10 +78,10 @@ func testStream(t *testing.T, app abci.Application) { done := make(chan struct{}) counter := 0 - client.SetGlobalCallback(func(req *abci.Request, res *abci.Response) { + client.SetGlobalCallback(func(req *ocabci.Request, res *ocabci.Response) { // Process response switch r := res.Value.(type) { - case *abci.Response_DeliverTx: + case *ocabci.Response_DeliverTx: counter++ if r.DeliverTx.Code != code.CodeTypeOK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) @@ -96,7 +96,7 @@ func testStream(t *testing.T, app abci.Application) { }() return } - case *abci.Response_Flush: + case *ocabci.Response_Flush: // ignore default: t.Error("Unexpected response type", reflect.TypeOf(res.Value)) @@ -106,7 +106,7 @@ func testStream(t *testing.T, app abci.Application) { // Write requests for counter := 0; counter < numDeliverTxs; counter++ { // Send request - reqRes := client.DeliverTxAsync(tmabci.RequestDeliverTx{Tx: []byte("test")}, nil) + reqRes := client.DeliverTxAsync(abci.RequestDeliverTx{Tx: []byte("test")}, nil) _ = reqRes // check err ? @@ -130,7 +130,7 @@ func dialerFunc(ctx context.Context, addr string) (net.Conn, error) { return tmnet.Connect(addr) } -func testGRPCSync(t *testing.T, app abci.ABCIApplicationServer) { +func testGRPCSync(t *testing.T, app ocabci.ABCIApplicationServer) { numDeliverTxs := 2000 socketFile := fmt.Sprintf("/tmp/test-%08x.sock", rand.Int31n(1<<30)) defer os.Remove(socketFile) @@ -162,12 +162,12 @@ func testGRPCSync(t *testing.T, app abci.ABCIApplicationServer) { } }) - client := abci.NewABCIApplicationClient(conn) + client := ocabci.NewABCIApplicationClient(conn) // Write requests for counter := 0; counter < numDeliverTxs; counter++ { // Send request - response, err := client.DeliverTx(context.Background(), &tmabci.RequestDeliverTx{Tx: []byte("test")}) + response, err := client.DeliverTx(context.Background(), &abci.RequestDeliverTx{Tx: []byte("test")}) if err != nil { t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } diff --git a/abci/example/kvstore/helpers.go b/abci/example/kvstore/helpers.go index 6bf229814..423e1313d 100644 --- a/abci/example/kvstore/helpers.go +++ b/abci/example/kvstore/helpers.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" tmjson "github.com/line/ostracon/libs/json" @@ -34,10 +34,10 @@ func GenDefaultPrivKey() crypto.PrivKey { // RandVal creates one random validator, with a key derived // from the input value -func RandVal(i int) types.ValidatorUpdate { +func RandVal(i int) ocabci.ValidatorUpdate { pk := GenDefaultPrivKey().PubKey() power := tmrand.Uint16() + 1 - v := types.NewValidatorUpdate(pk, int64(power)) + v := ocabci.NewValidatorUpdate(pk, int64(power)) return v } @@ -45,8 +45,8 @@ func RandVal(i int) types.ValidatorUpdate { // the application. Note that the keys are deterministically // derived from the index in the array, while the power is // random (Change this if not desired) -func RandVals(cnt int) []types.ValidatorUpdate { - res := make([]types.ValidatorUpdate, cnt) +func RandVals(cnt int) []ocabci.ValidatorUpdate { + res := make([]ocabci.ValidatorUpdate, cnt) for i := 0; i < cnt; i++ { res[i] = RandVal(i) } @@ -57,7 +57,7 @@ func RandVals(cnt int) []types.ValidatorUpdate { // which allows tests to pass and is fine as long as you // don't make any tx that modify the validator state func InitKVStore(app *PersistentKVStoreApplication) { - app.InitChain(types.RequestInitChain{ + app.InitChain(ocabci.RequestInitChain{ Validators: RandVals(1), }) } diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 4e9a93665..5a3cc1e74 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -6,11 +6,11 @@ import ( "encoding/json" "fmt" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/version" ) @@ -62,10 +62,10 @@ func prefixKey(key []byte) []byte { //--------------------------------------------------- -var _ abci.Application = (*Application)(nil) +var _ ocabci.Application = (*Application)(nil) type Application struct { - abci.BaseApplication + ocabci.BaseApplication state State RetainBlocks int64 // blocks to retain after commit (via ResponseCommit.RetainHeight) @@ -76,8 +76,8 @@ func NewApplication() *Application { return &Application{state: state} } -func (app *Application) Info(req tmabci.RequestInfo) (resInfo tmabci.ResponseInfo) { - return tmabci.ResponseInfo{ +func (app *Application) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { + return abci.ResponseInfo{ Data: fmt.Sprintf("{\"size\":%v}", app.state.Size), Version: version.ABCIVersion, AppVersion: ProtocolVersion, @@ -87,7 +87,7 @@ func (app *Application) Info(req tmabci.RequestInfo) (resInfo tmabci.ResponseInf } // tx is either "key=value" or just arbitrary bytes -func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { +func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { var key, value []byte parts := bytes.Split(req.Tx, []byte("=")) if len(parts) == 2 { @@ -102,10 +102,10 @@ func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDe } app.state.Size++ - events := []tmabci.Event{ + events := []abci.Event{ { Type: "app", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ {Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko"), Index: true}, {Key: []byte("key"), Value: key, Index: true}, {Key: []byte("index_key"), Value: []byte("index is working"), Index: true}, @@ -114,22 +114,22 @@ func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDe }, } - return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events} + return abci.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events} } -func (app *Application) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { +func (app *Application) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { return app.checkTx(req) } -func (app *Application) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { +func (app *Application) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *Application) checkTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { - return abci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} +func (app *Application) checkTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { + return ocabci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} } -func (app *Application) Commit() tmabci.ResponseCommit { +func (app *Application) Commit() abci.ResponseCommit { // Using a memdb - just return the big endian size of the db appHash := make([]byte, 8) binary.PutVarint(appHash, app.state.Size) @@ -137,7 +137,7 @@ func (app *Application) Commit() tmabci.ResponseCommit { app.state.Height++ saveState(app.state) - resp := tmabci.ResponseCommit{Data: appHash} + resp := abci.ResponseCommit{Data: appHash} if app.RetainBlocks > 0 && app.state.Height >= app.RetainBlocks { resp.RetainHeight = app.state.Height - app.RetainBlocks + 1 } @@ -145,7 +145,7 @@ func (app *Application) Commit() tmabci.ResponseCommit { } // Returns an associated value or nil if missing. -func (app *Application) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { +func (app *Application) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { if reqQuery.Prove { value, err := app.state.db.Get(prefixKey(reqQuery.Data)) if err != nil { diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 8b4242afb..1aef271a1 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -9,12 +9,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/code" abciserver "github.com/line/ostracon/abci/server" - "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/service" ocproto "github.com/line/ostracon/proto/ostracon/types" @@ -25,8 +25,8 @@ const ( testValue = "def" ) -func testKVStore(t *testing.T, app types.Application, tx []byte, key, value string) { - req := tmabci.RequestDeliverTx{Tx: tx} +func testKVStore(t *testing.T, app ocabci.Application, tx []byte, key, value string) { + req := abci.RequestDeliverTx{Tx: tx} ar := app.DeliverTx(req) require.False(t, ar.IsErr(), ar) // repeating tx doesn't raise error @@ -35,11 +35,11 @@ func testKVStore(t *testing.T, app types.Application, tx []byte, key, value stri // commit app.Commit() - info := app.Info(tmabci.RequestInfo{}) + info := app.Info(abci.RequestInfo{}) require.NotZero(t, info.LastBlockHeight) // make sure query is fine - resQuery := app.Query(tmabci.RequestQuery{ + resQuery := app.Query(abci.RequestQuery{ Path: "/store", Data: []byte(key), }) @@ -49,7 +49,7 @@ func testKVStore(t *testing.T, app types.Application, tx []byte, key, value stri require.EqualValues(t, info.LastBlockHeight, resQuery.Height) // make sure proof is fine - resQuery = app.Query(tmabci.RequestQuery{ + resQuery = app.Query(abci.RequestQuery{ Path: "/store", Data: []byte(key), Prove: true, @@ -97,7 +97,7 @@ func TestPersistentKVStoreInfo(t *testing.T) { InitKVStore(kvstore) height := int64(0) - resInfo := kvstore.Info(tmabci.RequestInfo{}) + resInfo := kvstore.Info(abci.RequestInfo{}) if resInfo.LastBlockHeight != height { t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } @@ -108,11 +108,11 @@ func TestPersistentKVStoreInfo(t *testing.T) { header := ocproto.Header{ Height: height, } - kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header}) - kvstore.EndBlock(tmabci.RequestEndBlock{Height: header.Height}) + kvstore.BeginBlock(ocabci.RequestBeginBlock{Hash: hash, Header: header}) + kvstore.EndBlock(abci.RequestEndBlock{Height: header.Height}) kvstore.Commit() - resInfo = kvstore.Info(tmabci.RequestInfo{}) + resInfo = kvstore.Info(abci.RequestInfo{}) if resInfo.LastBlockHeight != height { t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } @@ -132,18 +132,18 @@ func TestValUpdates(t *testing.T) { nInit := 5 vals := RandVals(total) // initialize with the first nInit - kvstore.InitChain(types.RequestInitChain{ + kvstore.InitChain(ocabci.RequestInitChain{ Validators: vals[:nInit], }) vals1, vals2 := vals[:nInit], kvstore.Validators() valsEqual(t, vals1, vals2) - var v1, v2, v3 types.ValidatorUpdate + var v1, v2, v3 ocabci.ValidatorUpdate // add some validators v1, v2 = vals[nInit], vals[nInit+1] - diff := []types.ValidatorUpdate{v1, v2} + diff := []ocabci.ValidatorUpdate{v1, v2} tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power) @@ -157,7 +157,7 @@ func TestValUpdates(t *testing.T) { v1.Power = 0 v2.Power = 0 v3.Power = 0 - diff = []types.ValidatorUpdate{v1, v2, v3} + diff = []ocabci.ValidatorUpdate{v1, v2, v3} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power) tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power) @@ -175,12 +175,12 @@ func TestValUpdates(t *testing.T) { } else { v1.Power = 5 } - diff = []types.ValidatorUpdate{v1} + diff = []ocabci.ValidatorUpdate{v1} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) makeApplyBlock(t, kvstore, 3, diff, tx1) - vals1 = append([]types.ValidatorUpdate{v1}, vals1[1:]...) + vals1 = append([]ocabci.ValidatorUpdate{v1}, vals1[1:]...) vals2 = kvstore.Validators() valsEqual(t, vals1, vals2) @@ -191,9 +191,9 @@ func TestValUpdates(t *testing.T) { func makeApplyBlock( t *testing.T, - kvstore types.Application, + kvstore ocabci.Application, heightInt int, - diff []types.ValidatorUpdate, + diff []ocabci.ValidatorUpdate, txs ...[]byte) { // make and apply block height := int64(heightInt) @@ -202,47 +202,47 @@ func makeApplyBlock( Height: height, } - kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header}) + kvstore.BeginBlock(ocabci.RequestBeginBlock{Hash: hash, Header: header}) for _, tx := range txs { - if r := kvstore.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}); r.IsErr() { + if r := kvstore.DeliverTx(abci.RequestDeliverTx{Tx: tx}); r.IsErr() { t.Fatal(r) } } - resEndBlock := kvstore.EndBlock(tmabci.RequestEndBlock{Height: header.Height}) + resEndBlock := kvstore.EndBlock(abci.RequestEndBlock{Height: header.Height}) kvstore.Commit() valsEqual(t, diff, resEndBlock.ValidatorUpdates) } -func existInPersistStore(t *testing.T, kvstore types.Application, v types.ValidatorUpdate) { +func existInPersistStore(t *testing.T, kvstore ocabci.Application, v ocabci.ValidatorUpdate) { // success pubkeyStr, _ := MakeValSetChangeTxAndMore(v.PubKey, v.Power) - resQuery := kvstore.Query(tmabci.RequestQuery{Path: "/val", Data: []byte(pubkeyStr)}) + resQuery := kvstore.Query(abci.RequestQuery{Path: "/val", Data: []byte(pubkeyStr)}) assert.False(t, resQuery.IsErr(), resQuery) assert.Equal(t, "", resQuery.Log) // failures { // default Query: does not exist - r := kvstore.Query(tmabci.RequestQuery{Path: "/val_", Data: []byte(pubkeyStr)}) + r := kvstore.Query(abci.RequestQuery{Path: "/val_", Data: []byte(pubkeyStr)}) assert.False(t, r.IsErr(), r) assert.Contains(t, r.Log, "does not exist") } { // Query: does not exist - r := kvstore.Query(tmabci.RequestQuery{Path: "/val", Data: []byte{}}) + r := kvstore.Query(abci.RequestQuery{Path: "/val", Data: []byte{}}) assert.False(t, r.IsErr(), r) assert.Equal(t, "", resQuery.Log) } } // order doesn't matter -func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) { +func valsEqual(t *testing.T, vals1, vals2 []ocabci.ValidatorUpdate) { if len(vals1) != len(vals2) { t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1)) } - sort.Sort(types.ValidatorUpdates(vals1)) - sort.Sort(types.ValidatorUpdates(vals2)) + sort.Sort(ocabci.ValidatorUpdates(vals1)) + sort.Sort(ocabci.ValidatorUpdates(vals2)) for i, v1 := range vals1 { v2 := vals2[i] if !v1.PubKey.Equal(v2.PubKey) || @@ -252,7 +252,7 @@ func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) { } } -func makeSocketClientServer(app types.Application, name string) (abcicli.Client, service.Service, error) { +func makeSocketClientServer(app ocabci.Application, name string) (abcicli.Client, service.Service, error) { // Start the listener socket := fmt.Sprintf("unix://%s.sock", name) logger := log.TestingLogger() @@ -276,12 +276,12 @@ func makeSocketClientServer(app types.Application, name string) (abcicli.Client, return client, server, nil } -func makeGRPCClientServer(app types.Application, name string) (abcicli.Client, service.Service, error) { +func makeGRPCClientServer(app ocabci.Application, name string) (abcicli.Client, service.Service, error) { // Start the listener socket := fmt.Sprintf("unix://%s.sock", name) logger := log.TestingLogger() - gapp := types.NewGRPCApplication(app) + gapp := ocabci.NewGRPCApplication(app) server := abciserver.NewGRPCServer(socket, gapp) server.SetLogger(logger.With("module", "abci-server")) if err := server.Start(); err != nil { @@ -349,23 +349,23 @@ func runClientTests(t *testing.T, client abcicli.Client) { } func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) { - ar, err := app.DeliverTxSync(tmabci.RequestDeliverTx{Tx: tx}) + ar, err := app.DeliverTxSync(abci.RequestDeliverTx{Tx: tx}) require.NoError(t, err) require.False(t, ar.IsErr(), ar) // repeating tx doesn't raise error - ar, err = app.DeliverTxSync(tmabci.RequestDeliverTx{Tx: tx}) + ar, err = app.DeliverTxSync(abci.RequestDeliverTx{Tx: tx}) require.NoError(t, err) require.False(t, ar.IsErr(), ar) // commit _, err = app.CommitSync() require.NoError(t, err) - info, err := app.InfoSync(tmabci.RequestInfo{}) + info, err := app.InfoSync(abci.RequestInfo{}) require.NoError(t, err) require.NotZero(t, info.LastBlockHeight) // make sure query is fine - resQuery, err := app.QuerySync(tmabci.RequestQuery{ + resQuery, err := app.QuerySync(abci.RequestQuery{ Path: "/store", Data: []byte(key), }) @@ -376,7 +376,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) require.EqualValues(t, info.LastBlockHeight, resQuery.Height) // make sure proof is fine - resQuery, err = app.QuerySync(tmabci.RequestQuery{ + resQuery, err = app.QuerySync(abci.RequestQuery{ Path: "/store", Data: []byte(key), Prove: true, diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index 9b9f7867b..57759ba05 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -7,11 +7,11 @@ import ( "strconv" "strings" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" - "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/libs/log" pc "github.com/line/ostracon/proto/ostracon/crypto" @@ -23,13 +23,13 @@ const ( //----------------------------------------- -var _ types.Application = (*PersistentKVStoreApplication)(nil) +var _ ocabci.Application = (*PersistentKVStoreApplication)(nil) type PersistentKVStoreApplication struct { app *Application // validator set - ValUpdates []types.ValidatorUpdate + ValUpdates []ocabci.ValidatorUpdate valAddrToPubKeyMap map[string]pc.PublicKey @@ -56,19 +56,19 @@ func (app *PersistentKVStoreApplication) SetLogger(l log.Logger) { app.logger = l } -func (app *PersistentKVStoreApplication) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { +func (app *PersistentKVStoreApplication) Info(req abci.RequestInfo) abci.ResponseInfo { res := app.app.Info(req) res.LastBlockHeight = app.app.state.Height res.LastBlockAppHash = app.app.state.AppHash return res } -func (app *PersistentKVStoreApplication) SetOption(req tmabci.RequestSetOption) tmabci.ResponseSetOption { +func (app *PersistentKVStoreApplication) SetOption(req abci.RequestSetOption) abci.ResponseSetOption { return app.app.SetOption(req) } // tx is either "val:pubkey!power" or "key=value" or just arbitrary bytes -func (app *PersistentKVStoreApplication) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { // if it starts with "val:", update the validator set // format is "val:pubkey!power" if isValidatorTx(req.Tx) { @@ -81,30 +81,30 @@ func (app *PersistentKVStoreApplication) DeliverTx(req tmabci.RequestDeliverTx) return app.app.DeliverTx(req) } -func (app *PersistentKVStoreApplication) CheckTxSync(req tmabci.RequestCheckTx) types.ResponseCheckTx { +func (app *PersistentKVStoreApplication) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { return app.app.CheckTxSync(req) } -func (app *PersistentKVStoreApplication) CheckTxAsync(req tmabci.RequestCheckTx, callback types.CheckTxCallback) { +func (app *PersistentKVStoreApplication) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { app.app.CheckTxAsync(req, callback) } -func (app *PersistentKVStoreApplication) BeginRecheckTx(req types.RequestBeginRecheckTx) types.ResponseBeginRecheckTx { +func (app *PersistentKVStoreApplication) BeginRecheckTx(req ocabci.RequestBeginRecheckTx) ocabci.ResponseBeginRecheckTx { return app.app.BeginRecheckTx(req) } -func (app *PersistentKVStoreApplication) EndRecheckTx(req types.RequestEndRecheckTx) types.ResponseEndRecheckTx { +func (app *PersistentKVStoreApplication) EndRecheckTx(req ocabci.RequestEndRecheckTx) ocabci.ResponseEndRecheckTx { return app.app.EndRecheckTx(req) } // Commit will panic if InitChain was not called -func (app *PersistentKVStoreApplication) Commit() tmabci.ResponseCommit { +func (app *PersistentKVStoreApplication) Commit() abci.ResponseCommit { return app.app.Commit() } -// When path=/val and data={validator address}, returns the validator update (types.ValidatorUpdate) varint encoded. +// When path=/val and data={validator address}, returns the validator update (abci.ValidatorUpdate) varint encoded. // For any other path, returns an associated value or nil if missing. -func (app *PersistentKVStoreApplication) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { +func (app *PersistentKVStoreApplication) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { switch reqQuery.Path { case "/val": key := []byte("val:" + string(reqQuery.Data)) @@ -122,27 +122,27 @@ func (app *PersistentKVStoreApplication) Query(reqQuery tmabci.RequestQuery) (re } // Save the validators in the merkle tree -func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain { +func (app *PersistentKVStoreApplication) InitChain(req ocabci.RequestInitChain) ocabci.ResponseInitChain { for _, v := range req.Validators { r := app.updateValidator(v) if r.IsErr() { app.logger.Error("Error updating validators", "r", r) } } - return types.ResponseInitChain{} + return ocabci.ResponseInitChain{} } // Track the block hash and header information -func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) tmabci.ResponseBeginBlock { +func (app *PersistentKVStoreApplication) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { // reset valset changes - app.ValUpdates = make([]types.ValidatorUpdate, 0) + app.ValUpdates = make([]ocabci.ValidatorUpdate, 0) // Punish validators who committed equivocation. for _, ev := range req.ByzantineValidators { - if ev.Type == tmabci.EvidenceType_DUPLICATE_VOTE { + if ev.Type == abci.EvidenceType_DUPLICATE_VOTE { addr := string(ev.Validator.Address) if pubKey, ok := app.valAddrToPubKeyMap[addr]; ok { - app.updateValidator(types.ValidatorUpdate{ + app.updateValidator(ocabci.ValidatorUpdate{ PubKey: pubKey, Power: ev.Validator.Power - 1, }) @@ -155,46 +155,46 @@ func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) } } - return tmabci.ResponseBeginBlock{} + return abci.ResponseBeginBlock{} } // Update the validator set -func (app *PersistentKVStoreApplication) EndBlock(req tmabci.RequestEndBlock) types.ResponseEndBlock { - return types.ResponseEndBlock{ValidatorUpdates: app.ValUpdates} +func (app *PersistentKVStoreApplication) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { + return ocabci.ResponseEndBlock{ValidatorUpdates: app.ValUpdates} } func (app *PersistentKVStoreApplication) ListSnapshots( - req tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { - return tmabci.ResponseListSnapshots{} + req abci.RequestListSnapshots) abci.ResponseListSnapshots { + return abci.ResponseListSnapshots{} } func (app *PersistentKVStoreApplication) LoadSnapshotChunk( - req tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { - return tmabci.ResponseLoadSnapshotChunk{} + req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { + return abci.ResponseLoadSnapshotChunk{} } func (app *PersistentKVStoreApplication) OfferSnapshot( - req tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { - return tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ABORT} + req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT} } func (app *PersistentKVStoreApplication) ApplySnapshotChunk( - req tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { - return tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ABORT} + req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { + return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ABORT} } //--------------------------------------------- // update validators -func (app *PersistentKVStoreApplication) Validators() (validators []types.ValidatorUpdate) { +func (app *PersistentKVStoreApplication) Validators() (validators []ocabci.ValidatorUpdate) { itr, err := app.app.state.db.Iterator(nil, nil) if err != nil { panic(err) } for ; itr.Valid(); itr.Next() { if isValidatorTx(itr.Key()) { - validator := new(types.ValidatorUpdate) - err := types.ReadMessage(bytes.NewBuffer(itr.Value()), validator) + validator := new(ocabci.ValidatorUpdate) + err := ocabci.ReadMessage(bytes.NewBuffer(itr.Value()), validator) if err != nil { panic(err) } @@ -228,13 +228,13 @@ func isValidatorTx(tx []byte) bool { // format is "val:pubkey!power" // pubkey is a base64-encoded proto.ostracon.crypto.PublicKey bytes // See MakeValSetChangeTx -func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) tmabci.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) abci.ResponseDeliverTx { tx = tx[len(ValidatorSetChangePrefix):] // get the pubkey and power pubKeyAndPower := strings.Split(string(tx), "!") if len(pubKeyAndPower) != 2 { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Expected 'pubkey!power'. Got %v", pubKeyAndPower)} } @@ -243,20 +243,20 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) tmabci.Respo // decode the pubkey pkBytes, err := base64.StdEncoding.DecodeString(pubkeyS) if err != nil { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pubkeyS (%s) is invalid base64", pubkeyS)} } var pkProto pc.PublicKey err = pkProto.Unmarshal(pkBytes) if err != nil { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pkBytes (%x) is invalid binary", pkBytes)} } pubkey, err := cryptoenc.PubKeyFromProto(&pkProto) if err != nil { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pkProto (%s) is invalid binary", pkProto)} } @@ -264,21 +264,21 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) tmabci.Respo // decode the power power, err := strconv.ParseInt(powerS, 10, 64) if err != nil { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Power (%s) is not an int", powerS)} } // update - return app.updateValidator(types.NewValidatorUpdate(pubkey, power)) + return app.updateValidator(ocabci.NewValidatorUpdate(pubkey, power)) } // add, update, or remove a validator // See MakeValSetChangeTx -func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate) tmabci.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) updateValidator(v ocabci.ValidatorUpdate) abci.ResponseDeliverTx { pubkey, err := cryptoenc.PubKeyFromProto(&v.PubKey) if err != nil { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding Public Key: %s", err)} } @@ -292,7 +292,7 @@ func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate panic(err) } if !hasKey { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeUnauthorized, Log: fmt.Sprintf("Cannot remove non-existent validator %s", pubStr)} } @@ -303,8 +303,8 @@ func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate } else { // add or update validator value := bytes.NewBuffer(make([]byte, 0)) - if err := tmabci.WriteMessage(&v, value); err != nil { - return tmabci.ResponseDeliverTx{ + if err := abci.WriteMessage(&v, value); err != nil { + return abci.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding validator: %v", err)} } @@ -317,5 +317,5 @@ func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate // we only update the changes array if we successfully updated the tree app.ValUpdates = append(app.ValUpdates, v) - return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} + return abci.ResponseDeliverTx{Code: code.CodeTypeOK} } diff --git a/abci/server/grpc_server.go b/abci/server/grpc_server.go index 162c44c45..9ec5c5133 100644 --- a/abci/server/grpc_server.go +++ b/abci/server/grpc_server.go @@ -5,7 +5,7 @@ import ( "google.golang.org/grpc" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" ) @@ -18,11 +18,11 @@ type GRPCServer struct { listener net.Listener server *grpc.Server - app abci.ABCIApplicationServer + app ocabci.ABCIApplicationServer } // NewGRPCServer returns a new gRPC ABCI server -func NewGRPCServer(protoAddr string, app abci.ABCIApplicationServer) service.Service { +func NewGRPCServer(protoAddr string, app ocabci.ABCIApplicationServer) service.Service { proto, addr := tmnet.ProtocolAndAddress(protoAddr) s := &GRPCServer{ proto: proto, @@ -44,7 +44,7 @@ func (s *GRPCServer) OnStart() error { s.listener = ln s.server = grpc.NewServer() - abci.RegisterABCIApplicationServer(s.server, s.app) + ocabci.RegisterABCIApplicationServer(s.server, s.app) s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr) go func() { diff --git a/abci/server/server.go b/abci/server/server.go index 2f8e897f3..708898b4e 100644 --- a/abci/server/server.go +++ b/abci/server/server.go @@ -11,18 +11,18 @@ package server import ( "fmt" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" ) -func NewServer(protoAddr, transport string, app abci.Application) (service.Service, error) { +func NewServer(protoAddr, transport string, app ocabci.Application) (service.Service, error) { var s service.Service var err error switch transport { case "socket": s = NewSocketServer(protoAddr, app) case "grpc": - s = NewGRPCServer(protoAddr, abci.NewGRPCApplication(app)) + s = NewGRPCServer(protoAddr, ocabci.NewGRPCApplication(app)) default: err = fmt.Errorf("unknown server type %s", transport) } diff --git a/abci/server/socket_server.go b/abci/server/socket_server.go index d3c6f8ed9..4e322dc1c 100644 --- a/abci/server/socket_server.go +++ b/abci/server/socket_server.go @@ -8,7 +8,7 @@ import ( "os" "runtime" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmlog "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" @@ -30,10 +30,10 @@ type SocketServer struct { nextConnID int appMtx tmsync.Mutex - app abci.Application + app ocabci.Application } -func NewSocketServer(protoAddr string, app abci.Application) service.Service { +func NewSocketServer(protoAddr string, app ocabci.Application) service.Service { proto, addr := tmnet.ProtocolAndAddress(protoAddr) s := &SocketServer{ proto: proto, @@ -120,8 +120,8 @@ func (s *SocketServer) acceptConnectionsRoutine() { connID := s.addConn(conn) - closeConn := make(chan error, 2) // Push to signal connection closed - responses := make(chan *abci.Response, 1000) // A channel to buffer responses + closeConn := make(chan error, 2) // Push to signal connection closed + responses := make(chan *ocabci.Response, 1000) // A channel to buffer responses // Read requests from conn and deal with them go s.handleRequests(closeConn, conn, responses) @@ -152,7 +152,7 @@ func (s *SocketServer) waitForClose(closeConn chan error, connID int) { } // Read requests from conn and deal with them -func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *abci.Response) { +func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *ocabci.Response) { var count int var bufReader = bufio.NewReader(conn) @@ -174,8 +174,8 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp for { - var req = &abci.Request{} - err := abci.ReadMessage(bufReader, req) + var req = &ocabci.Request{} + err := ocabci.ReadMessage(bufReader, req) if err != nil { if err == io.EOF { closeConn <- err @@ -191,74 +191,74 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp } } -func (s *SocketServer) handleRequest(req *abci.Request, responses chan<- *abci.Response) { +func (s *SocketServer) handleRequest(req *ocabci.Request, responses chan<- *ocabci.Response) { switch r := req.Value.(type) { - case *abci.Request_Echo: - responses <- abci.ToResponseEcho(r.Echo.Message) - case *abci.Request_Flush: - responses <- abci.ToResponseFlush() - case *abci.Request_Info: + case *ocabci.Request_Echo: + responses <- ocabci.ToResponseEcho(r.Echo.Message) + case *ocabci.Request_Flush: + responses <- ocabci.ToResponseFlush() + case *ocabci.Request_Info: res := s.app.Info(*r.Info) - responses <- abci.ToResponseInfo(res) - case *abci.Request_SetOption: + responses <- ocabci.ToResponseInfo(res) + case *ocabci.Request_SetOption: res := s.app.SetOption(*r.SetOption) - responses <- abci.ToResponseSetOption(res) - case *abci.Request_DeliverTx: + responses <- ocabci.ToResponseSetOption(res) + case *ocabci.Request_DeliverTx: res := s.app.DeliverTx(*r.DeliverTx) - responses <- abci.ToResponseDeliverTx(res) - case *abci.Request_CheckTx: + responses <- ocabci.ToResponseDeliverTx(res) + case *ocabci.Request_CheckTx: res := s.app.CheckTxSync(*r.CheckTx) - responses <- abci.ToResponseCheckTx(res) - case *abci.Request_Commit: + responses <- ocabci.ToResponseCheckTx(res) + case *ocabci.Request_Commit: res := s.app.Commit() - responses <- abci.ToResponseCommit(res) - case *abci.Request_Query: + responses <- ocabci.ToResponseCommit(res) + case *ocabci.Request_Query: res := s.app.Query(*r.Query) - responses <- abci.ToResponseQuery(res) - case *abci.Request_InitChain: + responses <- ocabci.ToResponseQuery(res) + case *ocabci.Request_InitChain: res := s.app.InitChain(*r.InitChain) - responses <- abci.ToResponseInitChain(res) - case *abci.Request_BeginBlock: + responses <- ocabci.ToResponseInitChain(res) + case *ocabci.Request_BeginBlock: res := s.app.BeginBlock(*r.BeginBlock) - responses <- abci.ToResponseBeginBlock(res) - case *abci.Request_EndBlock: + responses <- ocabci.ToResponseBeginBlock(res) + case *ocabci.Request_EndBlock: res := s.app.EndBlock(*r.EndBlock) - responses <- abci.ToResponseEndBlock(res) - case *abci.Request_BeginRecheckTx: + responses <- ocabci.ToResponseEndBlock(res) + case *ocabci.Request_BeginRecheckTx: res := s.app.BeginRecheckTx(*r.BeginRecheckTx) - responses <- abci.ToResponseBeginRecheckTx(res) - case *abci.Request_EndRecheckTx: + responses <- ocabci.ToResponseBeginRecheckTx(res) + case *ocabci.Request_EndRecheckTx: res := s.app.EndRecheckTx(*r.EndRecheckTx) - responses <- abci.ToResponseEndRecheckTx(res) - case *abci.Request_ListSnapshots: + responses <- ocabci.ToResponseEndRecheckTx(res) + case *ocabci.Request_ListSnapshots: res := s.app.ListSnapshots(*r.ListSnapshots) - responses <- abci.ToResponseListSnapshots(res) - case *abci.Request_OfferSnapshot: + responses <- ocabci.ToResponseListSnapshots(res) + case *ocabci.Request_OfferSnapshot: res := s.app.OfferSnapshot(*r.OfferSnapshot) - responses <- abci.ToResponseOfferSnapshot(res) - case *abci.Request_LoadSnapshotChunk: + responses <- ocabci.ToResponseOfferSnapshot(res) + case *ocabci.Request_LoadSnapshotChunk: res := s.app.LoadSnapshotChunk(*r.LoadSnapshotChunk) - responses <- abci.ToResponseLoadSnapshotChunk(res) - case *abci.Request_ApplySnapshotChunk: + responses <- ocabci.ToResponseLoadSnapshotChunk(res) + case *ocabci.Request_ApplySnapshotChunk: res := s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk) - responses <- abci.ToResponseApplySnapshotChunk(res) + responses <- ocabci.ToResponseApplySnapshotChunk(res) default: - responses <- abci.ToResponseException("Unknown request") + responses <- ocabci.ToResponseException("Unknown request") } } // Pull responses from 'responses' and write them to conn. -func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *abci.Response) { +func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *ocabci.Response) { var count int var bufWriter = bufio.NewWriter(conn) for { var res = <-responses - err := abci.WriteMessage(res, bufWriter) + err := ocabci.WriteMessage(res, bufWriter) if err != nil { closeConn <- fmt.Errorf("error writing message: %w", err) return } - if _, ok := res.Value.(*abci.Response_Flush); ok { + if _, ok := res.Value.(*ocabci.Response_Flush); ok { err = bufWriter.Flush() if err != nil { closeConn <- fmt.Errorf("error flushing write buffer: %w", err) diff --git a/abci/tests/benchmarks/parallel/parallel.go b/abci/tests/benchmarks/parallel/parallel.go index 2c3bc24aa..40a37d80f 100644 --- a/abci/tests/benchmarks/parallel/parallel.go +++ b/abci/tests/benchmarks/parallel/parallel.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" ) @@ -20,8 +20,8 @@ func main() { go func() { counter := 0 for { - var res = &types.Response{} - err := types.ReadMessage(conn, res) + var res = &ocabci.Response{} + err := ocabci.ReadMessage(conn, res) if err != nil { log.Fatal(err.Error()) } @@ -36,9 +36,9 @@ func main() { counter := 0 for i := 0; ; i++ { var bufWriter = bufio.NewWriter(conn) - var req = types.ToRequestEcho("foobar") + var req = ocabci.ToRequestEcho("foobar") - err := types.WriteMessage(req, bufWriter) + err := ocabci.WriteMessage(req, bufWriter) if err != nil { log.Fatal(err.Error()) } diff --git a/abci/tests/benchmarks/simple/simple.go b/abci/tests/benchmarks/simple/simple.go index cc9751900..d31806df2 100644 --- a/abci/tests/benchmarks/simple/simple.go +++ b/abci/tests/benchmarks/simple/simple.go @@ -7,7 +7,7 @@ import ( "log" "reflect" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" ) @@ -21,7 +21,7 @@ func main() { // Make a bunch of requests counter := 0 for i := 0; ; i++ { - req := types.ToRequestEcho("foobar") + req := ocabci.ToRequestEcho("foobar") _, err := makeRequest(conn, req) if err != nil { log.Fatal(err.Error()) @@ -33,15 +33,15 @@ func main() { } } -func makeRequest(conn io.ReadWriter, req *types.Request) (*types.Response, error) { +func makeRequest(conn io.ReadWriter, req *ocabci.Request) (*ocabci.Response, error) { var bufWriter = bufio.NewWriter(conn) // Write desired request - err := types.WriteMessage(req, bufWriter) + err := ocabci.WriteMessage(req, bufWriter) if err != nil { return nil, err } - err = types.WriteMessage(types.ToRequestFlush(), bufWriter) + err = ocabci.WriteMessage(ocabci.ToRequestFlush(), bufWriter) if err != nil { return nil, err } @@ -51,17 +51,17 @@ func makeRequest(conn io.ReadWriter, req *types.Request) (*types.Response, error } // Read desired response - var res = &types.Response{} - err = types.ReadMessage(conn, res) + var res = &ocabci.Response{} + err = ocabci.ReadMessage(conn, res) if err != nil { return nil, err } - var resFlush = &types.Response{} - err = types.ReadMessage(conn, resFlush) + var resFlush = &ocabci.Response{} + err = ocabci.ReadMessage(conn, resFlush) if err != nil { return nil, err } - if _, ok := resFlush.Value.(*types.Response_Flush); !ok { + if _, ok := resFlush.Value.(*ocabci.Response_Flush); !ok { return nil, fmt.Errorf("expected flush response but got something else: %v", reflect.TypeOf(resFlush)) } diff --git a/abci/tests/server/client.go b/abci/tests/server/client.go index 96bb5d50e..a68dbfdf6 100644 --- a/abci/tests/server/client.go +++ b/abci/tests/server/client.go @@ -5,23 +5,23 @@ import ( "errors" "fmt" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmrand "github.com/line/ostracon/libs/rand" ) func InitChain(client abcicli.Client) error { total := 10 - vals := make([]types.ValidatorUpdate, total) + vals := make([]ocabci.ValidatorUpdate, total) for i := 0; i < total; i++ { pubkey := kvstore.GenDefaultPrivKey().PubKey() power := tmrand.Int() - vals[i] = types.NewValidatorUpdate(pubkey, int64(power)) + vals[i] = ocabci.NewValidatorUpdate(pubkey, int64(power)) } - _, err := client.InitChainSync(types.RequestInitChain{ + _, err := client.InitChainSync(ocabci.RequestInitChain{ Validators: vals, }) if err != nil { @@ -33,7 +33,7 @@ func InitChain(client abcicli.Client) error { } func SetOption(client abcicli.Client, key, value string) error { - _, err := client.SetOptionSync(tmabci.RequestSetOption{Key: key, Value: value}) + _, err := client.SetOptionSync(abci.RequestSetOption{Key: key, Value: value}) if err != nil { fmt.Println("Failed test: SetOption") fmt.Printf("error while setting %v=%v: \nerror: %v\n", key, value, err) @@ -61,7 +61,7 @@ func Commit(client abcicli.Client, hashExp []byte) error { } func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { - res, _ := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) + res, _ := client.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: DeliverTx") @@ -80,7 +80,7 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp [] } func CheckTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { - res, _ := client.CheckTxSync(tmabci.RequestCheckTx{Tx: txBytes}) + res, _ := client.CheckTxSync(abci.RequestCheckTx{Tx: txBytes}) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: CheckTx") diff --git a/abci/tests/test_app/app.go b/abci/tests/test_app/app.go index a1bbb2111..d38d447dc 100644 --- a/abci/tests/test_app/app.go +++ b/abci/tests/test_app/app.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/libs/log" @@ -27,7 +27,7 @@ func startClient(abciType string) abcicli.Client { } func setOption(client abcicli.Client, key, value string) { - _, err := client.SetOptionSync(tmabci.RequestSetOption{Key: key, Value: value}) + _, err := client.SetOptionSync(abci.RequestSetOption{Key: key, Value: value}) if err != nil { panicf("setting %v=%v: \nerr: %v", key, value, err) } @@ -44,7 +44,7 @@ func commit(client abcicli.Client, hashExp []byte) { } func deliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) { - res, err := client.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) + res, err := client.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) if err != nil { panicf("client error: %v", err) } diff --git a/abci/tests/test_app/main.go b/abci/tests/test_app/main.go index f49d16cc1..da5669c57 100644 --- a/abci/tests/test_app/main.go +++ b/abci/tests/test_app/main.go @@ -8,7 +8,7 @@ import ( "time" "github.com/line/ostracon/abci/example/code" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" ) var abciType string @@ -83,13 +83,13 @@ func testCounter() { commit(client, nil) deliverTx(client, []byte("abc"), code.CodeTypeBadNonce, nil) commit(client, nil) - deliverTx(client, []byte{0x00}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00}, ocabci.CodeTypeOK, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) deliverTx(client, []byte{0x00}, code.CodeTypeBadNonce, nil) - deliverTx(client, []byte{0x01}, types.CodeTypeOK, nil) - deliverTx(client, []byte{0x00, 0x02}, types.CodeTypeOK, nil) - deliverTx(client, []byte{0x00, 0x03}, types.CodeTypeOK, nil) - deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x01}, ocabci.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x02}, ocabci.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x03}, ocabci.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x04}, ocabci.CodeTypeOK, nil) deliverTx(client, []byte{0x00, 0x00, 0x06}, code.CodeTypeBadNonce, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) } diff --git a/abci/types/application.go b/abci/types/application.go index c792a9daf..eb1906037 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -3,7 +3,7 @@ package types import ( context "golang.org/x/net/context" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ) //go:generate mockery --case underscore --name Application @@ -16,28 +16,28 @@ type CheckTxCallback func(ResponseCheckTx) // except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing. type Application interface { // Info/Query Connection - Info(tmabci.RequestInfo) tmabci.ResponseInfo // Return application info - SetOption(tmabci.RequestSetOption) tmabci.ResponseSetOption // Set application option - Query(tmabci.RequestQuery) tmabci.ResponseQuery // Query for state + Info(abci.RequestInfo) abci.ResponseInfo // Return application info + SetOption(abci.RequestSetOption) abci.ResponseSetOption // Set application option + Query(abci.RequestQuery) abci.ResponseQuery // Query for state // Mempool Connection - CheckTxSync(tmabci.RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool - CheckTxAsync(tmabci.RequestCheckTx, CheckTxCallback) // Asynchronously validate a tx for the mempool + CheckTxSync(abci.RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool + CheckTxAsync(abci.RequestCheckTx, CheckTxCallback) // Asynchronously validate a tx for the mempool BeginRecheckTx(RequestBeginRecheckTx) ResponseBeginRecheckTx // Signals the beginning of rechecking EndRecheckTx(RequestEndRecheckTx) ResponseEndRecheckTx // Signals the end of rechecking // Consensus Connection - InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore - BeginBlock(RequestBeginBlock) tmabci.ResponseBeginBlock // Signals the beginning of a block - DeliverTx(tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx // Deliver a tx for full processing - EndBlock(tmabci.RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set - Commit() tmabci.ResponseCommit // Commit the state and return the application Merkle root hash + InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore + BeginBlock(RequestBeginBlock) abci.ResponseBeginBlock // Signals the beginning of a block + DeliverTx(abci.RequestDeliverTx) abci.ResponseDeliverTx // Deliver a tx for full processing + EndBlock(abci.RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set + Commit() abci.ResponseCommit // Commit the state and return the application Merkle root hash // State Sync Connection - ListSnapshots(tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots // List available snapshots - OfferSnapshot(tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot // Offer a snapshot to the application - LoadSnapshotChunk(tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk // Load a snapshot chunk - ApplySnapshotChunk(tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk // Apply a shapshot chunk + ListSnapshots(abci.RequestListSnapshots) abci.ResponseListSnapshots // List available snapshots + OfferSnapshot(abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot // Offer a snapshot to the application + LoadSnapshotChunk(abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk // Load a snapshot chunk + ApplySnapshotChunk(abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk // Apply a shapshot chunk } //------------------------------------------------------- @@ -52,23 +52,23 @@ func NewBaseApplication() *BaseApplication { return &BaseApplication{} } -func (BaseApplication) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { - return tmabci.ResponseInfo{} +func (BaseApplication) Info(req abci.RequestInfo) abci.ResponseInfo { + return abci.ResponseInfo{} } -func (BaseApplication) SetOption(req tmabci.RequestSetOption) tmabci.ResponseSetOption { - return tmabci.ResponseSetOption{} +func (BaseApplication) SetOption(req abci.RequestSetOption) abci.ResponseSetOption { + return abci.ResponseSetOption{} } -func (BaseApplication) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { - return tmabci.ResponseDeliverTx{Code: CodeTypeOK} +func (BaseApplication) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { + return abci.ResponseDeliverTx{Code: CodeTypeOK} } -func (BaseApplication) CheckTxSync(req tmabci.RequestCheckTx) ResponseCheckTx { +func (BaseApplication) CheckTxSync(req abci.RequestCheckTx) ResponseCheckTx { return ResponseCheckTx{Code: CodeTypeOK} } -func (BaseApplication) CheckTxAsync(req tmabci.RequestCheckTx, callback CheckTxCallback) { +func (BaseApplication) CheckTxAsync(req abci.RequestCheckTx, callback CheckTxCallback) { callback(ResponseCheckTx{Code: CodeTypeOK}) } @@ -80,40 +80,40 @@ func (BaseApplication) EndRecheckTx(req RequestEndRecheckTx) ResponseEndRecheckT return ResponseEndRecheckTx{Code: CodeTypeOK} } -func (BaseApplication) Commit() tmabci.ResponseCommit { - return tmabci.ResponseCommit{} +func (BaseApplication) Commit() abci.ResponseCommit { + return abci.ResponseCommit{} } -func (BaseApplication) Query(req tmabci.RequestQuery) tmabci.ResponseQuery { - return tmabci.ResponseQuery{Code: CodeTypeOK} +func (BaseApplication) Query(req abci.RequestQuery) abci.ResponseQuery { + return abci.ResponseQuery{Code: CodeTypeOK} } func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { return ResponseInitChain{} } -func (BaseApplication) BeginBlock(req RequestBeginBlock) tmabci.ResponseBeginBlock { - return tmabci.ResponseBeginBlock{} +func (BaseApplication) BeginBlock(req RequestBeginBlock) abci.ResponseBeginBlock { + return abci.ResponseBeginBlock{} } -func (BaseApplication) EndBlock(req tmabci.RequestEndBlock) ResponseEndBlock { +func (BaseApplication) EndBlock(req abci.RequestEndBlock) ResponseEndBlock { return ResponseEndBlock{} } -func (BaseApplication) ListSnapshots(req tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { - return tmabci.ResponseListSnapshots{} +func (BaseApplication) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots { + return abci.ResponseListSnapshots{} } -func (BaseApplication) OfferSnapshot(req tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { - return tmabci.ResponseOfferSnapshot{} +func (BaseApplication) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { + return abci.ResponseOfferSnapshot{} } -func (BaseApplication) LoadSnapshotChunk(req tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { - return tmabci.ResponseLoadSnapshotChunk{} +func (BaseApplication) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { + return abci.ResponseLoadSnapshotChunk{} } -func (BaseApplication) ApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { - return tmabci.ResponseApplySnapshotChunk{} +func (BaseApplication) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { + return abci.ResponseApplySnapshotChunk{} } //------------------------------------------------------- @@ -127,30 +127,30 @@ func NewGRPCApplication(app Application) *GRPCApplication { return &GRPCApplication{app} } -func (app *GRPCApplication) Echo(ctx context.Context, req *tmabci.RequestEcho) (*tmabci.ResponseEcho, error) { - return &tmabci.ResponseEcho{Message: req.Message}, nil +func (app *GRPCApplication) Echo(ctx context.Context, req *abci.RequestEcho) (*abci.ResponseEcho, error) { + return &abci.ResponseEcho{Message: req.Message}, nil } -func (app *GRPCApplication) Flush(ctx context.Context, req *tmabci.RequestFlush) (*tmabci.ResponseFlush, error) { - return &tmabci.ResponseFlush{}, nil +func (app *GRPCApplication) Flush(ctx context.Context, req *abci.RequestFlush) (*abci.ResponseFlush, error) { + return &abci.ResponseFlush{}, nil } -func (app *GRPCApplication) Info(ctx context.Context, req *tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { +func (app *GRPCApplication) Info(ctx context.Context, req *abci.RequestInfo) (*abci.ResponseInfo, error) { res := app.app.Info(*req) return &res, nil } -func (app *GRPCApplication) SetOption(ctx context.Context, req *tmabci.RequestSetOption) (*tmabci.ResponseSetOption, error) { +func (app *GRPCApplication) SetOption(ctx context.Context, req *abci.RequestSetOption) (*abci.ResponseSetOption, error) { res := app.app.SetOption(*req) return &res, nil } -func (app *GRPCApplication) DeliverTx(ctx context.Context, req *tmabci.RequestDeliverTx) (*tmabci.ResponseDeliverTx, error) { +func (app *GRPCApplication) DeliverTx(ctx context.Context, req *abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { res := app.app.DeliverTx(*req) return &res, nil } -func (app *GRPCApplication) CheckTx(ctx context.Context, req *tmabci.RequestCheckTx) (*ResponseCheckTx, error) { +func (app *GRPCApplication) CheckTx(ctx context.Context, req *abci.RequestCheckTx) (*ResponseCheckTx, error) { res := app.app.CheckTxSync(*req) return &res, nil } @@ -166,12 +166,12 @@ func (app *GRPCApplication) EndRecheckTx(ctx context.Context, req *RequestEndRec return &res, nil } -func (app *GRPCApplication) Query(ctx context.Context, req *tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { +func (app *GRPCApplication) Query(ctx context.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) { res := app.app.Query(*req) return &res, nil } -func (app *GRPCApplication) Commit(ctx context.Context, req *tmabci.RequestCommit) (*tmabci.ResponseCommit, error) { +func (app *GRPCApplication) Commit(ctx context.Context, req *abci.RequestCommit) (*abci.ResponseCommit, error) { res := app.app.Commit() return &res, nil } @@ -181,36 +181,36 @@ func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain return &res, nil } -func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { +func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*abci.ResponseBeginBlock, error) { res := app.app.BeginBlock(*req) return &res, nil } -func (app *GRPCApplication) EndBlock(ctx context.Context, req *tmabci.RequestEndBlock) (*ResponseEndBlock, error) { +func (app *GRPCApplication) EndBlock(ctx context.Context, req *abci.RequestEndBlock) (*ResponseEndBlock, error) { res := app.app.EndBlock(*req) return &res, nil } func (app *GRPCApplication) ListSnapshots( - ctx context.Context, req *tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { + ctx context.Context, req *abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { res := app.app.ListSnapshots(*req) return &res, nil } func (app *GRPCApplication) OfferSnapshot( - ctx context.Context, req *tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { + ctx context.Context, req *abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { res := app.app.OfferSnapshot(*req) return &res, nil } func (app *GRPCApplication) LoadSnapshotChunk( - ctx context.Context, req *tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { + ctx context.Context, req *abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { res := app.app.LoadSnapshotChunk(*req) return &res, nil } func (app *GRPCApplication) ApplySnapshotChunk( - ctx context.Context, req *tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { + ctx context.Context, req *abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { res := app.app.ApplySnapshotChunk(*req) return &res, nil } diff --git a/abci/types/messages.go b/abci/types/messages.go index ae0c59400..ff8df7f2e 100644 --- a/abci/types/messages.go +++ b/abci/types/messages.go @@ -7,7 +7,7 @@ import ( "github.com/gogo/protobuf/proto" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ) const ( @@ -73,35 +73,35 @@ func encodeVarint(w io.Writer, i int64) (err error) { func ToRequestEcho(message string) *Request { return &Request{ - Value: &Request_Echo{&tmabci.RequestEcho{Message: message}}, + Value: &Request_Echo{&abci.RequestEcho{Message: message}}, } } func ToRequestFlush() *Request { return &Request{ - Value: &Request_Flush{&tmabci.RequestFlush{}}, + Value: &Request_Flush{&abci.RequestFlush{}}, } } -func ToRequestInfo(req tmabci.RequestInfo) *Request { +func ToRequestInfo(req abci.RequestInfo) *Request { return &Request{ Value: &Request_Info{&req}, } } -func ToRequestSetOption(req tmabci.RequestSetOption) *Request { +func ToRequestSetOption(req abci.RequestSetOption) *Request { return &Request{ Value: &Request_SetOption{&req}, } } -func ToRequestDeliverTx(req tmabci.RequestDeliverTx) *Request { +func ToRequestDeliverTx(req abci.RequestDeliverTx) *Request { return &Request{ Value: &Request_DeliverTx{&req}, } } -func ToRequestCheckTx(req tmabci.RequestCheckTx) *Request { +func ToRequestCheckTx(req abci.RequestCheckTx) *Request { return &Request{ Value: &Request_CheckTx{&req}, } @@ -109,11 +109,11 @@ func ToRequestCheckTx(req tmabci.RequestCheckTx) *Request { func ToRequestCommit() *Request { return &Request{ - Value: &Request_Commit{&tmabci.RequestCommit{}}, + Value: &Request_Commit{&abci.RequestCommit{}}, } } -func ToRequestQuery(req tmabci.RequestQuery) *Request { +func ToRequestQuery(req abci.RequestQuery) *Request { return &Request{ Value: &Request_Query{&req}, } @@ -131,7 +131,7 @@ func ToRequestBeginBlock(req RequestBeginBlock) *Request { } } -func ToRequestEndBlock(req tmabci.RequestEndBlock) *Request { +func ToRequestEndBlock(req abci.RequestEndBlock) *Request { return &Request{ Value: &Request_EndBlock{&req}, } @@ -149,25 +149,25 @@ func ToRequestEndRecheckTx(req RequestEndRecheckTx) *Request { } } -func ToRequestListSnapshots(req tmabci.RequestListSnapshots) *Request { +func ToRequestListSnapshots(req abci.RequestListSnapshots) *Request { return &Request{ Value: &Request_ListSnapshots{&req}, } } -func ToRequestOfferSnapshot(req tmabci.RequestOfferSnapshot) *Request { +func ToRequestOfferSnapshot(req abci.RequestOfferSnapshot) *Request { return &Request{ Value: &Request_OfferSnapshot{&req}, } } -func ToRequestLoadSnapshotChunk(req tmabci.RequestLoadSnapshotChunk) *Request { +func ToRequestLoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) *Request { return &Request{ Value: &Request_LoadSnapshotChunk{&req}, } } -func ToRequestApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) *Request { +func ToRequestApplySnapshotChunk(req abci.RequestApplySnapshotChunk) *Request { return &Request{ Value: &Request_ApplySnapshotChunk{&req}, } @@ -177,35 +177,35 @@ func ToRequestApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) *Request func ToResponseException(errStr string) *Response { return &Response{ - Value: &Response_Exception{&tmabci.ResponseException{Error: errStr}}, + Value: &Response_Exception{&abci.ResponseException{Error: errStr}}, } } func ToResponseEcho(message string) *Response { return &Response{ - Value: &Response_Echo{&tmabci.ResponseEcho{Message: message}}, + Value: &Response_Echo{&abci.ResponseEcho{Message: message}}, } } func ToResponseFlush() *Response { return &Response{ - Value: &Response_Flush{&tmabci.ResponseFlush{}}, + Value: &Response_Flush{&abci.ResponseFlush{}}, } } -func ToResponseInfo(res tmabci.ResponseInfo) *Response { +func ToResponseInfo(res abci.ResponseInfo) *Response { return &Response{ Value: &Response_Info{&res}, } } -func ToResponseSetOption(res tmabci.ResponseSetOption) *Response { +func ToResponseSetOption(res abci.ResponseSetOption) *Response { return &Response{ Value: &Response_SetOption{&res}, } } -func ToResponseDeliverTx(res tmabci.ResponseDeliverTx) *Response { +func ToResponseDeliverTx(res abci.ResponseDeliverTx) *Response { return &Response{ Value: &Response_DeliverTx{&res}, } @@ -217,13 +217,13 @@ func ToResponseCheckTx(res ResponseCheckTx) *Response { } } -func ToResponseCommit(res tmabci.ResponseCommit) *Response { +func ToResponseCommit(res abci.ResponseCommit) *Response { return &Response{ Value: &Response_Commit{&res}, } } -func ToResponseQuery(res tmabci.ResponseQuery) *Response { +func ToResponseQuery(res abci.ResponseQuery) *Response { return &Response{ Value: &Response_Query{&res}, } @@ -235,7 +235,7 @@ func ToResponseInitChain(res ResponseInitChain) *Response { } } -func ToResponseBeginBlock(res tmabci.ResponseBeginBlock) *Response { +func ToResponseBeginBlock(res abci.ResponseBeginBlock) *Response { return &Response{ Value: &Response_BeginBlock{&res}, } @@ -259,25 +259,25 @@ func ToResponseEndRecheckTx(res ResponseEndRecheckTx) *Response { } } -func ToResponseListSnapshots(res tmabci.ResponseListSnapshots) *Response { +func ToResponseListSnapshots(res abci.ResponseListSnapshots) *Response { return &Response{ Value: &Response_ListSnapshots{&res}, } } -func ToResponseOfferSnapshot(res tmabci.ResponseOfferSnapshot) *Response { +func ToResponseOfferSnapshot(res abci.ResponseOfferSnapshot) *Response { return &Response{ Value: &Response_OfferSnapshot{&res}, } } -func ToResponseLoadSnapshotChunk(res tmabci.ResponseLoadSnapshotChunk) *Response { +func ToResponseLoadSnapshotChunk(res abci.ResponseLoadSnapshotChunk) *Response { return &Response{ Value: &Response_LoadSnapshotChunk{&res}, } } -func ToResponseApplySnapshotChunk(res tmabci.ResponseApplySnapshotChunk) *Response { +func ToResponseApplySnapshotChunk(res abci.ResponseApplySnapshotChunk) *Response { return &Response{ Value: &Response_ApplySnapshotChunk{&res}, } diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index ce2c5db61..bc6621f94 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -9,13 +9,13 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ocproto "github.com/line/ostracon/proto/ostracon/types" ) func TestMarshalJSON(t *testing.T) { - b, err := json.Marshal(&tmabci.ResponseDeliverTx{}) + b, err := json.Marshal(&abci.ResponseDeliverTx{}) assert.Nil(t, err) // include empty fields. assert.True(t, strings.Contains(string(b), "code")) @@ -23,10 +23,10 @@ func TestMarshalJSON(t *testing.T) { Code: 1, Data: []byte("hello"), GasWanted: 43, - Events: []tmabci.Event{ + Events: []abci.Event{ { Type: "testEvent", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ {Key: []byte("pho"), Value: []byte("bo")}, }, }, @@ -43,7 +43,7 @@ func TestMarshalJSON(t *testing.T) { func TestWriteReadMessageSimple(t *testing.T) { cases := []proto.Message{ - &tmabci.RequestEcho{ + &abci.RequestEcho{ Message: "Hello", }, } @@ -53,7 +53,7 @@ func TestWriteReadMessageSimple(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(tmabci.RequestEcho) + msg := new(abci.RequestEcho) err = ReadMessage(buf, msg) assert.Nil(t, err) @@ -90,10 +90,10 @@ func TestWriteReadMessage2(t *testing.T) { Data: []byte(phrase), Log: phrase, GasWanted: 10, - Events: []tmabci.Event{ + Events: []abci.Event{ { Type: "testEvent", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ {Key: []byte("abc"), Value: []byte("def")}, }, }, diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index bbbae4e53..ab1227ba8 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -3,9 +3,9 @@ package mocks import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" mock "github.com/stretchr/testify/mock" ) @@ -15,215 +15,215 @@ type Application struct { } // ApplySnapshotChunk provides a mock function with given fields: _a0 -func (_m *Application) ApplySnapshotChunk(_a0 tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { +func (_m *Application) ApplySnapshotChunk(_a0 abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { ret := _m.Called(_a0) - var r0 tmabci.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk); ok { + var r0 abci.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(abci.ResponseApplySnapshotChunk) } return r0 } // BeginBlock provides a mock function with given fields: _a0 -func (_m *Application) BeginBlock(_a0 types.RequestBeginBlock) tmabci.ResponseBeginBlock { +func (_m *Application) BeginBlock(_a0 ocabci.RequestBeginBlock) abci.ResponseBeginBlock { ret := _m.Called(_a0) - var r0 tmabci.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(types.RequestBeginBlock) tmabci.ResponseBeginBlock); ok { + var r0 abci.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) abci.ResponseBeginBlock); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseBeginBlock) + r0 = ret.Get(0).(abci.ResponseBeginBlock) } return r0 } // BeginRecheckTx provides a mock function with given fields: _a0 -func (_m *Application) BeginRecheckTx(_a0 types.RequestBeginRecheckTx) types.ResponseBeginRecheckTx { +func (_m *Application) BeginRecheckTx(_a0 ocabci.RequestBeginRecheckTx) ocabci.ResponseBeginRecheckTx { ret := _m.Called(_a0) - var r0 types.ResponseBeginRecheckTx - if rf, ok := ret.Get(0).(func(types.RequestBeginRecheckTx) types.ResponseBeginRecheckTx); ok { + var r0 ocabci.ResponseBeginRecheckTx + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginRecheckTx) ocabci.ResponseBeginRecheckTx); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseBeginRecheckTx) + r0 = ret.Get(0).(ocabci.ResponseBeginRecheckTx) } return r0 } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Application) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 types.CheckTxCallback) { +func (_m *Application) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 ocabci.CheckTxCallback) { _m.Called(_a0, _a1) } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Application) CheckTxSync(_a0 tmabci.RequestCheckTx) types.ResponseCheckTx { +func (_m *Application) CheckTxSync(_a0 abci.RequestCheckTx) ocabci.ResponseCheckTx { ret := _m.Called(_a0) - var r0 types.ResponseCheckTx - if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx) types.ResponseCheckTx); ok { + var r0 ocabci.ResponseCheckTx + if rf, ok := ret.Get(0).(func(abci.RequestCheckTx) ocabci.ResponseCheckTx); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseCheckTx) + r0 = ret.Get(0).(ocabci.ResponseCheckTx) } return r0 } // Commit provides a mock function with given fields: -func (_m *Application) Commit() tmabci.ResponseCommit { +func (_m *Application) Commit() abci.ResponseCommit { ret := _m.Called() - var r0 tmabci.ResponseCommit - if rf, ok := ret.Get(0).(func() tmabci.ResponseCommit); ok { + var r0 abci.ResponseCommit + if rf, ok := ret.Get(0).(func() abci.ResponseCommit); ok { r0 = rf() } else { - r0 = ret.Get(0).(tmabci.ResponseCommit) + r0 = ret.Get(0).(abci.ResponseCommit) } return r0 } // DeliverTx provides a mock function with given fields: _a0 -func (_m *Application) DeliverTx(_a0 tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { +func (_m *Application) DeliverTx(_a0 abci.RequestDeliverTx) abci.ResponseDeliverTx { ret := _m.Called(_a0) - var r0 tmabci.ResponseDeliverTx - if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx); ok { + var r0 abci.ResponseDeliverTx + if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx) abci.ResponseDeliverTx); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseDeliverTx) + r0 = ret.Get(0).(abci.ResponseDeliverTx) } return r0 } // EndBlock provides a mock function with given fields: _a0 -func (_m *Application) EndBlock(_a0 tmabci.RequestEndBlock) types.ResponseEndBlock { +func (_m *Application) EndBlock(_a0 abci.RequestEndBlock) ocabci.ResponseEndBlock { ret := _m.Called(_a0) - var r0 types.ResponseEndBlock - if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock) types.ResponseEndBlock); ok { + var r0 ocabci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) ocabci.ResponseEndBlock); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseEndBlock) + r0 = ret.Get(0).(ocabci.ResponseEndBlock) } return r0 } // EndRecheckTx provides a mock function with given fields: _a0 -func (_m *Application) EndRecheckTx(_a0 types.RequestEndRecheckTx) types.ResponseEndRecheckTx { +func (_m *Application) EndRecheckTx(_a0 ocabci.RequestEndRecheckTx) ocabci.ResponseEndRecheckTx { ret := _m.Called(_a0) - var r0 types.ResponseEndRecheckTx - if rf, ok := ret.Get(0).(func(types.RequestEndRecheckTx) types.ResponseEndRecheckTx); ok { + var r0 ocabci.ResponseEndRecheckTx + if rf, ok := ret.Get(0).(func(ocabci.RequestEndRecheckTx) ocabci.ResponseEndRecheckTx); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseEndRecheckTx) + r0 = ret.Get(0).(ocabci.ResponseEndRecheckTx) } return r0 } // Info provides a mock function with given fields: _a0 -func (_m *Application) Info(_a0 tmabci.RequestInfo) tmabci.ResponseInfo { +func (_m *Application) Info(_a0 abci.RequestInfo) abci.ResponseInfo { ret := _m.Called(_a0) - var r0 tmabci.ResponseInfo - if rf, ok := ret.Get(0).(func(tmabci.RequestInfo) tmabci.ResponseInfo); ok { + var r0 abci.ResponseInfo + if rf, ok := ret.Get(0).(func(abci.RequestInfo) abci.ResponseInfo); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseInfo) + r0 = ret.Get(0).(abci.ResponseInfo) } return r0 } // InitChain provides a mock function with given fields: _a0 -func (_m *Application) InitChain(_a0 types.RequestInitChain) types.ResponseInitChain { +func (_m *Application) InitChain(_a0 ocabci.RequestInitChain) ocabci.ResponseInitChain { ret := _m.Called(_a0) - var r0 types.ResponseInitChain - if rf, ok := ret.Get(0).(func(types.RequestInitChain) types.ResponseInitChain); ok { + var r0 ocabci.ResponseInitChain + if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain) ocabci.ResponseInitChain); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(types.ResponseInitChain) + r0 = ret.Get(0).(ocabci.ResponseInitChain) } return r0 } // ListSnapshots provides a mock function with given fields: _a0 -func (_m *Application) ListSnapshots(_a0 tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { +func (_m *Application) ListSnapshots(_a0 abci.RequestListSnapshots) abci.ResponseListSnapshots { ret := _m.Called(_a0) - var r0 tmabci.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots); ok { + var r0 abci.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots) abci.ResponseListSnapshots); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseListSnapshots) + r0 = ret.Get(0).(abci.ResponseListSnapshots) } return r0 } // LoadSnapshotChunk provides a mock function with given fields: _a0 -func (_m *Application) LoadSnapshotChunk(_a0 tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { +func (_m *Application) LoadSnapshotChunk(_a0 abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { ret := _m.Called(_a0) - var r0 tmabci.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk); ok { + var r0 abci.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(abci.ResponseLoadSnapshotChunk) } return r0 } // OfferSnapshot provides a mock function with given fields: _a0 -func (_m *Application) OfferSnapshot(_a0 tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { +func (_m *Application) OfferSnapshot(_a0 abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { ret := _m.Called(_a0) - var r0 tmabci.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot); ok { + var r0 abci.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseOfferSnapshot) + r0 = ret.Get(0).(abci.ResponseOfferSnapshot) } return r0 } // Query provides a mock function with given fields: _a0 -func (_m *Application) Query(_a0 tmabci.RequestQuery) tmabci.ResponseQuery { +func (_m *Application) Query(_a0 abci.RequestQuery) abci.ResponseQuery { ret := _m.Called(_a0) - var r0 tmabci.ResponseQuery - if rf, ok := ret.Get(0).(func(tmabci.RequestQuery) tmabci.ResponseQuery); ok { + var r0 abci.ResponseQuery + if rf, ok := ret.Get(0).(func(abci.RequestQuery) abci.ResponseQuery); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseQuery) + r0 = ret.Get(0).(abci.ResponseQuery) } return r0 } // SetOption provides a mock function with given fields: _a0 -func (_m *Application) SetOption(_a0 tmabci.RequestSetOption) tmabci.ResponseSetOption { +func (_m *Application) SetOption(_a0 abci.RequestSetOption) abci.ResponseSetOption { ret := _m.Called(_a0) - var r0 tmabci.ResponseSetOption - if rf, ok := ret.Get(0).(func(tmabci.RequestSetOption) tmabci.ResponseSetOption); ok { + var r0 abci.ResponseSetOption + if rf, ok := ret.Get(0).(func(abci.RequestSetOption) abci.ResponseSetOption); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmabci.ResponseSetOption) + r0 = ret.Get(0).(abci.ResponseSetOption) } return r0 diff --git a/blockchain/v0/reactor_test.go b/blockchain/v0/reactor_test.go index ba58fc3fc..87d49513e 100644 --- a/blockchain/v0/reactor_test.go +++ b/blockchain/v0/reactor_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/mempool/mock" @@ -313,39 +313,39 @@ func makeBlock(privVal types.PrivValidator, height int64, state sm.State, lastCo } type testApp struct { - abci.BaseApplication + ocabci.BaseApplication } -var _ abci.Application = (*testApp)(nil) +var _ ocabci.Application = (*testApp)(nil) -func (app *testApp) Info(req tmabci.RequestInfo) (resInfo tmabci.ResponseInfo) { - return tmabci.ResponseInfo{} +func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { + return abci.ResponseInfo{} } -func (app *testApp) BeginBlock(req abci.RequestBeginBlock) tmabci.ResponseBeginBlock { - return tmabci.ResponseBeginBlock{} +func (app *testApp) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { + return abci.ResponseBeginBlock{} } -func (app *testApp) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { - return abci.ResponseEndBlock{} +func (app *testApp) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { + return ocabci.ResponseEndBlock{} } -func (app *testApp) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { - return tmabci.ResponseDeliverTx{Events: []tmabci.Event{}} +func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { + return abci.ResponseDeliverTx{Events: []abci.Event{}} } -func (app *testApp) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { - return abci.ResponseCheckTx{} +func (app *testApp) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { + return ocabci.ResponseCheckTx{} } -func (app *testApp) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { - callback(abci.ResponseCheckTx{}) +func (app *testApp) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { + callback(ocabci.ResponseCheckTx{}) } -func (app *testApp) Commit() tmabci.ResponseCommit { - return tmabci.ResponseCommit{} +func (app *testApp) Commit() abci.ResponseCommit { + return abci.ResponseCommit{} } -func (app *testApp) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { +func (app *testApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { return } diff --git a/blockchain/v1/reactor_test.go b/blockchain/v1/reactor_test.go index 92d89becb..1ab37aef4 100644 --- a/blockchain/v1/reactor_test.go +++ b/blockchain/v1/reactor_test.go @@ -14,7 +14,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/mempool/mock" @@ -367,5 +367,5 @@ func makeBlock(privVal types.PrivValidator, height int64, state sm.State, lastCo } type testApp struct { - abci.BaseApplication + ocabci.BaseApplication } diff --git a/blockchain/v2/reactor_test.go b/blockchain/v2/reactor_test.go index 3f262152a..e81107f82 100644 --- a/blockchain/v2/reactor_test.go +++ b/blockchain/v2/reactor_test.go @@ -11,7 +11,7 @@ import ( tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/behaviour" bc "github.com/line/ostracon/blockchain" cfg "github.com/line/ostracon/config" @@ -465,7 +465,7 @@ func makeBlock(privVal types.PrivValidator, height int64, state sm.State, lastCo } type testApp struct { - abci.BaseApplication + ocabci.BaseApplication } func randGenesisDoc(chainID string, numValidators int, randPower bool, minPower int64) ( diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index 0caf325c8..9be442f31 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -15,9 +15,10 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - abcicli "github.com/line/ostracon/abci/client" - abci "github.com/line/ostracon/abci/types" config2 "github.com/line/ostracon/config" + + abcicli "github.com/line/ostracon/abci/client" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/evidence" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/service" @@ -54,7 +55,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) { ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() vals := types.OC2PB.ValidatorUpdates(state.Validators) - app.InitChain(abci.RequestInitChain{Validators: vals}) + app.InitChain(ocabci.RequestInitChain{Validators: vals}) blockDB := dbm.NewMemDB() blockStore := store.NewBlockStore(blockDB) diff --git a/consensus/common_test.go b/consensus/common_test.go index da4879d4b..b67254a01 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -23,7 +23,7 @@ import ( abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/counter" "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" cstypes "github.com/line/ostracon/consensus/types" tmbytes "github.com/line/ostracon/libs/bytes" @@ -381,7 +381,7 @@ func subscribeToVoter(cs *State, addr []byte) <-chan tmpubsub.Message { //------------------------------------------------------------------------------- // consensus states -func newState(state sm.State, pv types.PrivValidator, app abci.Application) *State { +func newState(state sm.State, pv types.PrivValidator, app ocabci.Application) *State { config := cfg.ResetTestRoot("consensus_state_test") return newStateWithConfig(config, state, pv, app) } @@ -390,7 +390,7 @@ func newStateWithConfig( thisConfig *cfg.Config, state sm.State, pv types.PrivValidator, - app abci.Application, + app ocabci.Application, ) *State { blockDB := dbm.NewMemDB() return newStateWithConfigAndBlockStore(thisConfig, state, pv, app, blockDB) @@ -400,7 +400,7 @@ func newStateWithConfigAndBlockStore( thisConfig *cfg.Config, state sm.State, pv types.PrivValidator, - app abci.Application, + app ocabci.Application, blockDB dbm.DB, ) *State { return newStateWithConfigAndBlockStoreWithLoggers(thisConfig, state, pv, app, blockDB, DefaultTestLoggers()) @@ -410,7 +410,7 @@ func newStateWithConfigAndBlockStoreWithLoggers( thisConfig *cfg.Config, state sm.State, pv types.PrivValidator, - app abci.Application, + app ocabci.Application, blockDB dbm.DB, loggers TestLoggers, ) *State { @@ -466,7 +466,7 @@ func randState(nValidators int) (*State, []*validatorStub) { return randStateWithApp(nValidators, counter.NewApplication(true)) } -func randStateWithApp(nValidators int, app abci.Application) (*State, []*validatorStub) { +func randStateWithApp(nValidators int, app ocabci.Application) (*State, []*validatorStub) { // Get State state, privVals := randGenesisState(nValidators, false, 10) state.LastProofHash = []byte{2} @@ -791,7 +791,7 @@ func consensusLogger() log.Logger { } func randConsensusNet(nValidators int, testName string, tickerFunc func() TimeoutTicker, - appFunc func() abci.Application, configOpts ...func(*cfg.Config)) ([]*State, cleanupFunc) { + appFunc func() ocabci.Application, configOpts ...func(*cfg.Config)) ([]*State, cleanupFunc) { genDoc, privVals := randGenesisDoc(nValidators, false, 30) css := make([]*State, nValidators) logger := consensusLogger() @@ -813,7 +813,7 @@ func randConsensusNet(nValidators int, testName string, tickerFunc func() Timeou ensureDir(filepath.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() vals := types.OC2PB.ValidatorUpdates(state.Validators) - app.InitChain(abci.RequestInitChain{Validators: vals}) + app.InitChain(ocabci.RequestInitChain{Validators: vals}) css[i] = newStateWithConfigAndBlockStore(thisConfig, state, privVals[i], app, stateDB) css[i].SetTimeoutTicker(tickerFunc()) @@ -832,7 +832,7 @@ func randConsensusNetWithPeers( nPeers int, testName string, tickerFunc func() TimeoutTicker, - appFunc func(string) abci.Application, + appFunc func(string) ocabci.Application, ) ([]*State, *types.GenesisDoc, *cfg.Config, cleanupFunc) { genDoc, privVals := randGenesisDoc(nValidators, false, testMinPower) css, peer0Config, configRootDirs := createPeersAndValidators(nValidators, nPeers, testName, @@ -847,7 +847,7 @@ func randConsensusNetWithPeers( func createPeersAndValidators(nValidators, nPeers int, testName string, genDoc *types.GenesisDoc, privVals []types.PrivValidator, tickerFunc func() TimeoutTicker, - appFunc func(string) abci.Application) ([]*State, *cfg.Config, []string) { + appFunc func(string) ocabci.Application) ([]*State, *cfg.Config, []string) { css := make([]*State, nPeers) logger := consensusLogger() var peer0Config *cfg.Config @@ -884,7 +884,7 @@ func createPeersAndValidators(nValidators, nPeers int, testName string, // simulate handshake, receive app version. If don't do this, replay test will fail state.Version.Consensus.App = kvstore.ProtocolVersion } - app.InitChain(abci.RequestInitChain{Validators: vals}) + app.InitChain(ocabci.RequestInitChain{Validators: vals}) // sm.SaveState(stateDB,state) //height 1's validatorsInfo already saved in LoadStateFromDBOrGenesisDoc above css[i] = newStateWithConfig(thisConfig, state, privVal, app) @@ -983,11 +983,11 @@ func (*mockTicker) SetLogger(log.Logger) {} //------------------------------------ -func newCounter() abci.Application { +func newCounter() ocabci.Application { return counter.NewApplication(true) } -func newPersistentKVStore() abci.Application { +func newPersistentKVStore() ocabci.Application { dir, err := ioutil.TempDir("", "persistent-kvstore") if err != nil { panic(err) @@ -995,7 +995,7 @@ func newPersistentKVStore() abci.Application { return kvstore.NewPersistentKVStoreApplication(dir) } -func newPersistentKVStoreWithPath(dbDir string) abci.Application { +func newPersistentKVStoreWithPath(dbDir string) ocabci.Application { return kvstore.NewPersistentKVStoreApplication(dbDir) } diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index 7bd1bcd80..a397f07c9 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -11,11 +11,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" mempl "github.com/line/ostracon/mempool" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" @@ -149,18 +149,18 @@ func TestMempoolRmBadTx(t *testing.T) { txBytes := make([]byte, 8) binary.BigEndian.PutUint64(txBytes, uint64(0)) - resDeliver := app.DeliverTx(tmabci.RequestDeliverTx{Tx: txBytes}) + resDeliver := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) assert.False(t, resDeliver.IsErr(), fmt.Sprintf("expected no error. got %v", resDeliver)) resCommit := app.Commit() assert.True(t, len(resCommit.Data) > 0) - resBeginRecheckTx := app.BeginRecheckTx(abci.RequestBeginRecheckTx{}) + resBeginRecheckTx := app.BeginRecheckTx(ocabci.RequestBeginRecheckTx{}) assert.Equal(t, code.CodeTypeOK, resBeginRecheckTx.Code) // There is no tx to recheck - resEndRecheckTx := app.EndRecheckTx(abci.RequestEndRecheckTx{}) + resEndRecheckTx := app.EndRecheckTx(ocabci.RequestEndRecheckTx{}) assert.Equal(t, code.CodeTypeOK, resEndRecheckTx.Code) checkTxErrorCh := make(chan error) @@ -172,7 +172,7 @@ func TestMempoolRmBadTx(t *testing.T) { // and the tx should get removed from the pool assertMempool(cs.txNotifier).CheckTxAsync(txBytes, mempl.TxInfo{}, func(err error) { checkTxErrorCh <- err - }, func(r *abci.Response) { + }, func(r *ocabci.Response) { if r.GetCheckTx().Code != code.CodeTypeBadNonce { t.Errorf("expected checktx to return bad nonce, got %v", r) return @@ -226,7 +226,7 @@ func TestMempoolRmBadTx(t *testing.T) { // CounterApplication that maintains a mempool state and resets it upon commit type CounterApplication struct { - abci.BaseApplication + ocabci.BaseApplication txCount int mempoolTxCount int @@ -237,45 +237,45 @@ func NewCounterApplication() *CounterApplication { return &CounterApplication{} } -func (app *CounterApplication) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { - return tmabci.ResponseInfo{Data: fmt.Sprintf("txs:%v", app.txCount)} +func (app *CounterApplication) Info(req abci.RequestInfo) abci.ResponseInfo { + return abci.ResponseInfo{Data: fmt.Sprintf("txs:%v", app.txCount)} } -func (app *CounterApplication) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { +func (app *CounterApplication) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { txValue := txAsUint64(req.Tx) if txValue != uint64(app.txCount) { - return tmabci.ResponseDeliverTx{ + return abci.ResponseDeliverTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } app.txCount++ - return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} + return abci.ResponseDeliverTx{Code: code.CodeTypeOK} } -func (app *CounterApplication) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { +func (app *CounterApplication) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { return app.checkTx(req) } -func (app *CounterApplication) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { +func (app *CounterApplication) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *CounterApplication) checkTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { +func (app *CounterApplication) checkTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { txValue := txAsUint64(req.Tx) app.mempoolTxCountMtx.Lock() defer app.mempoolTxCountMtx.Unlock() if txValue != uint64(app.mempoolTxCount) { - return abci.ResponseCheckTx{ + return ocabci.ResponseCheckTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.mempoolTxCount, txValue)} } app.mempoolTxCount++ - return abci.ResponseCheckTx{Code: code.CodeTypeOK} + return ocabci.ResponseCheckTx{Code: code.CodeTypeOK} } -func (app *CounterApplication) BeginRecheckTx(abci.RequestBeginRecheckTx) abci.ResponseBeginRecheckTx { +func (app *CounterApplication) BeginRecheckTx(ocabci.RequestBeginRecheckTx) ocabci.ResponseBeginRecheckTx { app.mempoolTxCount = app.txCount - return abci.ResponseBeginRecheckTx{Code: code.CodeTypeOK} + return ocabci.ResponseBeginRecheckTx{Code: code.CodeTypeOK} } func txAsUint64(tx []byte) uint64 { @@ -284,11 +284,11 @@ func txAsUint64(tx []byte) uint64 { return binary.BigEndian.Uint64(tx8) } -func (app *CounterApplication) Commit() tmabci.ResponseCommit { +func (app *CounterApplication) Commit() abci.ResponseCommit { if app.txCount == 0 { - return tmabci.ResponseCommit{} + return abci.ResponseCommit{} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return tmabci.ResponseCommit{Data: hash} + return abci.ResponseCommit{Data: hash} } diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 7bc688d8a..ae882f1c1 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -20,7 +20,7 @@ import ( abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" cstypes "github.com/line/ostracon/consensus/types" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -143,7 +143,7 @@ func TestReactorWithEvidence(t *testing.T) { ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() vals := types.OC2PB.ValidatorUpdates(state.Validators) - app.InitChain(abci.RequestInitChain{Validators: vals}) + app.InitChain(ocabci.RequestInitChain{Validators: vals}) pv := privVals[i] // duplicate code from: diff --git a/consensus/replay.go b/consensus/replay.go index 79220d22a..8904682a1 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -8,7 +8,7 @@ import ( "reflect" "time" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/proxy" @@ -309,7 +309,7 @@ func (h *Handshaker) ReplayBlocks( validatorSet := types.NewValidatorSet(validators) nextVals := types.OC2PB.ValidatorUpdates(validatorSet) csParams := types.OC2PB.ConsensusParams(h.genDoc.ConsensusParams) - req := abci.RequestInitChain{ + req := ocabci.RequestInitChain{ Time: h.genDoc.GenesisTime, ChainId: h.genDoc.ChainID, InitialHeight: h.genDoc.InitialHeight, diff --git a/consensus/replay_stubs.go b/consensus/replay_stubs.go index 4f68ca05b..ef7390ca1 100644 --- a/consensus/replay_stubs.go +++ b/consensus/replay_stubs.go @@ -1,9 +1,9 @@ package consensus import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/clist" mempl "github.com/line/ostracon/mempool" ocstate "github.com/line/ostracon/proto/ostracon/state" @@ -20,17 +20,17 @@ var _ mempl.Mempool = emptyMempool{} func (emptyMempool) Lock() {} func (emptyMempool) Unlock() {} func (emptyMempool) Size() int { return 0 } -func (emptyMempool) CheckTxSync(_ types.Tx, _ mempl.TxInfo) (*abci.Response, error) { +func (emptyMempool) CheckTxSync(_ types.Tx, _ mempl.TxInfo) (*ocabci.Response, error) { return nil, nil } -func (emptyMempool) CheckTxAsync(_ types.Tx, _ mempl.TxInfo, _ func(error), _ func(*abci.Response)) { +func (emptyMempool) CheckTxAsync(_ types.Tx, _ mempl.TxInfo, _ func(error), _ func(*ocabci.Response)) { } func (emptyMempool) ReapMaxBytesMaxGas(_, _ int64) types.Txs { return types.Txs{} } func (emptyMempool) ReapMaxBytesMaxGasMaxTxs(_, _, _ int64) types.Txs { return types.Txs{} } func (emptyMempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} } func (emptyMempool) Update( _ *types.Block, - _ []*tmabci.ResponseDeliverTx, + _ []*abci.ResponseDeliverTx, _ mempl.PreCheckFunc, _ mempl.PostCheckFunc, ) error { @@ -68,27 +68,27 @@ func newMockProxyApp(appHash []byte, abciResponses *ocstate.ABCIResponses) proxy } type mockProxyApp struct { - abci.BaseApplication + ocabci.BaseApplication appHash []byte txCount int abciResponses *ocstate.ABCIResponses } -func (mock *mockProxyApp) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { +func (mock *mockProxyApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { r := mock.abciResponses.DeliverTxs[mock.txCount] mock.txCount++ if r == nil { - return tmabci.ResponseDeliverTx{} + return abci.ResponseDeliverTx{} } return *r } -func (mock *mockProxyApp) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { +func (mock *mockProxyApp) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { mock.txCount = 0 return *mock.abciResponses.EndBlock } -func (mock *mockProxyApp) Commit() tmabci.ResponseCommit { - return tmabci.ResponseCommit{Data: mock.appHash} +func (mock *mockProxyApp) Commit() abci.ResponseCommit { + return abci.ResponseCommit{Data: mock.appHash} } diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 618bdc2c8..feb9ebfed 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -16,12 +16,12 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -610,8 +610,8 @@ func TestMockProxyApp(t *testing.T) { assert.NotPanics(t, func() { abciResWithEmptyDeliverTx := new(ocstate.ABCIResponses) - abciResWithEmptyDeliverTx.DeliverTxs = make([]*tmabci.ResponseDeliverTx, 0) - abciResWithEmptyDeliverTx.DeliverTxs = append(abciResWithEmptyDeliverTx.DeliverTxs, &tmabci.ResponseDeliverTx{}) + abciResWithEmptyDeliverTx.DeliverTxs = make([]*abci.ResponseDeliverTx, 0) + abciResWithEmptyDeliverTx.DeliverTxs = append(abciResWithEmptyDeliverTx.DeliverTxs, &abci.ResponseDeliverTx{}) // called when saveABCIResponses: bytes, err := proto.Marshal(abciResWithEmptyDeliverTx) @@ -625,15 +625,15 @@ func TestMockProxyApp(t *testing.T) { mock := newMockProxyApp([]byte("mock_hash"), loadedAbciRes) abciRes := new(ocstate.ABCIResponses) - abciRes.DeliverTxs = make([]*tmabci.ResponseDeliverTx, len(loadedAbciRes.DeliverTxs)) + abciRes.DeliverTxs = make([]*abci.ResponseDeliverTx, len(loadedAbciRes.DeliverTxs)) // Execute transactions and get hash. - proxyCb := func(req *abci.Request, res *abci.Response) { - if r, ok := res.Value.(*abci.Response_DeliverTx); ok { + proxyCb := func(req *ocabci.Request, res *ocabci.Response) { + if r, ok := res.Value.(*ocabci.Response_DeliverTx); ok { // TODO: make use of res.Log // TODO: make use of this info // Blocks may include invalid txs. txRes := r.DeliverTx - if txRes.Code == abci.CodeTypeOK { + if txRes.Code == ocabci.CodeTypeOK { validTxs++ } else { logger.Debug("Invalid tx", "code", txRes.Code, "log", txRes.Log) @@ -646,7 +646,7 @@ func TestMockProxyApp(t *testing.T) { mock.SetGlobalCallback(proxyCb) someTx := []byte("tx") - mock.DeliverTxAsync(tmabci.RequestDeliverTx{Tx: someTx}, nil) + mock.DeliverTxAsync(abci.RequestDeliverTx{Tx: someTx}, nil) }) assert.True(t, validTxs == 1) assert.True(t, invalidTxs == 0) @@ -783,7 +783,7 @@ func testHandshakeReplay(t *testing.T, config *cfg.Config, nBlocks int, mode uin } // get the latest app hash from the app - res, err := proxyApp.Query().InfoSync(tmabci.RequestInfo{Version: ""}) + res, err := proxyApp.Query().InfoSync(abci.RequestInfo{Version: ""}) if err != nil { t.Fatal(err) } @@ -831,7 +831,7 @@ func buildAppStateFromChain(proxyApp proxy.AppConns, stateStore sm.Store, state.ConsensusParams.Version.AppVersion = kvstore.ProtocolVersion // simulate handshake, receive app version state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version validators := types.OC2PB.ValidatorUpdates(state.Validators) - if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ + if _, err := proxyApp.Consensus().InitChainSync(ocabci.RequestInitChain{ Validators: validators, }); err != nil { panic(err) @@ -882,7 +882,7 @@ func buildOCStateFromChain( state.ConsensusParams.Version.AppVersion = kvstore.ProtocolVersion // simulate handshake, receive app version state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version validators := types.OC2PB.ValidatorUpdates(state.Validators) - if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ + if _, err := proxyApp.Consensus().InitChainSync(ocabci.RequestInitChain{ Validators: validators, }); err != nil { panic(err) @@ -1031,22 +1031,22 @@ func makeBlock(state sm.State, lastBlock *types.Block, lastBlockMeta *types.Bloc } type badApp struct { - abci.BaseApplication + ocabci.BaseApplication numBlocks byte height byte allHashesAreWrong bool onlyLastHashIsWrong bool } -func (app *badApp) Commit() tmabci.ResponseCommit { +func (app *badApp) Commit() abci.ResponseCommit { app.height++ if app.onlyLastHashIsWrong { if app.height == app.numBlocks { - return tmabci.ResponseCommit{Data: tmrand.Bytes(8)} + return abci.ResponseCommit{Data: tmrand.Bytes(8)} } - return tmabci.ResponseCommit{Data: []byte{app.height}} + return abci.ResponseCommit{Data: []byte{app.height}} } else if app.allHashesAreWrong { - return tmabci.ResponseCommit{Data: tmrand.Bytes(8)} + return abci.ResponseCommit{Data: tmrand.Bytes(8)} } panic("either allHashesAreWrong or onlyLastHashIsWrong must be set") @@ -1294,12 +1294,12 @@ func TestHandshakeUpdatesValidators(t *testing.T) { // returns the vals on InitChain type initChainApp struct { - abci.BaseApplication - vals []abci.ValidatorUpdate + ocabci.BaseApplication + vals []ocabci.ValidatorUpdate } -func (ica *initChainApp) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { - return abci.ResponseInitChain{ +func (ica *initChainApp) InitChain(req ocabci.RequestInitChain) ocabci.ResponseInitChain { + return ocabci.ResponseInitChain{ Validators: ica.vals, } } diff --git a/consensus/state_test.go b/consensus/state_test.go index 421164052..0969dec0c 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -4,18 +4,18 @@ import ( "bytes" "context" "fmt" + ocabci "github.com/line/ostracon/abci/types" "testing" "time" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" - - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/abci/example/counter" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/abci/types/mocks" cstypes "github.com/line/ostracon/consensus/types" "github.com/line/ostracon/crypto/tmhash" @@ -2098,12 +2098,12 @@ func subscribeUnBuffered(eventBus *types.EventBus, q tmpubsub.Query) <-chan tmpu func TestPruneBlocks(t *testing.T) { // Based behaviour is counter.Application mockApp := &mocks.Application{} - mockApp.On("BeginBlock", mock.Anything).Return(tmabci.ResponseBeginBlock{}) - mockApp.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{}) - mockApp.On("BeginRecheckTx", mock.Anything).Return(abci.ResponseBeginRecheckTx{Code: abci.CodeTypeOK}) - mockApp.On("EndRecheckTx", mock.Anything).Return(abci.ResponseEndRecheckTx{Code: abci.CodeTypeOK}) + mockApp.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{}) + mockApp.On("EndBlock", mock.Anything).Return(ocabci.ResponseEndBlock{}) + mockApp.On("BeginRecheckTx", mock.Anything).Return(ocabci.ResponseBeginRecheckTx{Code: ocabci.CodeTypeOK}) + mockApp.On("EndRecheckTx", mock.Anything).Return(ocabci.ResponseEndRecheckTx{Code: ocabci.CodeTypeOK}) // Mocking behaviour to response `RetainHeight` for pruneBlocks - mockApp.On("Commit", mock.Anything, mock.Anything).Return(tmabci.ResponseCommit{RetainHeight: 1}) + mockApp.On("Commit", mock.Anything, mock.Anything).Return(abci.ResponseCommit{RetainHeight: 1}) cs1, vss := randStateWithApp(4, mockApp) height, round := cs1.Height, cs1.Round diff --git a/light/rpc/client.go b/light/rpc/client.go index 781e2465e..a92fff2c2 100644 --- a/light/rpc/client.go +++ b/light/rpc/client.go @@ -10,9 +10,9 @@ import ( "github.com/gogo/protobuf/proto" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/merkle" tmbytes "github.com/line/ostracon/libs/bytes" tmmath "github.com/line/ostracon/libs/math" @@ -412,7 +412,7 @@ func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.Resul } // proto-encode BeginBlock events - bbeBytes, err := proto.Marshal(&tmabci.ResponseBeginBlock{ + bbeBytes, err := proto.Marshal(&abci.ResponseBeginBlock{ Events: res.BeginBlockEvents, }) if err != nil { @@ -423,7 +423,7 @@ func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.Resul results := types.NewResults(res.TxsResults) // proto-encode EndBlock events. - ebeBytes, err := proto.Marshal(&abci.ResponseEndBlock{ + ebeBytes, err := proto.Marshal(&ocabci.ResponseEndBlock{ Events: res.EndBlockEvents, }) if err != nil { diff --git a/mempool/cache_test.go b/mempool/cache_test.go index 65aa0178c..9a486df58 100644 --- a/mempool/cache_test.go +++ b/mempool/cache_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" ) @@ -69,7 +69,7 @@ func TestCacheAfterUpdate(t *testing.T) { updateTxs = append(updateTxs, tx) } err := mempool.Update(newTestBlock(int64(tcIndex), updateTxs), - abciResponses(len(updateTxs), abci.CodeTypeOK), nil, nil) + abciResponses(len(updateTxs), ocabci.CodeTypeOK), nil, nil) require.NoError(t, err) for _, v := range tc.reAddIndices { diff --git a/mempool/clist_mempool.go b/mempool/clist_mempool.go index b89244d96..735705fca 100644 --- a/mempool/clist_mempool.go +++ b/mempool/clist_mempool.go @@ -8,10 +8,10 @@ import ( "sync/atomic" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" auto "github.com/line/ostracon/libs/autofile" "github.com/line/ostracon/libs/clist" @@ -81,7 +81,7 @@ type requestCheckTxAsync struct { tx types.Tx txInfo TxInfo prepareCb func(error) - checkTxCb func(*abci.Response) + checkTxCb func(*ocabci.Response) } var _ Mempool = &CListMempool{} @@ -239,7 +239,7 @@ func (mem *CListMempool) TxsWaitChan() <-chan struct{} { // It blocks if we're waiting on Update() or Reap(). // Safe for concurrent use by multiple goroutines. -func (mem *CListMempool) CheckTxSync(tx types.Tx, txInfo TxInfo) (res *abci.Response, err error) { +func (mem *CListMempool) CheckTxSync(tx types.Tx, txInfo TxInfo) (res *ocabci.Response, err error) { mem.updateMtx.RLock() // use defer to unlock mutex because application (*local client*) might panic defer mem.updateMtx.RUnlock() @@ -249,13 +249,13 @@ func (mem *CListMempool) CheckTxSync(tx types.Tx, txInfo TxInfo) (res *abci.Resp } // CONTRACT: `app.CheckTxSync()` should check whether `GasWanted` is valid (0 <= GasWanted <= block.masGas) - var r *abci.ResponseCheckTx - r, err = mem.proxyAppConn.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) + var r *ocabci.ResponseCheckTx + r, err = mem.proxyAppConn.CheckTxSync(abci.RequestCheckTx{Tx: tx}) if err != nil { return res, err } - res = abci.ToResponseCheckTx(*r) + res = ocabci.ToResponseCheckTx(*r) mem.reqResCb(tx, txInfo.SenderID, txInfo.SenderP2PID, res, nil) return res, err } @@ -265,7 +265,7 @@ func (mem *CListMempool) CheckTxSync(tx types.Tx, txInfo TxInfo) (res *abci.Resp // // Safe for concurrent use by multiple goroutines. func (mem *CListMempool) CheckTxAsync(tx types.Tx, txInfo TxInfo, prepareCb func(error), - checkTxCb func(*abci.Response)) { + checkTxCb func(*ocabci.Response)) { mem.chReqCheckTx <- &requestCheckTxAsync{tx: tx, txInfo: txInfo, prepareCb: prepareCb, checkTxCb: checkTxCb} } @@ -277,7 +277,7 @@ func (mem *CListMempool) checkTxAsyncReactor() { // It blocks if we're waiting on Update() or Reap(). func (mem *CListMempool) checkTxAsync(tx types.Tx, txInfo TxInfo, prepareCb func(error), - checkTxCb func(*abci.Response)) { + checkTxCb func(*ocabci.Response)) { mem.updateMtx.RLock() defer func() { if r := recover(); r != nil { @@ -296,8 +296,8 @@ func (mem *CListMempool) checkTxAsync(tx types.Tx, txInfo TxInfo, prepareCb func } // CONTRACT: `app.CheckTxAsync()` should check whether `GasWanted` is valid (0 <= GasWanted <= block.masGas) - mem.proxyAppConn.CheckTxAsync(tmabci.RequestCheckTx{Tx: tx}, func(res *abci.Response) { - mem.reqResCb(tx, txInfo.SenderID, txInfo.SenderP2PID, res, func(response *abci.Response) { + mem.proxyAppConn.CheckTxAsync(abci.RequestCheckTx{Tx: tx}, func(res *ocabci.Response) { + mem.reqResCb(tx, txInfo.SenderID, txInfo.SenderP2PID, res, func(response *ocabci.Response) { if checkTxCb != nil { checkTxCb(response) } @@ -381,13 +381,13 @@ func (mem *CListMempool) prepareCheckTx(tx types.Tx, txInfo TxInfo) error { // // When rechecking, we don't need the peerID, so the recheck callback happens // here. -func (mem *CListMempool) globalCb(req *abci.Request, res *abci.Response) { +func (mem *CListMempool) globalCb(req *ocabci.Request, res *ocabci.Response) { checkTxReq := req.GetCheckTx() if checkTxReq == nil { return } - if checkTxReq.Type == tmabci.CheckTxType_Recheck { + if checkTxReq.Type == abci.CheckTxType_Recheck { mem.metrics.RecheckCount.Add(1) mem.resCbRecheck(req, res) @@ -409,8 +409,8 @@ func (mem *CListMempool) reqResCb( tx []byte, peerID uint16, peerP2PID p2p.ID, - res *abci.Response, - externalCb func(*abci.Response), + res *ocabci.Response, + externalCb func(*ocabci.Response), ) { mem.resCbFirstTime(tx, peerID, peerP2PID, res) @@ -509,11 +509,11 @@ func (mem *CListMempool) resCbFirstTime( tx []byte, peerID uint16, peerP2PID p2p.ID, - res *abci.Response, + res *ocabci.Response, ) { switch r := res.Value.(type) { - case *abci.Response_CheckTx: - if r.CheckTx.Code == abci.CodeTypeOK { + case *ocabci.Response_CheckTx: + if r.CheckTx.Code == ocabci.CodeTypeOK { memTx := &mempoolTx{ height: mem.height, gasWanted: r.CheckTx.GasWanted, @@ -550,9 +550,9 @@ func (mem *CListMempool) resCbFirstTime( // // The case where the app checks the tx for the first time is handled by the // resCbFirstTime callback. -func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) { +func (mem *CListMempool) resCbRecheck(req *ocabci.Request, res *ocabci.Response) { switch r := res.Value.(type) { - case *abci.Response_CheckTx: + case *ocabci.Response_CheckTx: tx := req.GetCheckTx().Tx txHash := TxKey(tx) e, ok := mem.txsMap.Load(txHash) @@ -561,7 +561,7 @@ func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) { return } var postCheckErr error - if r.CheckTx.Code == abci.CodeTypeOK { + if r.CheckTx.Code == ocabci.CodeTypeOK { if mem.postCheck == nil { return } @@ -692,7 +692,7 @@ func (mem *CListMempool) ReapMaxTxs(max int) types.Txs { // Lock() must be held by the caller during execution. func (mem *CListMempool) Update( block *types.Block, - deliverTxResponses []*tmabci.ResponseDeliverTx, + deliverTxResponses []*abci.ResponseDeliverTx, preCheck PreCheckFunc, postCheck PostCheckFunc, ) (err error) { @@ -708,7 +708,7 @@ func (mem *CListMempool) Update( } for i, tx := range block.Txs { - if deliverTxResponses[i].Code == abci.CodeTypeOK { + if deliverTxResponses[i].Code == ocabci.CodeTypeOK { // Add valid committed tx to the cache (if missing). _ = mem.cache.Push(tx) } else if !mem.config.KeepInvalidTxsInCache { @@ -735,7 +735,7 @@ func (mem *CListMempool) Update( // recheck non-committed txs to see if they became invalid recheckStartTime := time.Now().UnixNano() - _, err = mem.proxyAppConn.BeginRecheckTxSync(abci.RequestBeginRecheckTx{ + _, err = mem.proxyAppConn.BeginRecheckTxSync(ocabci.RequestBeginRecheckTx{ Header: types.OC2PB.Header(&block.Header), }) if err != nil { @@ -743,7 +743,7 @@ func (mem *CListMempool) Update( } mem.logger.Debug("recheck txs", "numtxs", mem.Size(), "height", block.Height) mem.recheckTxs() - _, err = mem.proxyAppConn.EndRecheckTxSync(abci.RequestEndRecheckTx{Height: block.Height}) + _, err = mem.proxyAppConn.EndRecheckTxSync(ocabci.RequestEndRecheckTx{Height: block.Height}) if err != nil { mem.logger.Error("error in proxyAppConn.EndRecheckTxSync", "err", err) } @@ -778,17 +778,17 @@ func (mem *CListMempool) recheckTxs() { wg.Add(1) memTx := e.Value.(*mempoolTx) - req := tmabci.RequestCheckTx{ + req := abci.RequestCheckTx{ Tx: memTx.tx, - Type: tmabci.CheckTxType_Recheck, + Type: abci.CheckTxType_Recheck, } - mem.proxyAppConn.CheckTxAsync(req, func(res *abci.Response) { + mem.proxyAppConn.CheckTxAsync(req, func(res *ocabci.Response) { wg.Done() }) } - mem.proxyAppConn.FlushAsync(func(res *abci.Response) {}) + mem.proxyAppConn.FlushAsync(func(res *ocabci.Response) {}) wg.Wait() } diff --git a/mempool/clist_mempool_system_test.go b/mempool/clist_mempool_system_test.go index 79196b080..30153f303 100644 --- a/mempool/clist_mempool_system_test.go +++ b/mempool/clist_mempool_system_test.go @@ -14,11 +14,11 @@ import ( "github.com/stretchr/testify/assert" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/abci/example/counter" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/proxy" @@ -94,17 +94,17 @@ func sizeOfSyncMap(m *sync.Map) int { } func createProposalBlockAndDeliverTxs( - mem *CListMempool, height int64) (*types.Block, []*tmabci.ResponseDeliverTx) { + mem *CListMempool, height int64) (*types.Block, []*abci.ResponseDeliverTx) { // mempool.lock/unlock in ReapMaxBytesMaxGasMaxTxs txs := mem.ReapMaxBytesMaxGasMaxTxs(mem.config.MaxTxsBytes, 0, int64(mem.config.Size)) block := types.MakeBlock(height, txs, nil, nil, tmversion.Consensus{ Block: version.BlockProtocol, App: version.AppProtocol, }) - deliverTxResponses := make([]*tmabci.ResponseDeliverTx, len(block.Txs)) + deliverTxResponses := make([]*abci.ResponseDeliverTx, len(block.Txs)) for i, tx := range block.Txs { - deliverTxResponses[i] = &tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK, + deliverTxResponses[i] = &abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK, Data: tx, } } @@ -112,7 +112,7 @@ func createProposalBlockAndDeliverTxs( } func commitBlock(ctx context.Context, t *testing.T, - mem *CListMempool, block *types.Block, deliverTxResponses []*tmabci.ResponseDeliverTx) { + mem *CListMempool, block *types.Block, deliverTxResponses []*abci.ResponseDeliverTx) { mem.Lock() defer mem.Unlock() err := mem.Update(block, deliverTxResponses, nil, nil) @@ -143,9 +143,9 @@ func receiveTx(ctx context.Context, t *testing.T, } } }, - func(res *abci.Response) { + func(res *ocabci.Response) { resCheckTx := res.GetCheckTx() - if resCheckTx.Code != abci.CodeTypeOK && len(resCheckTx.Log) != 0 { + if resCheckTx.Code != ocabci.CodeTypeOK && len(resCheckTx.Log) != 0 { atomic.AddInt64(&receiveTxCounter.abciFail, 1) } else { atomic.AddInt64(&receiveTxCounter.success, 1) diff --git a/mempool/clist_mempool_test.go b/mempool/clist_mempool_test.go index 0c90b43e4..872ed27c8 100644 --- a/mempool/clist_mempool_test.go +++ b/mempool/clist_mempool_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" @@ -24,7 +24,7 @@ import ( "github.com/line/ostracon/abci/example/counter" "github.com/line/ostracon/abci/example/kvstore" abciserver "github.com/line/ostracon/abci/server" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmrand "github.com/line/ostracon/libs/rand" @@ -105,7 +105,7 @@ func TestReapMaxBytesMaxGas(t *testing.T) { tx0 := mempool.TxsFront().Value.(*mempoolTx) // assert that kv store has gas wanted = 1. require.Equal(t, - app.CheckTxSync(tmabci.RequestCheckTx{Tx: tx0.tx}).GasWanted, int64(1), "KVStore had a gas value neq to 1") + app.CheckTxSync(abci.RequestCheckTx{Tx: tx0.tx}).GasWanted, int64(1), "KVStore had a gas value neq to 1") require.Equal(t, tx0.gasWanted, int64(1), "transactions gas was set incorrectly") // ensure each tx is 20 bytes long require.Equal(t, len(tx0.tx), 20, "Tx is longer than 20 bytes") @@ -177,7 +177,7 @@ func TestMempoolFilters(t *testing.T) { } for tcIndex, tt := range tests { err := mempool.Update(newTestBlock(1, emptyTxArr), - abciResponses(len(emptyTxArr), abci.CodeTypeOK), tt.preFilter, nil) + abciResponses(len(emptyTxArr), ocabci.CodeTypeOK), tt.preFilter, nil) require.NoError(t, err) checkTxs(t, mempool, tt.numTxsToCreate, UnknownPeerID) require.Equal(t, tt.expectedNumTxs, mempool.Size(), "mempool had the incorrect size, on test case %d", tcIndex) @@ -194,7 +194,7 @@ func TestMempoolUpdate(t *testing.T) { // 1. Adds valid txs to the cache { err := mempool.Update(newTestBlock(1, []types.Tx{[]byte{0x01}}), - abciResponses(1, abci.CodeTypeOK), nil, nil) + abciResponses(1, ocabci.CodeTypeOK), nil, nil) require.NoError(t, err) _, err = mempool.CheckTxSync([]byte{0x01}, TxInfo{}) if assert.Error(t, err) { @@ -206,7 +206,7 @@ func TestMempoolUpdate(t *testing.T) { { _, err := mempool.CheckTxSync([]byte{0x02}, TxInfo{}) require.NoError(t, err) - err = mempool.Update(newTestBlock(1, []types.Tx{[]byte{0x02}}), abciResponses(1, abci.CodeTypeOK), nil, nil) + err = mempool.Update(newTestBlock(1, []types.Tx{[]byte{0x02}}), abciResponses(1, ocabci.CodeTypeOK), nil, nil) require.NoError(t, err) assert.Zero(t, mempool.Size()) } @@ -244,10 +244,10 @@ func TestMempool_KeepInvalidTxsInCache(t *testing.T) { require.NoError(t, err) // simulate new block - _ = app.DeliverTx(tmabci.RequestDeliverTx{Tx: a}) - _ = app.DeliverTx(tmabci.RequestDeliverTx{Tx: b}) + _ = app.DeliverTx(abci.RequestDeliverTx{Tx: a}) + _ = app.DeliverTx(abci.RequestDeliverTx{Tx: b}) err = mempool.Update(newTestBlock(1, []types.Tx{a, b}), - []*tmabci.ResponseDeliverTx{{Code: abci.CodeTypeOK}, {Code: 2}}, nil, nil) + []*abci.ResponseDeliverTx{{Code: ocabci.CodeTypeOK}, {Code: 2}}, nil, nil) require.NoError(t, err) // a must be added to the cache @@ -303,7 +303,7 @@ func TestTxsAvailable(t *testing.T) { // since there are still txs left committedTxs, txs := txs[:50], txs[50:] if err := mempool.Update(newTestBlock(1, committedTxs), - abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { + abciResponses(len(committedTxs), ocabci.CodeTypeOK), nil, nil); err != nil { t.Error(err) } ensureFire(t, mempool.TxsAvailable(), timeoutMS) @@ -316,7 +316,7 @@ func TestTxsAvailable(t *testing.T) { // now call update with all the txs. it should not fire as there are no txs left committedTxs = append(txs, moreTxs...) // nolint: gocritic if err := mempool.Update(newTestBlock(2, committedTxs), - abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { + abciResponses(len(committedTxs), ocabci.CodeTypeOK), nil, nil); err != nil { t.Error(err) } ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) @@ -329,7 +329,7 @@ func TestTxsAvailable(t *testing.T) { func TestSerialReap(t *testing.T) { app := counter.NewApplication(true) - app.SetOption(tmabci.RequestSetOption{Key: "serial", Value: "on"}) + app.SetOption(abci.RequestSetOption{Key: "serial", Value: "on"}) cc := proxy.NewLocalClientCreator(app) mempool, cleanup := newMempoolWithApp(cc) @@ -376,7 +376,7 @@ func TestSerialReap(t *testing.T) { txs = append(txs, txBytes) } if err := mempool.Update(newTestBlock(0, txs), - abciResponses(len(txs), abci.CodeTypeOK), nil, nil); err != nil { + abciResponses(len(txs), ocabci.CodeTypeOK), nil, nil); err != nil { t.Error(err) } } @@ -386,7 +386,7 @@ func TestSerialReap(t *testing.T) { for i := start; i < end; i++ { txBytes := make([]byte, 8) binary.BigEndian.PutUint64(txBytes, uint64(i)) - res, err := appConnCon.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) + res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) if err != nil { t.Errorf("client error committing tx: %v", err) } @@ -548,7 +548,7 @@ func TestMempoolTxsBytes(t *testing.T) { // 3. zero again after tx is removed by Update err = mempool.Update(newTestBlock(1, []types.Tx{[]byte{0x01}}), - abciResponses(1, abci.CodeTypeOK), nil, nil) + abciResponses(1, ocabci.CodeTypeOK), nil, nil) require.NoError(t, err) assert.EqualValues(t, 0, mempool.TxsBytes()) @@ -590,7 +590,7 @@ func TestMempoolTxsBytes(t *testing.T) { t.Error(err) } }) - res, err := appConnCon.DeliverTxSync(tmabci.RequestDeliverTx{Tx: txBytes}) + res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) require.NoError(t, err) require.EqualValues(t, 0, res.Code) res2, err := appConnCon.CommitSync() @@ -598,7 +598,7 @@ func TestMempoolTxsBytes(t *testing.T) { require.NotEmpty(t, res2.Data) // Pretend like we committed nothing so txBytes gets rechecked and removed. - err = mempool.Update(newTestBlock(1, []types.Tx{}), abciResponses(0, abci.CodeTypeOK), nil, nil) + err = mempool.Update(newTestBlock(1, []types.Tx{}), abciResponses(0, ocabci.CodeTypeOK), nil, nil) require.NoError(t, err) assert.EqualValues(t, 0, mempool.TxsBytes()) @@ -668,7 +668,7 @@ func newTestBlock(height int64, txs types.Txs) *types.Block { func newRemoteApp( t *testing.T, addr string, - app abci.Application, + app ocabci.Application, ) ( clientCreator proxy.ClientCreator, server service.Service, @@ -677,7 +677,7 @@ func newRemoteApp( // Start server server = abciserver.NewSocketServer(addr, app) - server.SetLogger(log.TestingLogger().With("module", "abci-server")) + server.SetLogger(log.TestingLogger().With("module", "ocabci-server")) if err := server.Start(); err != nil { t.Fatalf("Error starting socket server: %v", err.Error()) } @@ -696,10 +696,10 @@ func checksumFile(p string, t *testing.T) string { return checksumIt(data) } -func abciResponses(n int, code uint32) []*tmabci.ResponseDeliverTx { - responses := make([]*tmabci.ResponseDeliverTx, 0, n) +func abciResponses(n int, code uint32) []*abci.ResponseDeliverTx { + responses := make([]*abci.ResponseDeliverTx, 0, n) for i := 0; i < n; i++ { - responses = append(responses, &tmabci.ResponseDeliverTx{Code: code}) + responses = append(responses, &abci.ResponseDeliverTx{Code: code}) } return responses } @@ -726,7 +726,7 @@ func TestTxMempoolPostCheckError(t *testing.T) { mempool, cleanup := newMempoolWithApp(cc) defer cleanup() - mempool.postCheck = func(_ types.Tx, _ *abci.ResponseCheckTx) error { + mempool.postCheck = func(_ types.Tx, _ *ocabci.ResponseCheckTx) error { return testCase.err } @@ -734,20 +734,20 @@ func TestTxMempoolPostCheckError(t *testing.T) { _, err := mempool.CheckTxSync(tx, TxInfo{}) require.NoError(t, err) - req := tmabci.RequestCheckTx{ + req := abci.RequestCheckTx{ Tx: tx, - Type: tmabci.CheckTxType_Recheck, + Type: abci.CheckTxType_Recheck, } - res := &abci.Response{} + res := &ocabci.Response{} m := sync.Mutex{} m.Lock() - mempool.proxyAppConn.CheckTxAsync(req, func(r *abci.Response) { + mempool.proxyAppConn.CheckTxAsync(req, func(r *ocabci.Response) { res = r m.Unlock() }) - checkTxRes, ok := res.Value.(*abci.Response_CheckTx) + checkTxRes, ok := res.Value.(*ocabci.Response_CheckTx) require.True(t, ok) expectedErrString := "" if testCase.err != nil { diff --git a/mempool/mempool.go b/mempool/mempool.go index caf3c3a02..e60239bd6 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -3,9 +3,9 @@ package mempool import ( "fmt" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/p2p" "github.com/line/ostracon/types" ) @@ -17,8 +17,8 @@ import ( type Mempool interface { // CheckTx executes a new transaction against the application to determine // its validity and whether it should be added to the mempool. - CheckTxSync(tx types.Tx, txInfo TxInfo) (*abci.Response, error) - CheckTxAsync(tx types.Tx, txInfo TxInfo, prepareCb func(error), checkTxCb func(*abci.Response)) + CheckTxSync(tx types.Tx, txInfo TxInfo) (*ocabci.Response, error) + CheckTxAsync(tx types.Tx, txInfo TxInfo, prepareCb func(error), checkTxCb func(*ocabci.Response)) // ReapMaxBytesMaxGas reaps transactions from the mempool up to maxBytes // bytes total with the condition that the total gasWanted must be less than @@ -46,7 +46,7 @@ type Mempool interface { // NOTE: Lock/Unlock must be managed by caller Update( block *types.Block, - deliverTxResponses []*tmabci.ResponseDeliverTx, + deliverTxResponses []*abci.ResponseDeliverTx, newPreFn PreCheckFunc, newPostFn PostCheckFunc, ) error @@ -93,7 +93,7 @@ type PreCheckFunc func(types.Tx) error // PostCheckFunc is an optional filter executed after CheckTx and rejects // transaction if false is returned. An example would be to ensure a // transaction doesn't require more gas than available for the block. -type PostCheckFunc func(types.Tx, *abci.ResponseCheckTx) error +type PostCheckFunc func(types.Tx, *ocabci.ResponseCheckTx) error // TxInfo are parameters that get passed when attempting to add a tx to the // mempool. @@ -123,7 +123,7 @@ func PreCheckMaxBytes(maxBytes int64) PreCheckFunc { // PostCheckMaxGas checks that the wanted gas is smaller or equal to the passed // maxGas. Returns nil if maxGas is -1. func PostCheckMaxGas(maxGas int64) PostCheckFunc { - return func(tx types.Tx, res *abci.ResponseCheckTx) error { + return func(tx types.Tx, res *ocabci.ResponseCheckTx) error { if maxGas == -1 { return nil } diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index 31a50ffff..d74b784a1 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -3,20 +3,20 @@ package mempool import ( "testing" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/stretchr/testify/require" ) func TestPostCheckMaxGas(t *testing.T) { tests := []struct { - res *abci.ResponseCheckTx + res *ocabci.ResponseCheckTx postCheck PostCheckFunc ok bool }{ - {&abci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(10), true}, - {&abci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(-1), true}, - {&abci.ResponseCheckTx{GasWanted: -1}, PostCheckMaxGas(10), false}, - {&abci.ResponseCheckTx{GasWanted: 11}, PostCheckMaxGas(10), false}, + {&ocabci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(10), true}, + {&ocabci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(-1), true}, + {&ocabci.ResponseCheckTx{GasWanted: -1}, PostCheckMaxGas(10), false}, + {&ocabci.ResponseCheckTx{GasWanted: 11}, PostCheckMaxGas(10), false}, } for tcIndex, tt := range tests { err := tt.postCheck(nil, tt.res) diff --git a/mempool/mock/mempool.go b/mempool/mock/mempool.go index dcb6137f0..4702b643c 100644 --- a/mempool/mock/mempool.go +++ b/mempool/mock/mempool.go @@ -1,9 +1,9 @@ package mock import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/clist" mempl "github.com/line/ostracon/mempool" "github.com/line/ostracon/types" @@ -17,17 +17,17 @@ var _ mempl.Mempool = Mempool{} func (Mempool) Lock() {} func (Mempool) Unlock() {} func (Mempool) Size() int { return 0 } -func (Mempool) CheckTxSync(_ types.Tx, _ mempl.TxInfo) (*abci.Response, error) { +func (Mempool) CheckTxSync(_ types.Tx, _ mempl.TxInfo) (*ocabci.Response, error) { return nil, nil } -func (Mempool) CheckTxAsync(_ types.Tx, _ mempl.TxInfo, _ func(error), _ func(*abci.Response)) { +func (Mempool) CheckTxAsync(_ types.Tx, _ mempl.TxInfo, _ func(error), _ func(*ocabci.Response)) { } func (Mempool) ReapMaxBytesMaxGas(_, _ int64) types.Txs { return types.Txs{} } func (Mempool) ReapMaxBytesMaxGasMaxTxs(_, _, _ int64) types.Txs { return types.Txs{} } func (Mempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} } func (Mempool) Update( _ *types.Block, - _ []*tmabci.ResponseDeliverTx, + _ []*abci.ResponseDeliverTx, _ mempl.PreCheckFunc, _ mempl.PostCheckFunc, ) error { diff --git a/mempool/reactor_test.go b/mempool/reactor_test.go index acce31dbf..f4402d2e8 100644 --- a/mempool/reactor_test.go +++ b/mempool/reactor_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" memproto "github.com/tendermint/tendermint/proto/tendermint/mempool" "github.com/line/ostracon/abci/example/kvstore" @@ -104,9 +104,9 @@ func TestReactorConcurrency(t *testing.T) { reactors[0].mempool.Lock() defer reactors[0].mempool.Unlock() - deliverTxResponses := make([]*tmabci.ResponseDeliverTx, len(txs)) + deliverTxResponses := make([]*abci.ResponseDeliverTx, len(txs)) for i := range txs { - deliverTxResponses[i] = &tmabci.ResponseDeliverTx{Code: 0} + deliverTxResponses[i] = &abci.ResponseDeliverTx{Code: 0} } err := reactors[0].mempool.Update(newTestBlock(1, txs), deliverTxResponses, nil, nil) assert.NoError(t, err) @@ -121,7 +121,7 @@ func TestReactorConcurrency(t *testing.T) { reactors[1].mempool.Lock() defer reactors[1].mempool.Unlock() err := reactors[1].mempool.Update(newTestBlock(1, []types.Tx{}), - make([]*tmabci.ResponseDeliverTx, 0), nil, nil) + make([]*abci.ResponseDeliverTx, 0), nil, nil) assert.NoError(t, err) }() diff --git a/node/node.go b/node/node.go index 2752f7c72..43f8d05c5 100644 --- a/node/node.go +++ b/node/node.go @@ -13,7 +13,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/rs/cors" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" bcv0 "github.com/line/ostracon/blockchain/v0" @@ -507,7 +507,7 @@ func createTransport( connFilters, // ABCI query for address filtering. func(_ p2p.ConnSet, c net.Conn, _ []net.IP) error { - res, err := proxyApp.Query().QuerySync(tmabci.RequestQuery{ + res, err := proxyApp.Query().QuerySync(abci.RequestQuery{ Path: fmt.Sprintf("/p2p/filter/addr/%s", c.RemoteAddr().String()), }) if err != nil { @@ -525,7 +525,7 @@ func createTransport( peerFilters, // ABCI query for ID filtering. func(_ p2p.IPeerSet, p p2p.Peer) error { - res, err := proxyApp.Query().QuerySync(tmabci.RequestQuery{ + res, err := proxyApp.Query().QuerySync(abci.RequestQuery{ Path: fmt.Sprintf("/p2p/filter/id/%s", p.ID()), }) if err != nil { diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 06ab4d489..8113ccd9e 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -1,10 +1,10 @@ package proxy import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" ) //nolint @@ -17,45 +17,45 @@ type AppConnConsensus interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - InitChainSync(abci.RequestInitChain) (*abci.ResponseInitChain, error) + InitChainSync(ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) - BeginBlockSync(abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) - DeliverTxAsync(tmabci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes - EndBlockSync(tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) - CommitSync() (*tmabci.ResponseCommit, error) + BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) + DeliverTxAsync(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes + EndBlockSync(abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) + CommitSync() (*abci.ResponseCommit, error) } type AppConnMempool interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - CheckTxAsync(tmabci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes - CheckTxSync(tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) + CheckTxAsync(abci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes + CheckTxSync(abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) - BeginRecheckTxSync(abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) - EndRecheckTxSync(abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) + BeginRecheckTxSync(ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) + EndRecheckTxSync(ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) FlushAsync(abcicli.ResponseCallback) *abcicli.ReqRes - FlushSync() (*tmabci.ResponseFlush, error) + FlushSync() (*abci.ResponseFlush, error) } type AppConnQuery interface { Error() error - EchoSync(string) (*tmabci.ResponseEcho, error) - InfoSync(tmabci.RequestInfo) (*tmabci.ResponseInfo, error) - QuerySync(tmabci.RequestQuery) (*tmabci.ResponseQuery, error) + EchoSync(string) (*abci.ResponseEcho, error) + InfoSync(abci.RequestInfo) (*abci.ResponseInfo, error) + QuerySync(abci.RequestQuery) (*abci.ResponseQuery, error) - // SetOptionSync(key string, value string) (res abci.Result) + // SetOptionSync(key string, value string) (res ocabci.Result) } type AppConnSnapshot interface { Error() error - ListSnapshotsSync(tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) - OfferSnapshotSync(tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) - LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) + ListSnapshotsSync(abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) + OfferSnapshotSync(abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) + LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) } //----------------------------------------------------------------------------------------- @@ -79,23 +79,23 @@ func (app *appConnConsensus) Error() error { return app.appConn.Error() } -func (app *appConnConsensus) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (app *appConnConsensus) InitChainSync(req ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { return app.appConn.InitChainSync(req) } -func (app *appConnConsensus) BeginBlockSync(req abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { +func (app *appConnConsensus) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { return app.appConn.BeginBlockSync(req) } -func (app *appConnConsensus) DeliverTxAsync(req tmabci.RequestDeliverTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { +func (app *appConnConsensus) DeliverTxAsync(req abci.RequestDeliverTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { return app.appConn.DeliverTxAsync(req, cb) } -func (app *appConnConsensus) EndBlockSync(req tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (app *appConnConsensus) EndBlockSync(req abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { return app.appConn.EndBlockSync(req) } -func (app *appConnConsensus) CommitSync() (*tmabci.ResponseCommit, error) { +func (app *appConnConsensus) CommitSync() (*abci.ResponseCommit, error) { return app.appConn.CommitSync() } @@ -124,23 +124,23 @@ func (app *appConnMempool) FlushAsync(cb abcicli.ResponseCallback) *abcicli.ReqR return app.appConn.FlushAsync(cb) } -func (app *appConnMempool) FlushSync() (*tmabci.ResponseFlush, error) { +func (app *appConnMempool) FlushSync() (*abci.ResponseFlush, error) { return app.appConn.FlushSync() } -func (app *appConnMempool) CheckTxAsync(req tmabci.RequestCheckTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { +func (app *appConnMempool) CheckTxAsync(req abci.RequestCheckTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { return app.appConn.CheckTxAsync(req, cb) } -func (app *appConnMempool) CheckTxSync(req tmabci.RequestCheckTx) (*abci.ResponseCheckTx, error) { +func (app *appConnMempool) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { return app.appConn.CheckTxSync(req) } -func (app *appConnMempool) BeginRecheckTxSync(req abci.RequestBeginRecheckTx) (*abci.ResponseBeginRecheckTx, error) { +func (app *appConnMempool) BeginRecheckTxSync(req ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) { return app.appConn.BeginRecheckTxSync(req) } -func (app *appConnMempool) EndRecheckTxSync(req abci.RequestEndRecheckTx) (*abci.ResponseEndRecheckTx, error) { +func (app *appConnMempool) EndRecheckTxSync(req ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) { return app.appConn.EndRecheckTxSync(req) } @@ -161,15 +161,15 @@ func (app *appConnQuery) Error() error { return app.appConn.Error() } -func (app *appConnQuery) EchoSync(msg string) (*tmabci.ResponseEcho, error) { +func (app *appConnQuery) EchoSync(msg string) (*abci.ResponseEcho, error) { return app.appConn.EchoSync(msg) } -func (app *appConnQuery) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { +func (app *appConnQuery) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { return app.appConn.InfoSync(req) } -func (app *appConnQuery) QuerySync(reqQuery tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { +func (app *appConnQuery) QuerySync(reqQuery abci.RequestQuery) (*abci.ResponseQuery, error) { return app.appConn.QuerySync(reqQuery) } @@ -190,20 +190,20 @@ func (app *appConnSnapshot) Error() error { return app.appConn.Error() } -func (app *appConnSnapshot) ListSnapshotsSync(req tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { +func (app *appConnSnapshot) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { return app.appConn.ListSnapshotsSync(req) } -func (app *appConnSnapshot) OfferSnapshotSync(req tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { +func (app *appConnSnapshot) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { return app.appConn.OfferSnapshotSync(req) } func (app *appConnSnapshot) LoadSnapshotChunkSync( - req tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { + req abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { return app.appConn.LoadSnapshotChunkSync(req) } func (app *appConnSnapshot) ApplySnapshotChunkSync( - req tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { + req abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { return app.appConn.ApplySnapshotChunkSync(req) } diff --git a/proxy/app_conn_test.go b/proxy/app_conn_test.go index 55dfafb43..62ce14148 100644 --- a/proxy/app_conn_test.go +++ b/proxy/app_conn_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" @@ -17,9 +17,9 @@ import ( //---------------------------------------- type AppConnTest interface { - FlushSync() (*tmabci.ResponseFlush, error) + FlushSync() (*abci.ResponseFlush, error) EchoAsync(string, abcicli.ResponseCallback) *abcicli.ReqRes - InfoSync(tmabci.RequestInfo) (*tmabci.ResponseInfo, error) + InfoSync(abci.RequestInfo) (*abci.ResponseInfo, error) } type appConnTest struct { @@ -34,11 +34,11 @@ func (app *appConnTest) EchoAsync(msg string, cb abcicli.ResponseCallback) *abci return app.appConn.EchoAsync(msg, cb) } -func (app *appConnTest) FlushSync() (*tmabci.ResponseFlush, error) { +func (app *appConnTest) FlushSync() (*abci.ResponseFlush, error) { return app.appConn.FlushSync() } -func (app *appConnTest) InfoSync(req tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { +func (app *appConnTest) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { return app.appConn.InfoSync(req) } @@ -125,7 +125,7 @@ func BenchmarkEcho(b *testing.B) { } b.StopTimer() - // info := proxy.InfoSync(tmabci.RequestInfo{""}) + // info := proxy.InfoSync(abci.RequestInfo{""}) // b.Log("N: ", b.N, info) } diff --git a/proxy/client.go b/proxy/client.go index cb034b5b0..e7d2b770b 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -6,7 +6,7 @@ import ( abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/counter" "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmsync "github.com/line/ostracon/libs/sync" e2e "github.com/line/ostracon/test/e2e/app" ) @@ -22,12 +22,12 @@ type ClientCreator interface { type localClientCreator struct { mtx *tmsync.Mutex - app abci.Application + app ocabci.Application } // NewLocalClientCreator returns a ClientCreator for the given app, // which will be running locally. -func NewLocalClientCreator(app abci.Application) ClientCreator { +func NewLocalClientCreator(app ocabci.Application) ClientCreator { return &localClientCreator{ mtx: new(tmsync.Mutex), app: app, @@ -87,7 +87,7 @@ func DefaultClientCreator(addr, transport, dbDir string) ClientCreator { } return NewLocalClientCreator(app) case "noop": - return NewLocalClientCreator(abci.NewBaseApplication()) + return NewLocalClientCreator(ocabci.NewBaseApplication()) default: mustConnect := false // loop retrying return NewRemoteClientCreator(addr, transport, mustConnect) diff --git a/proxy/mocks/app_conn_consensus.go b/proxy/mocks/app_conn_consensus.go index 9c28df4a6..37a42c906 100644 --- a/proxy/mocks/app_conn_consensus.go +++ b/proxy/mocks/app_conn_consensus.go @@ -3,10 +3,10 @@ package mocks import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" mock "github.com/stretchr/testify/mock" ) @@ -16,20 +16,20 @@ type AppConnConsensus struct { } // BeginBlockSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) BeginBlockSync(_a0 abci.RequestBeginBlock) (*tmabci.ResponseBeginBlock, error) { +func (_m *AppConnConsensus) BeginBlockSync(_a0 ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(abci.RequestBeginBlock) *tmabci.ResponseBeginBlock); ok { + var r0 *abci.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) *abci.ResponseBeginBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseBeginBlock) + r0 = ret.Get(0).(*abci.ResponseBeginBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestBeginBlock) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestBeginBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -39,15 +39,15 @@ func (_m *AppConnConsensus) BeginBlockSync(_a0 abci.RequestBeginBlock) (*tmabci. } // CommitSync provides a mock function with given fields: -func (_m *AppConnConsensus) CommitSync() (*tmabci.ResponseCommit, error) { +func (_m *AppConnConsensus) CommitSync() (*abci.ResponseCommit, error) { ret := _m.Called() - var r0 *tmabci.ResponseCommit - if rf, ok := ret.Get(0).(func() *tmabci.ResponseCommit); ok { + var r0 *abci.ResponseCommit + if rf, ok := ret.Get(0).(func() *abci.ResponseCommit); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseCommit) + r0 = ret.Get(0).(*abci.ResponseCommit) } } @@ -62,11 +62,11 @@ func (_m *AppConnConsensus) CommitSync() (*tmabci.ResponseCommit, error) { } // DeliverTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) DeliverTxAsync(_a0 tmabci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *AppConnConsensus) DeliverTxAsync(_a0 abci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -78,20 +78,20 @@ func (_m *AppConnConsensus) DeliverTxAsync(_a0 tmabci.RequestDeliverTx, _a1 abci } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) EndBlockSync(_a0 tmabci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (_m *AppConnConsensus) EndBlockSync(_a0 abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(tmabci.RequestEndBlock) *abci.ResponseEndBlock); ok { + var r0 *ocabci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *ocabci.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseEndBlock) + r0 = ret.Get(0).(*ocabci.ResponseEndBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestEndBlock) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestEndBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -115,20 +115,20 @@ func (_m *AppConnConsensus) Error() error { } // InitChainSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (_m *AppConnConsensus) InitChainSync(_a0 ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { + var r0 *ocabci.ResponseInitChain + if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain) *ocabci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseInitChain) + r0 = ret.Get(0).(*ocabci.ResponseInitChain) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_mempool.go b/proxy/mocks/app_conn_mempool.go index 5e5b62a61..5e955a480 100644 --- a/proxy/mocks/app_conn_mempool.go +++ b/proxy/mocks/app_conn_mempool.go @@ -4,10 +4,10 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" - types "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" ) // AppConnMempool is an autogenerated mock type for the AppConnMempool type @@ -16,20 +16,20 @@ type AppConnMempool struct { } // BeginRecheckTxSync provides a mock function with given fields: _a0 -func (_m *AppConnMempool) BeginRecheckTxSync(_a0 types.RequestBeginRecheckTx) (*types.ResponseBeginRecheckTx, error) { +func (_m *AppConnMempool) BeginRecheckTxSync(_a0 ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseBeginRecheckTx - if rf, ok := ret.Get(0).(func(types.RequestBeginRecheckTx) *types.ResponseBeginRecheckTx); ok { + var r0 *ocabci.ResponseBeginRecheckTx + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginRecheckTx) *ocabci.ResponseBeginRecheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseBeginRecheckTx) + r0 = ret.Get(0).(*ocabci.ResponseBeginRecheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestBeginRecheckTx) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestBeginRecheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -39,11 +39,11 @@ func (_m *AppConnMempool) BeginRecheckTxSync(_a0 types.RequestBeginRecheckTx) (* } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *AppConnMempool) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *AppConnMempool) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -55,20 +55,20 @@ func (_m *AppConnMempool) CheckTxAsync(_a0 tmabci.RequestCheckTx, _a1 abcicli.Re } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *AppConnMempool) CheckTxSync(_a0 tmabci.RequestCheckTx) (*types.ResponseCheckTx, error) { +func (_m *AppConnMempool) CheckTxSync(_a0 abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseCheckTx - if rf, ok := ret.Get(0).(func(tmabci.RequestCheckTx) *types.ResponseCheckTx); ok { + var r0 *ocabci.ResponseCheckTx + if rf, ok := ret.Get(0).(func(abci.RequestCheckTx) *ocabci.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseCheckTx) + r0 = ret.Get(0).(*ocabci.ResponseCheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestCheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -78,20 +78,20 @@ func (_m *AppConnMempool) CheckTxSync(_a0 tmabci.RequestCheckTx) (*types.Respons } // EndRecheckTxSync provides a mock function with given fields: _a0 -func (_m *AppConnMempool) EndRecheckTxSync(_a0 types.RequestEndRecheckTx) (*types.ResponseEndRecheckTx, error) { +func (_m *AppConnMempool) EndRecheckTxSync(_a0 ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) { ret := _m.Called(_a0) - var r0 *types.ResponseEndRecheckTx - if rf, ok := ret.Get(0).(func(types.RequestEndRecheckTx) *types.ResponseEndRecheckTx); ok { + var r0 *ocabci.ResponseEndRecheckTx + if rf, ok := ret.Get(0).(func(ocabci.RequestEndRecheckTx) *ocabci.ResponseEndRecheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseEndRecheckTx) + r0 = ret.Get(0).(*ocabci.ResponseEndRecheckTx) } } var r1 error - if rf, ok := ret.Get(1).(func(types.RequestEndRecheckTx) error); ok { + if rf, ok := ret.Get(1).(func(ocabci.RequestEndRecheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -131,15 +131,15 @@ func (_m *AppConnMempool) FlushAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqR } // FlushSync provides a mock function with given fields: -func (_m *AppConnMempool) FlushSync() (*tmabci.ResponseFlush, error) { +func (_m *AppConnMempool) FlushSync() (*abci.ResponseFlush, error) { ret := _m.Called() - var r0 *tmabci.ResponseFlush - if rf, ok := ret.Get(0).(func() *tmabci.ResponseFlush); ok { + var r0 *abci.ResponseFlush + if rf, ok := ret.Get(0).(func() *abci.ResponseFlush); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseFlush) + r0 = ret.Get(0).(*abci.ResponseFlush) } } diff --git a/proxy/mocks/app_conn_query.go b/proxy/mocks/app_conn_query.go index 3c7100770..f1b137279 100644 --- a/proxy/mocks/app_conn_query.go +++ b/proxy/mocks/app_conn_query.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ) // AppConnQuery is an autogenerated mock type for the AppConnQuery type @@ -14,15 +14,15 @@ type AppConnQuery struct { } // EchoSync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) EchoSync(_a0 string) (*tmabci.ResponseEcho, error) { +func (_m *AppConnQuery) EchoSync(_a0 string) (*abci.ResponseEcho, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseEcho - if rf, ok := ret.Get(0).(func(string) *tmabci.ResponseEcho); ok { + var r0 *abci.ResponseEcho + if rf, ok := ret.Get(0).(func(string) *abci.ResponseEcho); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseEcho) + r0 = ret.Get(0).(*abci.ResponseEcho) } } @@ -51,20 +51,20 @@ func (_m *AppConnQuery) Error() error { } // InfoSync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) InfoSync(_a0 tmabci.RequestInfo) (*tmabci.ResponseInfo, error) { +func (_m *AppConnQuery) InfoSync(_a0 abci.RequestInfo) (*abci.ResponseInfo, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseInfo - if rf, ok := ret.Get(0).(func(tmabci.RequestInfo) *tmabci.ResponseInfo); ok { + var r0 *abci.ResponseInfo + if rf, ok := ret.Get(0).(func(abci.RequestInfo) *abci.ResponseInfo); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseInfo) + r0 = ret.Get(0).(*abci.ResponseInfo) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestInfo) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -74,20 +74,20 @@ func (_m *AppConnQuery) InfoSync(_a0 tmabci.RequestInfo) (*tmabci.ResponseInfo, } // QuerySync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) QuerySync(_a0 tmabci.RequestQuery) (*tmabci.ResponseQuery, error) { +func (_m *AppConnQuery) QuerySync(_a0 abci.RequestQuery) (*abci.ResponseQuery, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseQuery - if rf, ok := ret.Get(0).(func(tmabci.RequestQuery) *tmabci.ResponseQuery); ok { + var r0 *abci.ResponseQuery + if rf, ok := ret.Get(0).(func(abci.RequestQuery) *abci.ResponseQuery); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseQuery) + r0 = ret.Get(0).(*abci.ResponseQuery) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestQuery) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_snapshot.go b/proxy/mocks/app_conn_snapshot.go index dabca0f43..e7779077d 100644 --- a/proxy/mocks/app_conn_snapshot.go +++ b/proxy/mocks/app_conn_snapshot.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ) // AppConnSnapshot is an autogenerated mock type for the AppConnSnapshot type @@ -14,20 +14,20 @@ type AppConnSnapshot struct { } // ApplySnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) ApplySnapshotChunkSync(_a0 tmabci.RequestApplySnapshotChunk) (*tmabci.ResponseApplySnapshotChunk, error) { +func (_m *AppConnSnapshot) ApplySnapshotChunkSync(_a0 abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(tmabci.RequestApplySnapshotChunk) *tmabci.ResponseApplySnapshotChunk); ok { + var r0 *abci.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk) *abci.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*abci.ResponseApplySnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -51,20 +51,20 @@ func (_m *AppConnSnapshot) Error() error { } // ListSnapshotsSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 tmabci.RequestListSnapshots) (*tmabci.ResponseListSnapshots, error) { +func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(tmabci.RequestListSnapshots) *tmabci.ResponseListSnapshots); ok { + var r0 *abci.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots) *abci.ResponseListSnapshots); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseListSnapshots) + r0 = ret.Get(0).(*abci.ResponseListSnapshots) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestListSnapshots) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -74,20 +74,20 @@ func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 tmabci.RequestListSnapshots) (* } // LoadSnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 tmabci.RequestLoadSnapshotChunk) (*tmabci.ResponseLoadSnapshotChunk, error) { +func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(tmabci.RequestLoadSnapshotChunk) *tmabci.ResponseLoadSnapshotChunk); ok { + var r0 *abci.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk) *abci.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*abci.ResponseLoadSnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -97,20 +97,20 @@ func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 tmabci.RequestLoadSnapshotC } // OfferSnapshotSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) OfferSnapshotSync(_a0 tmabci.RequestOfferSnapshot) (*tmabci.ResponseOfferSnapshot, error) { +func (_m *AppConnSnapshot) OfferSnapshotSync(_a0 abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { ret := _m.Called(_a0) - var r0 *tmabci.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(tmabci.RequestOfferSnapshot) *tmabci.ResponseOfferSnapshot); ok { + var r0 *abci.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot) *abci.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tmabci.ResponseOfferSnapshot) + r0 = ret.Get(0).(*abci.ResponseOfferSnapshot) } } var r1 error - if rf, ok := ret.Get(1).(func(tmabci.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestOfferSnapshot) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/version.go b/proxy/version.go index 35601c1ab..476d403ec 100644 --- a/proxy/version.go +++ b/proxy/version.go @@ -1,7 +1,7 @@ package proxy import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/version" ) @@ -9,7 +9,7 @@ import ( // RequestInfo contains all the information for sending // the abci.RequestInfo message during handshake with the app. // It contains only compile-time version information. -var RequestInfo = tmabci.RequestInfo{ +var RequestInfo = abci.RequestInfo{ Version: version.OCCoreSemVer, BlockVersion: version.BlockProtocol, P2PVersion: version.P2PProtocol, diff --git a/rpc/client/event_test.go b/rpc/client/event_test.go index 43b97477a..df48f9fd4 100644 --- a/rpc/client/event_test.go +++ b/rpc/client/event_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/rpc/client" ctypes "github.com/line/ostracon/rpc/core/types" @@ -137,7 +137,7 @@ func testTxEventsSent(t *testing.T, broadcastMethod string) { panic(fmt.Sprintf("Unknown broadcastMethod %s", broadcastMethod)) } if assert.NoError(t, err) { - assert.Equal(t, txres.Code, abci.CodeTypeOK) + assert.Equal(t, txres.Code, ocabci.CodeTypeOK) } }() diff --git a/rpc/client/evidence_test.go b/rpc/client/evidence_test.go index a6f5b826e..005f279fb 100644 --- a/rpc/client/evidence_test.go +++ b/rpc/client/evidence_test.go @@ -6,14 +6,15 @@ import ( "testing" "time" + "github.com/line/ostracon/abci/example/kvstore" + "github.com/line/ostracon/crypto/ed25519" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" - "github.com/line/ostracon/crypto/ed25519" + ocabci "github.com/line/ostracon/abci/types" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" @@ -150,8 +151,8 @@ func TestBroadcastEvidence_DuplicateVoteEvidence(t *testing.T) { qres := result2.Response require.True(t, qres.IsOK()) - var v abci.ValidatorUpdate - err = abci.ReadMessage(bytes.NewReader(qres.Value), &v) + var v ocabci.ValidatorUpdate + err = ocabci.ReadMessage(bytes.NewReader(qres.Value), &v) require.NoError(t, err, "Error reading query result, value %v", qres.Value) pk, err := cryptoenc.PubKeyFromProto(&v.PubKey) diff --git a/rpc/client/mock/abci.go b/rpc/client/mock/abci.go index 18d96cc3c..6f3d78553 100644 --- a/rpc/client/mock/abci.go +++ b/rpc/client/mock/abci.go @@ -3,9 +3,9 @@ package mock import ( "context" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/proxy" "github.com/line/ostracon/rpc/client" @@ -17,7 +17,7 @@ import ( // so you can test app behavior from a client without needing // an entire ostracon node type ABCIApp struct { - App abci.Application + App ocabci.Application } var ( @@ -39,7 +39,7 @@ func (a ABCIApp) ABCIQueryWithOptions( path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error) { - q := a.App.Query(tmabci.RequestQuery{ + q := a.App.Query(abci.RequestQuery{ Data: data, Path: path, Height: opts.Height, @@ -53,23 +53,23 @@ func (a ABCIApp) ABCIQueryWithOptions( // TODO: Make it wait for a commit and set res.Height appropriately. func (a ABCIApp) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { res := ctypes.ResultBroadcastTxCommit{} - res.CheckTx = a.App.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) + res.CheckTx = a.App.CheckTxSync(abci.RequestCheckTx{Tx: tx}) if res.CheckTx.IsErr() { return &res, nil } - res.DeliverTx = a.App.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}) + res.DeliverTx = a.App.DeliverTx(abci.RequestDeliverTx{Tx: tx}) res.Height = -1 // TODO return &res, nil } func (a ABCIApp) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { - chRes := make(chan abci.ResponseCheckTx, 1) - a.App.CheckTxAsync(tmabci.RequestCheckTx{Tx: tx}, func(res abci.ResponseCheckTx) { + chRes := make(chan ocabci.ResponseCheckTx, 1) + a.App.CheckTxAsync(abci.RequestCheckTx{Tx: tx}, func(res ocabci.ResponseCheckTx) { chRes <- res }) c := <-chRes // and this gets written in a background thread... - go func() { a.App.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}) }() + go func() { a.App.DeliverTx(abci.RequestDeliverTx{Tx: tx}) }() return &ctypes.ResultBroadcastTx{ Code: c.Code, Data: c.Data, @@ -80,10 +80,10 @@ func (a ABCIApp) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.Res } func (a ABCIApp) BroadcastTxSync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { - c := a.App.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) + c := a.App.CheckTxSync(abci.RequestCheckTx{Tx: tx}) // and this gets written in a background thread... if !c.IsErr() { - go func() { a.App.DeliverTx(tmabci.RequestDeliverTx{Tx: tx}) }() + go func() { a.App.DeliverTx(abci.RequestDeliverTx{Tx: tx}) }() } return &ctypes.ResultBroadcastTx{ Code: c.Code, @@ -109,7 +109,7 @@ func (m ABCIMock) ABCIInfo(ctx context.Context) (*ctypes.ResultABCIInfo, error) if err != nil { return nil, err } - return &ctypes.ResultABCIInfo{Response: res.(tmabci.ResponseInfo)}, nil + return &ctypes.ResultABCIInfo{Response: res.(abci.ResponseInfo)}, nil } func (m ABCIMock) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error) { @@ -125,7 +125,7 @@ func (m ABCIMock) ABCIQueryWithOptions( if err != nil { return nil, err } - resQuery := res.(tmabci.ResponseQuery) + resQuery := res.(abci.ResponseQuery) return &ctypes.ResultABCIQuery{Response: resQuery}, nil } diff --git a/rpc/client/mock/abci_test.go b/rpc/client/mock/abci_test.go index 11f620e85..a7545f285 100644 --- a/rpc/client/mock/abci_test.go +++ b/rpc/client/mock/abci_test.go @@ -9,10 +9,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/abci/example/kvstore" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/rpc/client" "github.com/line/ostracon/rpc/client/mock" @@ -30,7 +30,7 @@ func TestABCIMock(t *testing.T) { m := mock.ABCIMock{ Info: mock.Call{Error: errors.New("foobar")}, - Query: mock.Call{Response: tmabci.ResponseQuery{ + Query: mock.Call{Response: abci.ResponseQuery{ Key: key, Value: value, Height: height, @@ -39,8 +39,8 @@ func TestABCIMock(t *testing.T) { BroadcastCommit: mock.Call{ Args: goodTx, Response: &ctypes.ResultBroadcastTxCommit{ - CheckTx: abci.ResponseCheckTx{Data: bytes.HexBytes("stand")}, - DeliverTx: tmabci.ResponseDeliverTx{Data: bytes.HexBytes("deliver")}, + CheckTx: ocabci.ResponseCheckTx{Data: bytes.HexBytes("stand")}, + DeliverTx: abci.ResponseDeliverTx{Data: bytes.HexBytes("deliver")}, }, Error: errors.New("bad tx"), }, @@ -85,7 +85,7 @@ func TestABCIRecorder(t *testing.T) { // This mock returns errors on everything but Query m := mock.ABCIMock{ - Info: mock.Call{Response: tmabci.ResponseInfo{ + Info: mock.Call{Response: abci.ResponseInfo{ Data: "data", Version: "v0.9.9", }}, diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index a8b2baadc..b73e871d4 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmjson "github.com/line/ostracon/libs/json" "github.com/line/ostracon/libs/log" tmmath "github.com/line/ostracon/libs/math" @@ -340,7 +340,7 @@ func TestBroadcastTxSync(t *testing.T) { _, _, tx := MakeTxKV() bres, err := c.BroadcastTxSync(context.Background(), tx) require.Nil(err, "%d: %+v", i, err) - require.Equal(bres.Code, abci.CodeTypeOK) // FIXME + require.Equal(bres.Code, ocabci.CodeTypeOK) // FIXME require.Equal(initMempoolSize+1, mempool.Size()) @@ -368,11 +368,11 @@ func TestBroadcastTxCommit(t *testing.T) { func TestUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *abci.Response, 1) + ch := make(chan *ocabci.Response, 1) mempool := node.Mempool() mempool.CheckTxAsync(tx, mempl.TxInfo{}, func(err error) { require.NoError(t, err) - }, func(resp *abci.Response) { + }, func(resp *ocabci.Response) { ch <- resp }) @@ -401,11 +401,11 @@ func TestUnconfirmedTxs(t *testing.T) { func TestNumUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *abci.Response, 1) + ch := make(chan *ocabci.Response, 1) mempool := node.Mempool() mempool.CheckTxAsync(tx, mempl.TxInfo{}, func(err error) { require.NoError(t, err) - }, func(resp *abci.Response) { + }, func(resp *ocabci.Response) { ch <- resp }) @@ -439,7 +439,7 @@ func TestCheckTx(t *testing.T) { res, err := c.CheckTx(context.Background(), tx) require.NoError(t, err) - assert.Equal(t, abci.CodeTypeOK, res.Code) + assert.Equal(t, ocabci.CodeTypeOK, res.Code) assert.Equal(t, 0, mempool.Size(), "mempool must be empty") } diff --git a/rpc/core/abci.go b/rpc/core/abci.go index f05762c4e..e56446907 100644 --- a/rpc/core/abci.go +++ b/rpc/core/abci.go @@ -1,7 +1,7 @@ package core import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/proxy" @@ -18,7 +18,7 @@ func ABCIQuery( height int64, prove bool, ) (*ctypes.ResultABCIQuery, error) { - resQuery, err := env.ProxyAppQuery.QuerySync(tmabci.RequestQuery{ + resQuery, err := env.ProxyAppQuery.QuerySync(abci.RequestQuery{ Path: path, Data: data, Height: height, diff --git a/rpc/core/blocks_test.go b/rpc/core/blocks_test.go index d3d0dbef7..49efd12b8 100644 --- a/rpc/core/blocks_test.go +++ b/rpc/core/blocks_test.go @@ -19,10 +19,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" ocstate "github.com/line/ostracon/proto/ostracon/state" ctypes "github.com/line/ostracon/rpc/core/types" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" @@ -84,13 +84,13 @@ func TestBlockchainInfo(t *testing.T) { func TestBlockResults(t *testing.T) { results := &ocstate.ABCIResponses{ - DeliverTxs: []*tmabci.ResponseDeliverTx{ + DeliverTxs: []*abci.ResponseDeliverTx{ {Code: 0, Data: []byte{0x01}, Log: "ok"}, {Code: 0, Data: []byte{0x02}, Log: "ok"}, {Code: 1, Log: "not ok"}, }, - EndBlock: &abci.ResponseEndBlock{}, - BeginBlock: &tmabci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{}, + BeginBlock: &abci.ResponseBeginBlock{}, } env = &Environment{} @@ -302,7 +302,7 @@ func storeTestBlocks(startHeight, numToMakeBlocks, numToMakeTxs int64, state sm. tx := []byte{byte(height), byte(txIndex)} txs[txIndex] = tx // Indexing - env.TxIndexer.Index(&tmabci.TxResult{Height: height, Index: uint32(txIndex), Tx: tx}) // nolint:errcheck + env.TxIndexer.Index(&abci.TxResult{Height: height, Index: uint32(txIndex), Tx: tx}) // nolint:errcheck } lastCommit := types.NewCommit(lastHeight, round, blockID, commitSigs) block, _ := state.MakeBlock(height, txs, lastCommit, nil, proposer.Address, round, nil) diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index 55715137a..a22cb50a9 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -6,9 +6,9 @@ import ( "fmt" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" mempl "github.com/line/ostracon/mempool" ctypes "github.com/line/ostracon/rpc/core/types" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" @@ -87,10 +87,10 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc return nil, fmt.Errorf("error on broadcastTxCommit: %v", err) } checkTxRes := checkTxResMsg.GetCheckTx() - if checkTxRes.Code != abci.CodeTypeOK { + if checkTxRes.Code != ocabci.CodeTypeOK { return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes, - DeliverTx: tmabci.ResponseDeliverTx{}, + DeliverTx: abci.ResponseDeliverTx{}, Hash: tx.Hash(), }, nil } @@ -116,7 +116,7 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc env.Logger.Error("Error on broadcastTxCommit", "err", err) return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes, - DeliverTx: tmabci.ResponseDeliverTx{}, + DeliverTx: abci.ResponseDeliverTx{}, Hash: tx.Hash(), }, err case <-time.After(env.Config.TimeoutBroadcastTxCommit): @@ -124,7 +124,7 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc env.Logger.Error("Error on broadcastTxCommit", "err", err) return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes, - DeliverTx: tmabci.ResponseDeliverTx{}, + DeliverTx: abci.ResponseDeliverTx{}, Hash: tx.Hash(), }, err } @@ -158,7 +158,7 @@ func NumUnconfirmedTxs(ctx *rpctypes.Context) (*ctypes.ResultUnconfirmedTxs, err // be added to the mempool either. // More: https://docs.tendermint.com/master/rpc/#/Tx/check_tx func CheckTx(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultCheckTx, error) { - res, err := env.ProxyAppMempool.CheckTxSync(tmabci.RequestCheckTx{Tx: tx}) + res, err := env.ProxyAppMempool.CheckTxSync(abci.RequestCheckTx{Tx: tx}) if err != nil { return nil, err } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 421c8f3b4..4b50460c6 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -4,10 +4,10 @@ import ( "encoding/json" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/libs/bytes" "github.com/line/ostracon/p2p" @@ -49,12 +49,12 @@ type ResultCommit struct { // ABCI results from a block type ResultBlockResults struct { - Height int64 `json:"height"` - TxsResults []*tmabci.ResponseDeliverTx `json:"txs_results"` - BeginBlockEvents []tmabci.Event `json:"begin_block_events"` - EndBlockEvents []tmabci.Event `json:"end_block_events"` - ValidatorUpdates []abci.ValidatorUpdate `json:"validator_updates"` - ConsensusParamUpdates *tmabci.ConsensusParams `json:"consensus_param_updates"` + Height int64 `json:"height"` + TxsResults []*abci.ResponseDeliverTx `json:"txs_results"` + BeginBlockEvents []abci.Event `json:"begin_block_events"` + EndBlockEvents []abci.Event `json:"end_block_events"` + ValidatorUpdates []ocabci.ValidatorUpdate `json:"validator_updates"` + ConsensusParamUpdates *abci.ConsensusParams `json:"consensus_param_updates"` } // NewResultCommit is a helper to initialize the ResultCommit with @@ -181,25 +181,25 @@ type ResultBroadcastTx struct { // CheckTx and DeliverTx results type ResultBroadcastTxCommit struct { - CheckTx abci.ResponseCheckTx `json:"check_tx"` - DeliverTx tmabci.ResponseDeliverTx `json:"deliver_tx"` - Hash bytes.HexBytes `json:"hash"` - Height int64 `json:"height"` + CheckTx ocabci.ResponseCheckTx `json:"check_tx"` + DeliverTx abci.ResponseDeliverTx `json:"deliver_tx"` + Hash bytes.HexBytes `json:"hash"` + Height int64 `json:"height"` } -// ResultCheckTx wraps abci.ResponseCheckTx. +// ResultCheckTx wraps ocabci.ResponseCheckTx. type ResultCheckTx struct { - abci.ResponseCheckTx + ocabci.ResponseCheckTx } // Result of querying for a tx type ResultTx struct { - Hash bytes.HexBytes `json:"hash"` - Height int64 `json:"height"` - Index uint32 `json:"index"` - TxResult tmabci.ResponseDeliverTx `json:"tx_result"` - Tx types.Tx `json:"tx"` - Proof types.TxProof `json:"proof,omitempty"` + Hash bytes.HexBytes `json:"hash"` + Height int64 `json:"height"` + Index uint32 `json:"index"` + TxResult abci.ResponseDeliverTx `json:"tx_result"` + Tx types.Tx `json:"tx"` + Proof types.TxProof `json:"proof,omitempty"` } // Result of searching for txs @@ -222,14 +222,14 @@ type ResultUnconfirmedTxs struct { Txs []types.Tx `json:"txs"` } -// Info abci msg +// Info ocabci msg type ResultABCIInfo struct { - Response tmabci.ResponseInfo `json:"response"` + Response abci.ResponseInfo `json:"response"` } -// Query abci msg +// Query ocabci msg type ResultABCIQuery struct { - Response tmabci.ResponseQuery `json:"response"` + Response abci.ResponseQuery `json:"response"` } // Result of broadcasting evidence diff --git a/rpc/grpc/api.go b/rpc/grpc/api.go index 363c656ee..35fe31736 100644 --- a/rpc/grpc/api.go +++ b/rpc/grpc/api.go @@ -3,9 +3,9 @@ package coregrpc import ( "context" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" core "github.com/line/ostracon/rpc/core" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" ) @@ -27,12 +27,12 @@ func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcast } return &ResponseBroadcastTx{ - CheckTx: &abci.ResponseCheckTx{ + CheckTx: &ocabci.ResponseCheckTx{ Code: res.CheckTx.Code, Data: res.CheckTx.Data, Log: res.CheckTx.Log, }, - DeliverTx: &tmabci.ResponseDeliverTx{ + DeliverTx: &abci.ResponseDeliverTx{ Code: res.DeliverTx.Code, Data: res.DeliverTx.Data, Log: res.DeliverTx.Log, diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index 88391dea8..dd5f71e9f 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -8,7 +8,8 @@ import ( "strings" "time" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" + cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" @@ -115,7 +116,7 @@ func GetGRPCClient() core_grpc.BroadcastAPIClient { } // StartOstracon starts a test ostracon server in a go routine and returns when it is initialized -func StartOstracon(app abci.Application, opts ...func(*Options)) *nm.Node { +func StartOstracon(app ocabci.Application, opts ...func(*Options)) *nm.Node { nodeOpts := defaultOptions for _, opt := range opts { opt(&nodeOpts) @@ -148,7 +149,7 @@ func StopOstracon(node *nm.Node) { } // NewOstracon creates a new ostracon server and sleeps forever -func NewOstracon(app abci.Application, opts *Options) *nm.Node { +func NewOstracon(app ocabci.Application, opts *Options) *nm.Node { // Create & start node config := GetConfig(opts.recreateConfig) var logger log.Logger diff --git a/state/execution.go b/state/execution.go index 91f8a071d..1c7a8d3ba 100644 --- a/state/execution.go +++ b/state/execution.go @@ -5,11 +5,13 @@ import ( "fmt" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" + canonictime "github.com/line/ostracon/types/time" + + ocabci "github.com/line/ostracon/abci/types" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/vrf" "github.com/line/ostracon/libs/fail" @@ -18,7 +20,6 @@ import ( ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" - canonictime "github.com/line/ostracon/types/time" ) //----------------------------------------------------------------------------- @@ -274,7 +275,7 @@ func (blockExec *BlockExecutor) ApplyBlock( func (blockExec *BlockExecutor) Commit( state State, block *types.Block, - deliverTxResponses []*tmabci.ResponseDeliverTx, + deliverTxResponses []*abci.ResponseDeliverTx, stepTimes *CommitStepTimes, ) ([]byte, int64, error) { blockExec.mempool.Lock() @@ -348,17 +349,17 @@ func execBlockOnProxyApp( txIndex := 0 abciResponses := new(ocstate.ABCIResponses) - dtxs := make([]*tmabci.ResponseDeliverTx, len(block.Txs)) + dtxs := make([]*abci.ResponseDeliverTx, len(block.Txs)) abciResponses.DeliverTxs = dtxs // Execute transactions and get hash. - proxyCb := func(req *abci.Request, res *abci.Response) { - if r, ok := res.Value.(*abci.Response_DeliverTx); ok { + proxyCb := func(req *ocabci.Request, res *ocabci.Response) { + if r, ok := res.Value.(*ocabci.Response_DeliverTx); ok { // TODO: make use of res.Log // TODO: make use of this info // Blocks may include invalid txs. txRes := r.DeliverTx - if txRes.Code == abci.CodeTypeOK { + if txRes.Code == ocabci.CodeTypeOK { validTxs++ } else { logger.Debug("invalid tx", "code", txRes.Code, "log", txRes.Log) @@ -373,7 +374,7 @@ func execBlockOnProxyApp( commitInfo := getBeginBlockValidatorInfo(block, store, initialHeight) - byzVals := make([]abci.Evidence, 0) + byzVals := make([]ocabci.Evidence, 0) for _, evidence := range block.Evidence.Evidence { byzVals = append(byzVals, evidence.ABCI()...) } @@ -385,7 +386,7 @@ func execBlockOnProxyApp( return nil, errors.New("nil header") } - abciResponses.BeginBlock, err = proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{ + abciResponses.BeginBlock, err = proxyAppConn.BeginBlockSync(ocabci.RequestBeginBlock{ Hash: block.Hash(), Header: *pbh, LastCommitInfo: commitInfo, @@ -399,7 +400,7 @@ func execBlockOnProxyApp( startTime := time.Now() // run txs of block for _, tx := range block.Txs { - proxyAppConn.DeliverTxAsync(tmabci.RequestDeliverTx{Tx: tx}, nil) + proxyAppConn.DeliverTxAsync(abci.RequestDeliverTx{Tx: tx}, nil) if err := proxyAppConn.Error(); err != nil { return nil, err } @@ -408,7 +409,7 @@ func execBlockOnProxyApp( execTime := endTime.Sub(startTime) // End block. - abciResponses.EndBlock, err = proxyAppConn.EndBlockSync(tmabci.RequestEndBlock{Height: block.Height}) + abciResponses.EndBlock, err = proxyAppConn.EndBlockSync(abci.RequestEndBlock{Height: block.Height}) if err != nil { logger.Error("error in proxyAppConn.EndBlock", "err", err) return nil, err @@ -424,8 +425,8 @@ func execBlockOnProxyApp( } func getBeginBlockValidatorInfo(block *types.Block, store Store, - initialHeight int64) abci.LastCommitInfo { - voteInfos := make([]abci.VoteInfo, block.LastCommit.Size()) + initialHeight int64) ocabci.LastCommitInfo { + voteInfos := make([]ocabci.VoteInfo, block.LastCommit.Size()) // Initial block -> LastCommitInfo.Votes are empty. // Remember that the first LastCommit is intentionally empty, so it makes // sense for LastCommitInfo.Votes to also be empty. @@ -450,20 +451,20 @@ func getBeginBlockValidatorInfo(block *types.Block, store Store, for i, val := range lastValSet.Validators { commitSig := block.LastCommit.Signatures[i] - voteInfos[i] = abci.VoteInfo{ + voteInfos[i] = ocabci.VoteInfo{ Validator: types.OC2PB.Validator(val), SignedLastBlock: !commitSig.Absent(), } } } - return abci.LastCommitInfo{ + return ocabci.LastCommitInfo{ Round: block.LastCommit.Round, Votes: voteInfos, } } -func validateValidatorUpdates(abciUpdates []abci.ValidatorUpdate, +func validateValidatorUpdates(abciUpdates []ocabci.ValidatorUpdate, params tmproto.ValidatorParams) error { for _, valUpdate := range abciUpdates { if valUpdate.GetPower() < 0 { @@ -600,7 +601,7 @@ func fireEvents( } for i, tx := range block.Data.Txs { - if err := eventBus.PublishEventTx(types.EventDataTx{TxResult: tmabci.TxResult{ + if err := eventBus.PublishEventTx(types.EventDataTx{TxResult: abci.TxResult{ Height: block.Height, Index: uint32(i), Tx: tx, diff --git a/state/execution_test.go b/state/execution_test.go index 3fd794518..404251d39 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -9,11 +9,11 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -183,16 +183,16 @@ func TestBeginBlockByzantineValidators(t *testing.T) { ev := []types.Evidence{dve, lcae} - abciEv := []abci.Evidence{ + abciEv := []ocabci.Evidence{ { - Type: tmabci.EvidenceType_DUPLICATE_VOTE, + Type: abci.EvidenceType_DUPLICATE_VOTE, Height: 3, Time: defaultEvidenceTime, Validator: types.OC2PB.Validator(state.Validators.Validators[0]), TotalVotingPower: 10, }, { - Type: tmabci.EvidenceType_LIGHT_CLIENT_ATTACK, + Type: abci.EvidenceType_LIGHT_CLIENT_ATTACK, Height: 8, Time: defaultEvidenceTime, Validator: types.OC2PB.Validator(state.Validators.Validators[0]), @@ -228,9 +228,9 @@ func TestBeginBlockByzantineValidators(t *testing.T) { testCases := []struct { desc string evidence []types.Evidence - expectedByzantineValidators []abci.Evidence + expectedByzantineValidators []ocabci.Evidence }{ - {"none byzantine", []types.Evidence{}, []abci.Evidence{}}, + {"none byzantine", []types.Evidence{}, []ocabci.Evidence{}}, {"one byzantine", []types.Evidence{&ev1}, ev1.ABCI()}, {"multiple byzantine", []types.Evidence{&ev1, &ev2}, append(ev1.ABCI(), ev2.ABCI()...)}, } @@ -293,32 +293,32 @@ func TestValidateValidatorUpdates(t *testing.T) { testCases := []struct { name string - abciUpdates []abci.ValidatorUpdate + abciUpdates []ocabci.ValidatorUpdate validatorParams tmproto.ValidatorParams shouldErr bool }{ { "adding a validator is OK", - []abci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, + []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, defaultValidatorParams, false, }, { "updating a validator is OK", - []abci.ValidatorUpdate{{PubKey: pk1, Power: 20}}, + []ocabci.ValidatorUpdate{{PubKey: pk1, Power: 20}}, defaultValidatorParams, false, }, { "removing a validator is OK", - []abci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, + []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, defaultValidatorParams, false, }, { "adding a validator with negative power results in error", - []abci.ValidatorUpdate{{PubKey: pk2, Power: -100}}, + []ocabci.ValidatorUpdate{{PubKey: pk2, Power: -100}}, defaultValidatorParams, true, }, @@ -352,7 +352,7 @@ func TestUpdateValidators(t *testing.T) { name string currentSet *types.ValidatorSet - abciUpdates []abci.ValidatorUpdate + abciUpdates []ocabci.ValidatorUpdate resultingSet *types.ValidatorSet shouldErr bool @@ -360,28 +360,28 @@ func TestUpdateValidators(t *testing.T) { { "adding a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []abci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, + []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, types.NewValidatorSet([]*types.Validator{val1, val2}), false, }, { "updating a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []abci.ValidatorUpdate{{PubKey: pk, Power: 20}}, + []ocabci.ValidatorUpdate{{PubKey: pk, Power: 20}}, types.NewValidatorSet([]*types.Validator{types.NewValidator(pubkey1, 20)}), false, }, { "removing a validator is OK", types.NewValidatorSet([]*types.Validator{val1, val2}), - []abci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, + []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), false, }, { "removing a non-existing validator results in error", types.NewValidatorSet([]*types.Validator{val1}), - []abci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, + []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), true, }, @@ -450,7 +450,7 @@ func TestEndBlockValidatorUpdates(t *testing.T) { pubkey := ed25519.GenPrivKey().PubKey() pk, err := cryptoenc.PubKeyToProto(pubkey) require.NoError(t, err) - app.ValidatorUpdates = []abci.ValidatorUpdate{ + app.ValidatorUpdates = []ocabci.ValidatorUpdate{ {PubKey: pk, Power: 10}, } @@ -506,7 +506,7 @@ func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { vp, err := cryptoenc.PubKeyToProto(state.Validators.Validators[0].PubKey) require.NoError(t, err) // Remove the only validator - app.ValidatorUpdates = []abci.ValidatorUpdate{ + app.ValidatorUpdates = []ocabci.ValidatorUpdate{ {PubKey: vp, Power: 0}, } diff --git a/state/export_test.go b/state/export_test.go index 1de36fcfb..0b9206621 100644 --- a/state/export_test.go +++ b/state/export_test.go @@ -4,7 +4,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/types" ) @@ -36,7 +36,7 @@ func UpdateState( // ValidateValidatorUpdates is an alias for validateValidatorUpdates exported // from execution.go, exclusively and explicitly for testing. -func ValidateValidatorUpdates(abciUpdates []abci.ValidatorUpdate, params tmproto.ValidatorParams) error { +func ValidateValidatorUpdates(abciUpdates []ocabci.ValidatorUpdate, params tmproto.ValidatorParams) error { return validateValidatorUpdates(abciUpdates, params) } diff --git a/state/helpers_test.go b/state/helpers_test.go index 57284786c..b90b997b7 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -5,11 +5,11 @@ import ( "fmt" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" tmrand "github.com/line/ostracon/libs/rand" @@ -176,14 +176,14 @@ func makeHeaderPartsResponsesValPubKeyChange( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } // If the pubkey is new, remove the old and add the new. _, val := state.NextValidators.GetByIndex(0) if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) { - abciResponses.EndBlock = &abci.ResponseEndBlock{ - ValidatorUpdates: []abci.ValidatorUpdate{ + abciResponses.EndBlock = &ocabci.ResponseEndBlock{ + ValidatorUpdates: []ocabci.ValidatorUpdate{ types.OC2PB.NewValidatorUpdate(val.PubKey, 0), types.OC2PB.NewValidatorUpdate(pubkey, 10), }, @@ -200,15 +200,15 @@ func makeHeaderPartsResponsesValPowerChange( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } // If the pubkey is new, remove the old and add the new. _, val := state.NextValidators.GetByIndex(0) if val.VotingPower != power { - abciResponses.EndBlock = &abci.ResponseEndBlock{ - ValidatorUpdates: []abci.ValidatorUpdate{ + abciResponses.EndBlock = &ocabci.ResponseEndBlock{ + ValidatorUpdates: []ocabci.ValidatorUpdate{ types.OC2PB.NewValidatorUpdate(val.PubKey, power), }, } @@ -224,8 +224,8 @@ func makeHeaderPartsResponsesParams( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ConsensusParamUpdates: types.OC2PB.ConsensusParams(¶ms)}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ConsensusParamUpdates: types.OC2PB.ConsensusParams(¶ms)}, } return block.Header, types.BlockID{Hash: block.Hash(), PartSetHeader: types.PartSetHeader{}}, abciResponses } @@ -250,50 +250,50 @@ func randomGenesisDoc() *types.GenesisDoc { //---------------------------------------------------------------------------- type testApp struct { - abci.BaseApplication + ocabci.BaseApplication - CommitVotes []abci.VoteInfo - ByzantineValidators []abci.Evidence - ValidatorUpdates []abci.ValidatorUpdate + CommitVotes []ocabci.VoteInfo + ByzantineValidators []ocabci.Evidence + ValidatorUpdates []ocabci.ValidatorUpdate } -var _ abci.Application = (*testApp)(nil) +var _ ocabci.Application = (*testApp)(nil) var TestAppVersion uint64 = 66 -func (app *testApp) Info(req tmabci.RequestInfo) (resInfo tmabci.ResponseInfo) { - return tmabci.ResponseInfo{} +func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { + return abci.ResponseInfo{} } -func (app *testApp) BeginBlock(req abci.RequestBeginBlock) tmabci.ResponseBeginBlock { +func (app *testApp) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { app.CommitVotes = req.LastCommitInfo.Votes app.ByzantineValidators = req.ByzantineValidators - return tmabci.ResponseBeginBlock{} + return abci.ResponseBeginBlock{} } -func (app *testApp) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { - return abci.ResponseEndBlock{ +func (app *testApp) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { + return ocabci.ResponseEndBlock{ ValidatorUpdates: app.ValidatorUpdates, - ConsensusParamUpdates: &tmabci.ConsensusParams{ + ConsensusParamUpdates: &abci.ConsensusParams{ Version: &tmproto.VersionParams{ AppVersion: TestAppVersion}}} } -func (app *testApp) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { - return tmabci.ResponseDeliverTx{Events: []tmabci.Event{}} +func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { + return abci.ResponseDeliverTx{Events: []abci.Event{}} } -func (app *testApp) CheckTxSync(req tmabci.RequestCheckTx) abci.ResponseCheckTx { - return abci.ResponseCheckTx{} +func (app *testApp) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { + return ocabci.ResponseCheckTx{} } -func (app *testApp) CheckTxAsync(req tmabci.RequestCheckTx, callback abci.CheckTxCallback) { - callback(abci.ResponseCheckTx{}) +func (app *testApp) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { + callback(ocabci.ResponseCheckTx{}) } -func (app *testApp) Commit() tmabci.ResponseCommit { - return tmabci.ResponseCommit{RetainHeight: 1} +func (app *testApp) Commit() abci.ResponseCommit { + return abci.ResponseCommit{RetainHeight: 1} } -func (app *testApp) Query(reqQuery tmabci.RequestQuery) (resQuery tmabci.ResponseQuery) { +func (app *testApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { return } diff --git a/state/indexer/block/kv/kv.go b/state/indexer/block/kv/kv.go index 56423a7d4..d90a4304c 100644 --- a/state/indexer/block/kv/kv.go +++ b/state/indexer/block/kv/kv.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/google/orderedcode" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/libs/pubsub/query" @@ -453,7 +453,7 @@ func (idx *BlockerIndexer) match( return filteredHeights, nil } -func (idx *BlockerIndexer) indexEvents(batch dbm.Batch, events []tmabci.Event, typ string, height int64) error { +func (idx *BlockerIndexer) indexEvents(batch dbm.Batch, events []abci.Event, typ string, height int64) error { heightBz := int64ToBytes(height) for _, event := range events { diff --git a/state/indexer/block/kv/kv_test.go b/state/indexer/block/kv/kv_test.go index 8d1431b0c..4fec2cf8a 100644 --- a/state/indexer/block/kv/kv_test.go +++ b/state/indexer/block/kv/kv_test.go @@ -6,10 +6,10 @@ import ( "testing" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/pubsub/query" blockidxkv "github.com/line/ostracon/state/indexer/block/kv" "github.com/line/ostracon/types" @@ -20,11 +20,11 @@ func TestBlockIndexer(t *testing.T) { indexer := blockidxkv.New(store) require.NoError(t, indexer.Index(types.EventDataNewBlockHeader{ Header: types.Header{Height: 1}, - ResultBeginBlock: tmabci.ResponseBeginBlock{ - Events: []tmabci.Event{ + ResultBeginBlock: abci.ResponseBeginBlock{ + Events: []abci.Event{ { Type: "begin_event", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ { Key: []byte("proposer"), Value: []byte("FCAA001"), @@ -34,11 +34,11 @@ func TestBlockIndexer(t *testing.T) { }, }, }, - ResultEndBlock: abci.ResponseEndBlock{ - Events: []tmabci.Event{ + ResultEndBlock: ocabci.ResponseEndBlock{ + Events: []abci.Event{ { Type: "end_event", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ { Key: []byte("foo"), Value: []byte("100"), @@ -58,11 +58,11 @@ func TestBlockIndexer(t *testing.T) { require.NoError(t, indexer.Index(types.EventDataNewBlockHeader{ Header: types.Header{Height: int64(i)}, - ResultBeginBlock: tmabci.ResponseBeginBlock{ - Events: []tmabci.Event{ + ResultBeginBlock: abci.ResponseBeginBlock{ + Events: []abci.Event{ { Type: "begin_event", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ { Key: []byte("proposer"), Value: []byte("FCAA001"), @@ -72,11 +72,11 @@ func TestBlockIndexer(t *testing.T) { }, }, }, - ResultEndBlock: abci.ResponseEndBlock{ - Events: []tmabci.Event{ + ResultEndBlock: ocabci.ResponseEndBlock{ + Events: []abci.Event{ { Type: "end_event", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ { Key: []byte("foo"), Value: []byte(fmt.Sprintf("%d", i)), diff --git a/state/indexer/sink/psql/backport.go b/state/indexer/sink/psql/backport.go index cffd1875b..57c85b775 100644 --- a/state/indexer/sink/psql/backport.go +++ b/state/indexer/sink/psql/backport.go @@ -17,7 +17,7 @@ import ( "context" "errors" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/txindex" @@ -44,19 +44,19 @@ func (b BackportTxIndexer) AddBatch(batch *txindex.Batch) error { } // Index indexes a single transaction result in Postgres, as part of TxIndexer. -func (b BackportTxIndexer) Index(txr *tmabci.TxResult) error { - return b.psql.IndexTxEvents([]*tmabci.TxResult{txr}) +func (b BackportTxIndexer) Index(txr *abci.TxResult) error { + return b.psql.IndexTxEvents([]*abci.TxResult{txr}) } // Get is implemented to satisfy the TxIndexer interface, but is not supported // by the psql event sink and reports an error for all inputs. -func (BackportTxIndexer) Get([]byte) (*tmabci.TxResult, error) { +func (BackportTxIndexer) Get([]byte) (*abci.TxResult, error) { return nil, errors.New("the TxIndexer.Get method is not supported") } // Search is implemented to satisfy the TxIndexer interface, but it is not // supported by the psql event sink and reports an error for all inputs. -func (BackportTxIndexer) Search(context.Context, *query.Query) ([]*tmabci.TxResult, error) { +func (BackportTxIndexer) Search(context.Context, *query.Query) ([]*abci.TxResult, error) { return nil, errors.New("the TxIndexer.Search method is not supported") } diff --git a/state/indexer/sink/psql/backport_test.go b/state/indexer/sink/psql/backport_test.go index 24f7660a1..d4834a69b 100644 --- a/state/indexer/sink/psql/backport_test.go +++ b/state/indexer/sink/psql/backport_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/indexer" @@ -28,14 +28,14 @@ func TestBackportTxIndexer_AddBatch(t *testing.T) { func TestBackportTxIndexer_Index(t *testing.T) { indexer := &EventSink{store: testDB(), chainID: chainID} txIndexer := indexer.TxIndexer() - err := txIndexer.Index(&tmabci.TxResult{}) + err := txIndexer.Index(&abci.TxResult{}) require.Error(t, err) require.Contains(t, err.Error(), "finding block ID: ") blockIndexer := indexer.BlockIndexer() err = blockIndexer.Index(types.EventDataNewBlockHeader{}) require.NoError(t, err) - err = txIndexer.Index(&tmabci.TxResult{}) + err = txIndexer.Index(&abci.TxResult{}) require.NoError(t, err) } diff --git a/state/indexer/sink/psql/psql.go b/state/indexer/sink/psql/psql.go index ed61944d3..d1641667c 100644 --- a/state/indexer/sink/psql/psql.go +++ b/state/indexer/sink/psql/psql.go @@ -9,7 +9,7 @@ import ( "strings" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/gogo/protobuf/proto" "github.com/line/ostracon/libs/pubsub/query" @@ -83,7 +83,7 @@ func queryWithID(tx *sql.Tx, query string, args ...interface{}) (uint32, error) // // If txID > 0, the event is attributed to the Tendermint transaction with that // ID; otherwise it is recorded as a block event. -func insertEvents(dbtx *sql.Tx, blockID, txID uint32, evts []tmabci.Event) error { +func insertEvents(dbtx *sql.Tx, blockID, txID uint32, evts []abci.Event) error { // Populate the transaction ID field iff one is defined (> 0). var txIDArg interface{} if txID > 0 { @@ -127,12 +127,12 @@ INSERT INTO `+tableAttributes+` (event_id, key, composite_key, value) // value. If the key has the form "type.name", the event will have a single // attribute with that name and the value; otherwise the event will have only // a type and no attributes. -func makeIndexedEvent(compositeKey, value string) tmabci.Event { +func makeIndexedEvent(compositeKey, value string) abci.Event { i := strings.Index(compositeKey, ".") if i < 0 { - return tmabci.Event{Type: compositeKey} + return abci.Event{Type: compositeKey} } - return tmabci.Event{Type: compositeKey[:i], Attributes: []tmabci.EventAttribute{ + return abci.Event{Type: compositeKey[:i], Attributes: []abci.EventAttribute{ {Key: []byte(compositeKey[i+1:]), Value: []byte(value), Index: true}, }} } @@ -158,7 +158,7 @@ INSERT INTO `+tableBlocks+` (height, chain_id, created_at) } // Insert the special block meta-event for height. - if err := insertEvents(dbtx, blockID, 0, []tmabci.Event{ + if err := insertEvents(dbtx, blockID, 0, []abci.Event{ makeIndexedEvent(types.BlockHeightKey, fmt.Sprint(h.Header.Height)), }); err != nil { return fmt.Errorf("block meta-events: %w", err) @@ -174,7 +174,7 @@ INSERT INTO `+tableBlocks+` (height, chain_id, created_at) }) } -func (es *EventSink) IndexTxEvents(txrs []*tmabci.TxResult) error { +func (es *EventSink) IndexTxEvents(txrs []*abci.TxResult) error { ts := time.Now().UTC() for _, txr := range txrs { @@ -211,7 +211,7 @@ INSERT INTO `+tableTxResults+` (block_id, index, created_at, tx_hash, tx_result) } // Insert the special transaction meta-events for hash and height. - if err := insertEvents(dbtx, blockID, txID, []tmabci.Event{ + if err := insertEvents(dbtx, blockID, txID, []abci.Event{ makeIndexedEvent(types.TxHashKey, txHash), makeIndexedEvent(types.TxHeightKey, fmt.Sprint(txr.Height)), }); err != nil { @@ -236,12 +236,12 @@ func (es *EventSink) SearchBlockEvents(ctx context.Context, q *query.Query) ([]i } // SearchTxEvents is not implemented by this sink, and reports an error for all queries. -func (es *EventSink) SearchTxEvents(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) { +func (es *EventSink) SearchTxEvents(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) { return nil, errors.New("tx search is not supported via the postgres event sink") } // GetTxByHash is not implemented by this sink, and reports an error for all queries. -func (es *EventSink) GetTxByHash(hash []byte) (*tmabci.TxResult, error) { +func (es *EventSink) GetTxByHash(hash []byte) (*abci.TxResult, error) { return nil, errors.New("getTxByHash is not supported via the postgres event sink") } diff --git a/state/indexer/sink/psql/psql_test.go b/state/indexer/sink/psql/psql_test.go index 6652bf78f..90d63c2e1 100644 --- a/state/indexer/sink/psql/psql_test.go +++ b/state/indexer/sink/psql/psql_test.go @@ -12,11 +12,11 @@ import ( "testing" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/adlio/schema" "github.com/gogo/protobuf/proto" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/types" "github.com/ory/dockertest" "github.com/ory/dockertest/docker" @@ -161,12 +161,12 @@ func TestIndexing(t *testing.T) { t.Run("IndexTxEvents", func(t *testing.T) { indexer := &EventSink{store: testDB(), chainID: chainID} - txResult := txResultWithEvents([]tmabci.Event{ + txResult := txResultWithEvents([]abci.Event{ makeIndexedEvent("account.number", "1"), makeIndexedEvent("account.owner", "Ivan"), makeIndexedEvent("account.owner", "Yulieta"), - {Type: "", Attributes: []tmabci.EventAttribute{ + {Type: "", Attributes: []abci.EventAttribute{ { Key: []byte("not_allowed"), Value: []byte("Vlad"), @@ -174,7 +174,7 @@ func TestIndexing(t *testing.T) { }, }}, }) - require.NoError(t, indexer.IndexTxEvents([]*tmabci.TxResult{txResult})) + require.NoError(t, indexer.IndexTxEvents([]*abci.TxResult{txResult})) txr, err := loadTxResult(types.Tx(txResult.Tx).Hash()) require.NoError(t, err) @@ -193,7 +193,7 @@ func TestIndexing(t *testing.T) { }) // try to insert the duplicate tx events. - err = indexer.IndexTxEvents([]*tmabci.TxResult{txResult}) + err = indexer.IndexTxEvents([]*abci.TxResult{txResult}) require.NoError(t, err) }) } @@ -208,14 +208,14 @@ func TestStop(t *testing.T) { func newTestBlockHeader() types.EventDataNewBlockHeader { return types.EventDataNewBlockHeader{ Header: types.Header{Height: 1}, - ResultBeginBlock: tmabci.ResponseBeginBlock{ - Events: []tmabci.Event{ + ResultBeginBlock: abci.ResponseBeginBlock{ + Events: []abci.Event{ makeIndexedEvent("begin_event.proposer", "FCAA001"), makeIndexedEvent("thingy.whatzit", "O.O"), }, }, - ResultEndBlock: abci.ResponseEndBlock{ - Events: []tmabci.Event{ + ResultEndBlock: ocabci.ResponseEndBlock{ + Events: []abci.Event{ makeIndexedEvent("end_event.foo", "100"), makeIndexedEvent("thingy.whatzit", "-.O"), }, @@ -252,21 +252,21 @@ func resetDatabase(db *sql.DB) error { // txResultWithEvents constructs a fresh transaction result with fixed values // for testing, that includes the specified events. -func txResultWithEvents(events []tmabci.Event) *tmabci.TxResult { - return &tmabci.TxResult{ +func txResultWithEvents(events []abci.Event) *abci.TxResult { + return &abci.TxResult{ Height: 1, Index: 0, Tx: types.Tx("HELLO WORLD"), - Result: tmabci.ResponseDeliverTx{ + Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: abci.CodeTypeOK, + Code: ocabci.CodeTypeOK, Log: "", Events: events, }, } } -func loadTxResult(hash []byte) (*tmabci.TxResult, error) { +func loadTxResult(hash []byte) (*abci.TxResult, error) { hashString := fmt.Sprintf("%X", hash) var resultData []byte if err := testDB().QueryRow(` @@ -275,7 +275,7 @@ SELECT tx_result FROM `+tableTxResults+` WHERE tx_hash = $1; return nil, fmt.Errorf("lookup transaction for hash %q failed: %v", hashString, err) } - txr := new(tmabci.TxResult) + txr := new(abci.TxResult) if err := proto.Unmarshal(resultData, txr); err != nil { return nil, fmt.Errorf("unmarshaling txr: %v", err) } diff --git a/state/state_test.go b/state/state_test.go index b833209d8..46f7b0e25 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -108,12 +108,12 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { block := makeBlock(state, 2) abciResponses := new(ocstate.ABCIResponses) - dtxs := make([]*tmabci.ResponseDeliverTx, 2) + dtxs := make([]*abci.ResponseDeliverTx, 2) abciResponses.DeliverTxs = dtxs - abciResponses.DeliverTxs[0] = &tmabci.ResponseDeliverTx{Data: []byte("foo"), Events: nil} - abciResponses.DeliverTxs[1] = &tmabci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Events: nil} - abciResponses.EndBlock = &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{ + abciResponses.DeliverTxs[0] = &abci.ResponseDeliverTx{Data: []byte("foo"), Events: nil} + abciResponses.DeliverTxs[1] = &abci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Events: nil} + abciResponses.EndBlock = &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{ types.OC2PB.NewValidatorUpdate(ed25519.GenPrivKey().PubKey(), 10), }} @@ -137,36 +137,36 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { cases := [...]struct { // Height is implied to equal index+2, // as block 1 is created from genesis. - added []*tmabci.ResponseDeliverTx - expected []*tmabci.ResponseDeliverTx + added []*abci.ResponseDeliverTx + expected []*abci.ResponseDeliverTx }{ 0: { nil, nil, }, 1: { - []*tmabci.ResponseDeliverTx{ + []*abci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, - []*tmabci.ResponseDeliverTx{ + []*abci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello")}, }}, 2: { - []*tmabci.ResponseDeliverTx{ + []*abci.ResponseDeliverTx{ {Code: 383}, { Data: []byte("Gotcha!"), - Events: []tmabci.Event{ - {Type: "type1", Attributes: []tmabci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, - {Type: "type2", Attributes: []tmabci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, + Events: []abci.Event{ + {Type: "type1", Attributes: []abci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, + {Type: "type2", Attributes: []abci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, }, }, }, - []*tmabci.ResponseDeliverTx{ + []*abci.ResponseDeliverTx{ {Code: 383, Data: nil}, - {Code: 0, Data: []byte("Gotcha!"), Events: []tmabci.Event{ - {Type: "type1", Attributes: []tmabci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, - {Type: "type2", Attributes: []tmabci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, + {Code: 0, Data: []byte("Gotcha!"), Events: []abci.Event{ + {Type: "type1", Attributes: []abci.EventAttribute{{Key: []byte("a"), Value: []byte("1")}}}, + {Type: "type2", Attributes: []abci.EventAttribute{{Key: []byte("build"), Value: []byte("stuff")}}}, }}, }}, 3: { @@ -174,7 +174,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { nil, }, 4: { - []*tmabci.ResponseDeliverTx{nil}, + []*abci.ResponseDeliverTx{nil}, nil, }, } @@ -190,9 +190,9 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { for i, tc := range cases { h := int64(i + 1) // last block height, one below what we save responses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, + BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.added, - EndBlock: &abci.ResponseEndBlock{}, + EndBlock: &ocabci.ResponseEndBlock{}, } err := stateStore.SaveABCIResponses(h, responses) require.NoError(t, err) @@ -205,9 +205,9 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { if assert.NoError(err, "%d", i) { t.Log(res) responses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, + BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.expected, - EndBlock: &abci.ResponseEndBlock{}, + EndBlock: &ocabci.ResponseEndBlock{}, } assert.Equal(sm.ABCIResponsesResultsHash(responses), sm.ABCIResponsesResultsHash(res), "%d", i) } @@ -492,8 +492,8 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { block := makeBlock(state, state.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -509,8 +509,8 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { fvp, err := cryptoenc.PubKeyToProto(val2PubKey) require.NoError(t, err) - updateAddVal := abci.ValidatorUpdate{PubKey: fvp, Power: val2VotingPower} - validatorUpdates, err = types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{updateAddVal}) + updateAddVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: val2VotingPower} + validatorUpdates, err = types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{updateAddVal}) assert.NoError(t, err) updatedState2, err := sm.UpdateState(updatedState, blockID, &block.Header, abciResponses, validatorUpdates) assert.NoError(t, err) @@ -545,8 +545,8 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { // Updating a validator does not reset the ProposerPriority to zero: // 1. Add - Val2 VotingPower change to 1 => updatedVotingPowVal2 := int64(1) - updateVal := abci.ValidatorUpdate{PubKey: fvp, Power: updatedVotingPowVal2} - validatorUpdates, err = types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{updateVal}) + updateVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: updatedVotingPowVal2} + validatorUpdates, err = types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{updateVal}) assert.NoError(t, err) // this will cause the diff of priorities (77) @@ -609,8 +609,8 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -628,8 +628,8 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { val2PubKey := ed25519.GenPrivKey().PubKey() fvp, err := cryptoenc.PubKeyToProto(val2PubKey) require.NoError(t, err) - updateAddVal := abci.ValidatorUpdate{PubKey: fvp, Power: val1VotingPower} - validatorUpdates, err = types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{updateAddVal}) + updateAddVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: val1VotingPower} + validatorUpdates, err = types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{updateAddVal}) assert.NoError(t, err) updatedState2, err := sm.UpdateState(updatedState, blockID, &block.Header, abciResponses, validatorUpdates) @@ -712,8 +712,8 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { // -> proposers should alternate: oldState := updatedState3 abciResponses = &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -728,8 +728,8 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { for i := 0; i < 1000; i++ { // no validator updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -787,8 +787,8 @@ func TestLargeGenesisValidator(t *testing.T) { for i := 0; i < 10; i++ { // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -816,12 +816,12 @@ func TestLargeGenesisValidator(t *testing.T) { firstAddedValVotingPower := int64(10) fvp, err := cryptoenc.PubKeyToProto(firstAddedValPubKey) require.NoError(t, err) - firstAddedVal := abci.ValidatorUpdate{PubKey: fvp, Power: firstAddedValVotingPower} - validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{firstAddedVal}) + firstAddedVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: firstAddedValVotingPower} + validatorUpdates, err := types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{firstAddedVal}) assert.NoError(t, err) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{firstAddedVal}}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{firstAddedVal}}, } block := makeBlock(oldState, oldState.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} @@ -832,8 +832,8 @@ func TestLargeGenesisValidator(t *testing.T) { for i := 0; i < 200; i++ { // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -863,13 +863,13 @@ func TestLargeGenesisValidator(t *testing.T) { addedPubKey := ed25519.GenPrivKey().PubKey() ap, err := cryptoenc.PubKeyToProto(addedPubKey) require.NoError(t, err) - addedVal := abci.ValidatorUpdate{PubKey: ap, Power: firstAddedValVotingPower} - validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{addedVal}) + addedVal := ocabci.ValidatorUpdate{PubKey: ap, Power: firstAddedValVotingPower} + validatorUpdates, err := types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{addedVal}) assert.NoError(t, err) abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{addedVal}}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{addedVal}}, } block := makeBlock(oldState, oldState.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} @@ -881,10 +881,10 @@ func TestLargeGenesisValidator(t *testing.T) { // remove genesis validator: gp, err := cryptoenc.PubKeyToProto(genesisPubKey) require.NoError(t, err) - removeGenesisVal := abci.ValidatorUpdate{PubKey: gp, Power: 0} + removeGenesisVal := ocabci.ValidatorUpdate{PubKey: gp, Power: 0} abciResponses = &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{removeGenesisVal}}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{removeGenesisVal}}, } block = makeBlock(oldState, oldState.LastBlockHeight+1) blockID = types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} @@ -902,8 +902,8 @@ func TestLargeGenesisValidator(t *testing.T) { isProposerUnchanged := true for isProposerUnchanged { abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -927,8 +927,8 @@ func TestLargeGenesisValidator(t *testing.T) { for i := 0; i < 100; i++ { // no updates: abciResponses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, + BeginBlock: &abci.ResponseBeginBlock{}, + EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) diff --git a/state/store.go b/state/store.go index 28b3b5030..3d907ac3c 100644 --- a/state/store.go +++ b/state/store.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/gogo/protobuf/proto" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -406,7 +406,7 @@ func (store dbStore) LoadABCIResponses(height int64) (*ocstate.ABCIResponses, er // // Exposed for testing. func (store dbStore) SaveABCIResponses(height int64, abciResponses *ocstate.ABCIResponses) error { - var dtxs []*tmabci.ResponseDeliverTx + var dtxs []*abci.ResponseDeliverTx // strip nil values, for _, tx := range abciResponses.DeliverTxs { if tx != nil { diff --git a/state/store_test.go b/state/store_test.go index a214d9129..3e19e2868 100644 --- a/state/store_test.go +++ b/state/store_test.go @@ -9,12 +9,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -180,7 +180,7 @@ func TestPruneStates(t *testing.T) { currentHeight := state.LastBlockHeight + int64(1) err = stateStore.SaveABCIResponses(currentHeight, &ocstate.ABCIResponses{ - DeliverTxs: []*tmabci.ResponseDeliverTx{ + DeliverTxs: []*abci.ResponseDeliverTx{ {Data: []byte{1}}, {Data: []byte{2}}, {Data: []byte{3}}, @@ -290,11 +290,11 @@ func TestPruneStatesDeleteErrHandle(t *testing.T) { func TestABCIResponsesResultsHash(t *testing.T) { responses := &ocstate.ABCIResponses{ - BeginBlock: &tmabci.ResponseBeginBlock{}, - DeliverTxs: []*tmabci.ResponseDeliverTx{ + BeginBlock: &abci.ResponseBeginBlock{}, + DeliverTxs: []*abci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, - EndBlock: &abci.ResponseEndBlock{}, + EndBlock: &ocabci.ResponseEndBlock{}, } root := sm.ABCIResponsesResultsHash(responses) diff --git a/state/txindex/indexer.go b/state/txindex/indexer.go index ffd8e151f..64ff599c5 100644 --- a/state/txindex/indexer.go +++ b/state/txindex/indexer.go @@ -4,7 +4,7 @@ import ( "context" "errors" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/pubsub/query" ) @@ -17,31 +17,31 @@ type TxIndexer interface { AddBatch(b *Batch) error // Index analyzes, indexes and stores a single transaction. - Index(result *tmabci.TxResult) error + Index(result *abci.TxResult) error // Get returns the transaction specified by hash or nil if the transaction is not indexed // or stored. - Get(hash []byte) (*tmabci.TxResult, error) + Get(hash []byte) (*abci.TxResult, error) // Search allows you to query for transactions. - Search(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) + Search(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) } // Batch groups together multiple Index operations to be performed at the same time. // NOTE: Batch is NOT thread-safe and must not be modified after starting its execution. type Batch struct { - Ops []*tmabci.TxResult + Ops []*abci.TxResult } // NewBatch creates a new Batch. func NewBatch(n int64) *Batch { return &Batch{ - Ops: make([]*tmabci.TxResult, n), + Ops: make([]*abci.TxResult, n), } } // Add or update an entry for the given result.Index. -func (b *Batch) Add(result *tmabci.TxResult) error { +func (b *Batch) Add(result *abci.TxResult) error { b.Ops[result.Index] = result return nil } diff --git a/state/txindex/indexer_service.go b/state/txindex/indexer_service.go index bd3e9b4c8..bb5d17466 100644 --- a/state/txindex/indexer_service.go +++ b/state/txindex/indexer_service.go @@ -3,9 +3,9 @@ package txindex import ( "context" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" "github.com/line/ostracon/state/indexer" "github.com/line/ostracon/types" @@ -111,8 +111,8 @@ func (is *IndexerService) OnStop() { // if the current one under investigation is NOT OK, then we need to check // whether there's a previously indexed tx. // SKIP the current tx if the previously indexed record is found and successful. -func DeduplicateBatch(ops []*tmabci.TxResult, txIdxr TxIndexer) ([]*tmabci.TxResult, error) { - result := make([]*tmabci.TxResult, 0, len(ops)) +func DeduplicateBatch(ops []*abci.TxResult, txIdxr TxIndexer) ([]*abci.TxResult, error) { + result := make([]*abci.TxResult, 0, len(ops)) // keep track of successful txs in this block in order to suppress latter ones being indexed. var successfulTxsInThisBlock = make(map[string]struct{}) @@ -138,7 +138,7 @@ func DeduplicateBatch(ops []*tmabci.TxResult, txIdxr TxIndexer) ([]*tmabci.TxRes } // if it's already indexed in an older block and was successful, skip. - if old != nil && old.Result.Code == abci.CodeTypeOK { + if old != nil && old.Result.Code == ocabci.CodeTypeOK { continue } } diff --git a/state/txindex/indexer_service_test.go b/state/txindex/indexer_service_test.go index ff26ceb16..1947153eb 100644 --- a/state/txindex/indexer_service_test.go +++ b/state/txindex/indexer_service_test.go @@ -5,10 +5,10 @@ import ( "time" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" blockidxkv "github.com/line/ostracon/state/indexer/block/kv" "github.com/line/ostracon/state/txindex" @@ -49,19 +49,19 @@ func TestIndexerServiceIndexesBlocks(t *testing.T) { NumTxs: int64(2), }) require.NoError(t, err) - txResult1 := &tmabci.TxResult{ + txResult1 := &abci.TxResult{ Height: 1, Index: uint32(0), Tx: types.Tx("foo"), - Result: tmabci.ResponseDeliverTx{Code: 0}, + Result: abci.ResponseDeliverTx{Code: 0}, } err = eventBus.PublishEventTx(types.EventDataTx{TxResult: *txResult1}) require.NoError(t, err) - txResult2 := &tmabci.TxResult{ + txResult2 := &abci.TxResult{ Height: 1, Index: uint32(1), Tx: types.Tx("bar"), - Result: tmabci.ResponseDeliverTx{Code: 0}, + Result: abci.ResponseDeliverTx{Code: 0}, } err = eventBus.PublishEventTx(types.EventDataTx{TxResult: *txResult2}) require.NoError(t, err) @@ -86,120 +86,120 @@ func TestTxIndexDuplicatePreviouslySuccessful(t *testing.T) { testCases := []struct { name string - tx1 tmabci.TxResult - tx2 tmabci.TxResult + tx1 abci.TxResult + tx2 abci.TxResult expSkip bool // do we expect the second tx to be skipped by tx indexer }{ {"skip, previously successful", - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK, }, }, - tmabci.TxResult{ + abci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK + 1, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK + 1, }, }, true, }, {"not skip, previously unsuccessful", - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK + 1, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK + 1, }, }, - tmabci.TxResult{ + abci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK + 1, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK + 1, }, }, false, }, {"not skip, both successful", - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK, }, }, - tmabci.TxResult{ + abci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK, }, }, false, }, {"not skip, both unsuccessful", - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK + 1, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK + 1, }, }, - tmabci.TxResult{ + abci.TxResult{ Height: 2, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK + 1, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK + 1, }, }, false, }, {"skip, same block, previously successful", - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK, }, }, - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK + 1, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK + 1, }, }, true, }, {"not skip, same block, previously unsuccessful", - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK + 1, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK + 1, }, }, - tmabci.TxResult{ + abci.TxResult{ Height: 1, Index: 0, Tx: mockTx, - Result: tmabci.ResponseDeliverTx{ - Code: abci.CodeTypeOK, + Result: abci.ResponseDeliverTx{ + Code: ocabci.CodeTypeOK, }, }, false, @@ -213,29 +213,29 @@ func TestTxIndexDuplicatePreviouslySuccessful(t *testing.T) { if tc.tx1.Height != tc.tx2.Height { // index the first tx err := indexer.AddBatch(&txindex.Batch{ - Ops: []*tmabci.TxResult{&tc.tx1}, + Ops: []*abci.TxResult{&tc.tx1}, }) require.NoError(t, err) // check if the second one should be skipped. - ops, err := txindex.DeduplicateBatch([]*tmabci.TxResult{&tc.tx2}, indexer) + ops, err := txindex.DeduplicateBatch([]*abci.TxResult{&tc.tx2}, indexer) require.NoError(t, err) if tc.expSkip { require.Empty(t, ops) } else { - require.Equal(t, []*tmabci.TxResult{&tc.tx2}, ops) + require.Equal(t, []*abci.TxResult{&tc.tx2}, ops) } } else { // same block - ops := []*tmabci.TxResult{&tc.tx1, &tc.tx2} + ops := []*abci.TxResult{&tc.tx1, &tc.tx2} ops, err := txindex.DeduplicateBatch(ops, indexer) require.NoError(t, err) if tc.expSkip { // the second one is skipped - require.Equal(t, []*tmabci.TxResult{&tc.tx1}, ops) + require.Equal(t, []*abci.TxResult{&tc.tx1}, ops) } else { - require.Equal(t, []*tmabci.TxResult{&tc.tx1, &tc.tx2}, ops) + require.Equal(t, []*abci.TxResult{&tc.tx1, &tc.tx2}, ops) } } }) diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index 9636ad24e..0f2b5ce17 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/gogo/protobuf/proto" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/libs/pubsub/query" @@ -38,7 +38,7 @@ func NewTxIndex(store dbm.DB) *TxIndex { // Get gets transaction from the TxIndex storage and returns it or nil if the // transaction is not found. -func (txi *TxIndex) Get(hash []byte) (*tmabci.TxResult, error) { +func (txi *TxIndex) Get(hash []byte) (*abci.TxResult, error) { if len(hash) == 0 { return nil, txindex.ErrorEmptyHash } @@ -51,7 +51,7 @@ func (txi *TxIndex) Get(hash []byte) (*tmabci.TxResult, error) { return nil, nil } - txResult := new(tmabci.TxResult) + txResult := new(abci.TxResult) err = proto.Unmarshal(rawBytes, txResult) if err != nil { return nil, fmt.Errorf("error reading TxResult: %v", err) @@ -101,7 +101,7 @@ func (txi *TxIndex) AddBatch(b *txindex.Batch) error { // that indexed from the tx's events is a composite of the event type and the // respective attribute's key delimited by a "." (eg. "account.number"). // Any event with an empty type is not indexed. -func (txi *TxIndex) Index(result *tmabci.TxResult) error { +func (txi *TxIndex) Index(result *abci.TxResult) error { b := txi.store.NewBatch() defer b.Close() @@ -132,7 +132,7 @@ func (txi *TxIndex) Index(result *tmabci.TxResult) error { return b.WriteSync() } -func (txi *TxIndex) indexEvents(result *tmabci.TxResult, hash []byte, store dbm.Batch) error { +func (txi *TxIndex) indexEvents(result *abci.TxResult, hash []byte, store dbm.Batch) error { for _, event := range result.Result.Events { // only index events with a non-empty type if len(event.Type) == 0 { @@ -169,10 +169,10 @@ func (txi *TxIndex) indexEvents(result *tmabci.TxResult, hash []byte, store dbm. // // Search will exit early and return any result fetched so far, // when a message is received on the context chan. -func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) { +func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) { select { case <-ctx.Done(): - return make([]*tmabci.TxResult, 0), nil + return make([]*abci.TxResult, 0), nil default: } @@ -194,11 +194,11 @@ func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*tmabci.TxRes res, err := txi.Get(hash) switch { case err != nil: - return []*tmabci.TxResult{}, fmt.Errorf("error while retrieving the result: %w", err) + return []*abci.TxResult{}, fmt.Errorf("error while retrieving the result: %w", err) case res == nil: - return []*tmabci.TxResult{}, nil + return []*abci.TxResult{}, nil default: - return []*tmabci.TxResult{res}, nil + return []*abci.TxResult{res}, nil } } @@ -251,7 +251,7 @@ func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*tmabci.TxRes } } - results := make([]*tmabci.TxResult, 0, len(filteredHashes)) + results := make([]*abci.TxResult, 0, len(filteredHashes)) for _, h := range filteredHashes { res, err := txi.Get(h) if err != nil { @@ -529,7 +529,7 @@ func extractValueFromKey(key []byte) string { return parts[1] } -func keyForEvent(key string, value []byte, result *tmabci.TxResult) []byte { +func keyForEvent(key string, value []byte, result *abci.TxResult) []byte { return []byte(fmt.Sprintf("%s/%s/%d/%d", key, value, @@ -538,7 +538,7 @@ func keyForEvent(key string, value []byte, result *tmabci.TxResult) []byte { )) } -func keyForHeight(result *tmabci.TxResult) []byte { +func keyForHeight(result *abci.TxResult) []byte { return []byte(fmt.Sprintf("%s/%d/%d/%d", types.TxHeightKey, result.Height, diff --git a/state/txindex/kv/kv_bench_test.go b/state/txindex/kv/kv_bench_test.go index b6acfdda0..5d4f5867b 100644 --- a/state/txindex/kv/kv_bench_test.go +++ b/state/txindex/kv/kv_bench_test.go @@ -7,10 +7,10 @@ import ( "io/ioutil" "testing" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/types" ) @@ -29,10 +29,10 @@ func BenchmarkTxSearch(b *testing.B) { indexer := NewTxIndex(db) for i := 0; i < 35000; i++ { - events := []tmabci.Event{ + events := []abci.Event{ { Type: "transfer", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ {Key: []byte("address"), Value: []byte(fmt.Sprintf("address_%d", i%100)), Index: true}, {Key: []byte("amount"), Value: []byte("50"), Index: true}, }, @@ -44,13 +44,13 @@ func BenchmarkTxSearch(b *testing.B) { b.Errorf("failed produce random bytes: %s", err) } - txResult := &tmabci.TxResult{ + txResult := &abci.TxResult{ Height: int64(i), Index: 0, Tx: types.Tx(string(txBz)), - Result: tmabci.ResponseDeliverTx{ + Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: abci.CodeTypeOK, + Code: ocabci.CodeTypeOK, Log: "", Events: events, }, diff --git a/state/txindex/kv/kv_test.go b/state/txindex/kv/kv_test.go index a63850fbf..148a2c869 100644 --- a/state/txindex/kv/kv_test.go +++ b/state/txindex/kv/kv_test.go @@ -11,10 +11,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/pubsub/query" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/state/txindex" @@ -25,13 +25,13 @@ func TestTxIndex(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) tx := types.Tx("HELLO WORLD") - txResult := &tmabci.TxResult{ + txResult := &abci.TxResult{ Height: 1, Index: 0, Tx: tx, - Result: tmabci.ResponseDeliverTx{ + Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: abci.CodeTypeOK, Log: "", Events: nil, + Code: ocabci.CodeTypeOK, Log: "", Events: nil, }, } hash := tx.Hash() @@ -48,13 +48,13 @@ func TestTxIndex(t *testing.T) { assert.True(t, proto.Equal(txResult, loadedTxResult)) tx2 := types.Tx("BYE BYE WORLD") - txResult2 := &tmabci.TxResult{ + txResult2 := &abci.TxResult{ Height: 1, Index: 0, Tx: tx2, - Result: tmabci.ResponseDeliverTx{ + Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: abci.CodeTypeOK, Log: "", Events: nil, + Code: ocabci.CodeTypeOK, Log: "", Events: nil, }, } hash2 := tx2.Hash() @@ -70,10 +70,10 @@ func TestTxIndex(t *testing.T) { func TestTxSearch(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) - txResult := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, - {Type: "", Attributes: []tmabci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, + txResult := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, + {Type: "", Attributes: []abci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, }) hash := types.Tx(txResult.Tx).Hash() @@ -144,10 +144,10 @@ func TestTxSearch(t *testing.T) { func TestTxSearchWithCancelation(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) - txResult := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, - {Type: "", Attributes: []tmabci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, + txResult := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}}, + {Type: "", Attributes: []abci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}}, }) err := indexer.Index(txResult) require.NoError(t, err) @@ -163,8 +163,8 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) // index tx using events indexing (composite key) - txResult1 := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + txResult1 := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, }) hash1 := types.Tx(txResult1.Tx).Hash() @@ -199,27 +199,27 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { testCases := []struct { q string - results []*tmabci.TxResult + results []*abci.TxResult }{ // search by hash - {fmt.Sprintf("tx.hash = '%X'", hash1), []*tmabci.TxResult{txResult1}}, + {fmt.Sprintf("tx.hash = '%X'", hash1), []*abci.TxResult{txResult1}}, // search by hash - {fmt.Sprintf("tx.hash = '%X'", hash2), []*tmabci.TxResult{txResult2}}, + {fmt.Sprintf("tx.hash = '%X'", hash2), []*abci.TxResult{txResult2}}, // search by exact match (one key) - {"account.number = 1", []*tmabci.TxResult{txResult1}}, - {"account.number >= 1 AND account.number <= 5", []*tmabci.TxResult{txResult1}}, + {"account.number = 1", []*abci.TxResult{txResult1}}, + {"account.number >= 1 AND account.number <= 5", []*abci.TxResult{txResult1}}, // search by range (lower bound) - {"account.number >= 1", []*tmabci.TxResult{txResult1}}, + {"account.number >= 1", []*abci.TxResult{txResult1}}, // search by range (upper bound) - {"account.number <= 5", []*tmabci.TxResult{txResult1}}, + {"account.number <= 5", []*abci.TxResult{txResult1}}, // search using not allowed key - {"not_allowed = 'boom'", []*tmabci.TxResult{}}, + {"not_allowed = 'boom'", []*abci.TxResult{}}, // search for not existing tx result - {"account.number >= 2 AND account.number <= 5", []*tmabci.TxResult{}}, + {"account.number >= 2 AND account.number <= 5", []*abci.TxResult{}}, // search using not existing key - {"account.date >= TIME 2013-05-03T14:45:00Z", []*tmabci.TxResult{}}, + {"account.date >= TIME 2013-05-03T14:45:00Z", []*abci.TxResult{}}, // search by deprecated key - {"sender = 'addr1'", []*tmabci.TxResult{txResult2}}, + {"sender = 'addr1'", []*abci.TxResult{txResult2}}, } ctx := context.Background() @@ -241,9 +241,9 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { func TestTxSearchOneTxWithMultipleSameTagsButDifferentValues(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) - txResult := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, + txResult := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, }) err := indexer.Index(txResult) @@ -264,8 +264,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { indexer := NewTxIndex(db.NewMemDB()) // indexed first, but bigger height (to test the order of transactions) - txResult := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, + txResult := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}}}, }) txResult.Tx = types.Tx("Bob's account") @@ -275,8 +275,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { require.NoError(t, err) // indexed second, but smaller height (to test the order of transactions) - txResult2 := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, + txResult2 := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}}}, }) txResult2.Tx = types.Tx("Alice's account") txResult2.Height = 1 @@ -286,8 +286,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { require.NoError(t, err) // indexed third (to test the order of transactions) - txResult3 := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number"), Value: []byte("3"), Index: true}}}, + txResult3 := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("3"), Index: true}}}, }) txResult3.Tx = types.Tx("Jack's account") txResult3.Height = 1 @@ -297,8 +297,8 @@ func TestTxSearchMultipleTxs(t *testing.T) { // indexed fourth (to test we don't include txs with similar events) // https://github.com/tendermint/tendermint/issues/2908 - txResult4 := txResultWithEvents([]tmabci.Event{ - {Type: "account", Attributes: []tmabci.EventAttribute{{Key: []byte("number.id"), Value: []byte("1"), Index: true}}}, + txResult4 := txResultWithEvents([]abci.Event{ + {Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number.id"), Value: []byte("1"), Index: true}}}, }) txResult4.Tx = types.Tx("Mike's account") txResult4.Height = 2 @@ -314,15 +314,15 @@ func TestTxSearchMultipleTxs(t *testing.T) { require.Len(t, results, 3) } -func txResultWithEvents(events []tmabci.Event) *tmabci.TxResult { +func txResultWithEvents(events []abci.Event) *abci.TxResult { tx := types.Tx("HELLO WORLD") - return &tmabci.TxResult{ + return &abci.TxResult{ Height: 1, Index: 0, Tx: tx, - Result: tmabci.ResponseDeliverTx{ + Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: abci.CodeTypeOK, + Code: ocabci.CodeTypeOK, Log: "", Events: events, }, @@ -342,15 +342,15 @@ func benchmarkTxIndex(txsCount int64, b *testing.B) { txIndex := uint32(0) for i := int64(0); i < txsCount; i++ { tx := tmrand.Bytes(250) - txResult := &tmabci.TxResult{ + txResult := &abci.TxResult{ Height: 1, Index: txIndex, Tx: tx, - Result: tmabci.ResponseDeliverTx{ + Result: abci.ResponseDeliverTx{ Data: []byte{0}, - Code: abci.CodeTypeOK, + Code: ocabci.CodeTypeOK, Log: "", - Events: []tmabci.Event{}, + Events: []abci.Event{}, }, } if err := batch.Add(txResult); err != nil { diff --git a/state/txindex/null/null.go b/state/txindex/null/null.go index 75d505c42..c40914f81 100644 --- a/state/txindex/null/null.go +++ b/state/txindex/null/null.go @@ -4,7 +4,7 @@ import ( "context" "errors" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/pubsub/query" "github.com/line/ostracon/state/txindex" @@ -16,7 +16,7 @@ var _ txindex.TxIndexer = (*TxIndex)(nil) type TxIndex struct{} // Get on a TxIndex is disabled and panics when invoked. -func (txi *TxIndex) Get(hash []byte) (*tmabci.TxResult, error) { +func (txi *TxIndex) Get(hash []byte) (*abci.TxResult, error) { return nil, errors.New(`indexing is disabled (set 'tx_index = "kv"' in config)`) } @@ -26,10 +26,10 @@ func (txi *TxIndex) AddBatch(batch *txindex.Batch) error { } // Index is a noop and always returns nil. -func (txi *TxIndex) Index(result *tmabci.TxResult) error { +func (txi *TxIndex) Index(result *abci.TxResult) error { return nil } -func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*tmabci.TxResult, error) { - return []*tmabci.TxResult{}, nil +func (txi *TxIndex) Search(ctx context.Context, q *query.Query) ([]*abci.TxResult, error) { + return []*abci.TxResult{}, nil } diff --git a/state/validation_test.go b/state/validation_test.go index b0fc05a74..89813824d 100644 --- a/state/validation_test.go +++ b/state/validation_test.go @@ -10,7 +10,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/libs/log" @@ -225,7 +225,7 @@ func TestValidateBlockEvidence(t *testing.T) { evpool.On("CheckEvidence", mock.AnythingOfType("types.EvidenceList")).Return(nil) evpool.On("Update", mock.AnythingOfType("state.State"), mock.AnythingOfType("types.EvidenceList")).Return() evpool.On("ABCIEvidence", mock.AnythingOfType("int64"), mock.AnythingOfType("[]types.Evidence")).Return( - []abci.Evidence{}) + []ocabci.Evidence{}) state.ConsensusParams.Evidence.MaxBytes = 1000 blockExec := sm.NewBlockExecutor( diff --git a/statesync/reactor.go b/statesync/reactor.go index 082f580d2..ae632b6f2 100644 --- a/statesync/reactor.go +++ b/statesync/reactor.go @@ -5,7 +5,7 @@ import ( "sort" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" "github.com/line/ostracon/config" @@ -177,7 +177,7 @@ func (r *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { case *ssproto.ChunkRequest: r.Logger.Debug("Received chunk request", "height", msg.Height, "format", msg.Format, "chunk", msg.Index, "peer", src.ID()) - resp, err := r.conn.LoadSnapshotChunkSync(tmabci.RequestLoadSnapshotChunk{ + resp, err := r.conn.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{ Height: msg.Height, Format: msg.Format, Chunk: msg.Index, @@ -230,7 +230,7 @@ func (r *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { // recentSnapshots fetches the n most recent snapshots from the app func (r *Reactor) recentSnapshots(n uint32) ([]*snapshot, error) { - resp, err := r.conn.ListSnapshotsSync(tmabci.RequestListSnapshots{}) + resp, err := r.conn.ListSnapshotsSync(abci.RequestListSnapshots{}) if err != nil { return nil, err } diff --git a/statesync/reactor_test.go b/statesync/reactor_test.go index 665c681f9..e995a3a10 100644 --- a/statesync/reactor_test.go +++ b/statesync/reactor_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" @@ -51,11 +51,11 @@ func TestReactor_Receive_ChunkRequest(t *testing.T) { t.Run(name, func(t *testing.T) { // Mock ABCI connection to return local snapshots conn := &proxymocks.AppConnSnapshot{} - conn.On("LoadSnapshotChunkSync", tmabci.RequestLoadSnapshotChunk{ + conn.On("LoadSnapshotChunkSync", abci.RequestLoadSnapshotChunk{ Height: tc.request.Height, Format: tc.request.Format, Chunk: tc.request.Index, - }).Return(&tmabci.ResponseLoadSnapshotChunk{Chunk: tc.chunk}, nil) + }).Return(&abci.ResponseLoadSnapshotChunk{Chunk: tc.chunk}, nil) // Mock peer to store response, if found peer := &p2pmocks.Peer{} @@ -92,12 +92,12 @@ func TestReactor_Receive_ChunkRequest(t *testing.T) { func TestReactor_Receive_SnapshotsRequest(t *testing.T) { testcases := map[string]struct { - snapshots []*tmabci.Snapshot + snapshots []*abci.Snapshot expectResponses []*ssproto.SnapshotsResponse }{ "no snapshots": {nil, []*ssproto.SnapshotsResponse{}}, ">10 unordered snapshots": { - []*tmabci.Snapshot{ + []*abci.Snapshot{ {Height: 1, Format: 2, Chunks: 7, Hash: []byte{1, 2}, Metadata: []byte{1}}, {Height: 2, Format: 2, Chunks: 7, Hash: []byte{2, 2}, Metadata: []byte{2}}, {Height: 3, Format: 2, Chunks: 7, Hash: []byte{3, 2}, Metadata: []byte{3}}, @@ -131,7 +131,7 @@ func TestReactor_Receive_SnapshotsRequest(t *testing.T) { t.Run(name, func(t *testing.T) { // Mock ABCI connection to return local snapshots conn := &proxymocks.AppConnSnapshot{} - conn.On("ListSnapshotsSync", tmabci.RequestListSnapshots{}).Return(&tmabci.ResponseListSnapshots{ + conn.On("ListSnapshotsSync", abci.RequestListSnapshots{}).Return(&abci.ResponseListSnapshots{ Snapshots: tc.snapshots, }, nil) @@ -207,18 +207,18 @@ func makeTestStateSyncReactor( func makeMockAppConnSnapshot(appHash string, snapshot *snapshot, chunks []*chunk) *proxymocks.AppConnSnapshot { connSnapshot := &proxymocks.AppConnSnapshot{} - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ - Snapshot: &tmabci.Snapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + Snapshot: &abci.Snapshot{ Height: snapshot.Height, Format: snapshot.Format, Chunks: snapshot.Chunks, Hash: snapshot.Hash, }, AppHash: []byte(appHash), - }).Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT}, nil) + }).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) - connSnapshot.On("ListSnapshotsSync", tmabci.RequestListSnapshots{}).Return(&tmabci.ResponseListSnapshots{ - Snapshots: []*tmabci.Snapshot{{ + connSnapshot.On("ListSnapshotsSync", abci.RequestListSnapshots{}).Return(&abci.ResponseListSnapshots{ + Snapshots: []*abci.Snapshot{{ Height: snapshot.Height, Format: snapshot.Format, Chunks: snapshot.Chunks, @@ -230,10 +230,10 @@ func makeMockAppConnSnapshot(appHash string, snapshot *snapshot, chunks []*chunk index := len(chunks) for i := 0; i < index; i++ { connSnapshot.On("ApplySnapshotChunkSync", - mock.Anything).Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("LoadSnapshotChunkSync", tmabci.RequestLoadSnapshotChunk{ + mock.Anything).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("LoadSnapshotChunkSync", abci.RequestLoadSnapshotChunk{ Height: chunks[i].Height, Format: chunks[i].Format, Chunk: chunks[i].Index, - }).Return(&tmabci.ResponseLoadSnapshotChunk{Chunk: chunks[i].Chunk}, nil) + }).Return(&abci.ResponseLoadSnapshotChunk{Chunk: chunks[i].Chunk}, nil) } return connSnapshot @@ -241,7 +241,7 @@ func makeMockAppConnSnapshot(appHash string, snapshot *snapshot, chunks []*chunk func makeMockAppConnQuery(appHash string, height int64) *proxymocks.AppConnQuery { connQuery := &proxymocks.AppConnQuery{} - connQuery.On("InfoSync", proxy.RequestInfo).Return(&tmabci.ResponseInfo{ + connQuery.On("InfoSync", proxy.RequestInfo).Return(&abci.ResponseInfo{ AppVersion: testAppVersion, LastBlockHeight: height, LastBlockAppHash: []byte(appHash), diff --git a/statesync/syncer.go b/statesync/syncer.go index 0f51d323c..609be22ce 100644 --- a/statesync/syncer.go +++ b/statesync/syncer.go @@ -7,7 +7,7 @@ import ( "fmt" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" "github.com/line/ostracon/config" @@ -332,8 +332,8 @@ func (s *syncer) Sync(snapshot *snapshot, chunks *chunkQueue) (sm.State, sm.Stat func (s *syncer) offerSnapshot(snapshot *snapshot) error { s.logger.Info("Offering snapshot to ABCI app", "height", snapshot.Height, "format", snapshot.Format, "hash", snapshot.Hash) - resp, err := s.conn.OfferSnapshotSync(tmabci.RequestOfferSnapshot{ - Snapshot: &tmabci.Snapshot{ + resp, err := s.conn.OfferSnapshotSync(abci.RequestOfferSnapshot{ + Snapshot: &abci.Snapshot{ Height: snapshot.Height, Format: snapshot.Format, Chunks: snapshot.Chunks, @@ -346,17 +346,17 @@ func (s *syncer) offerSnapshot(snapshot *snapshot) error { return fmt.Errorf("failed to offer snapshot: %w", err) } switch resp.Result { - case tmabci.ResponseOfferSnapshot_ACCEPT: + case abci.ResponseOfferSnapshot_ACCEPT: s.logger.Info("Snapshot accepted, restoring", "height", snapshot.Height, "format", snapshot.Format, "hash", snapshot.Hash) return nil - case tmabci.ResponseOfferSnapshot_ABORT: + case abci.ResponseOfferSnapshot_ABORT: return errAbort - case tmabci.ResponseOfferSnapshot_REJECT: + case abci.ResponseOfferSnapshot_REJECT: return errRejectSnapshot - case tmabci.ResponseOfferSnapshot_REJECT_FORMAT: + case abci.ResponseOfferSnapshot_REJECT_FORMAT: return errRejectFormat - case tmabci.ResponseOfferSnapshot_REJECT_SENDER: + case abci.ResponseOfferSnapshot_REJECT_SENDER: return errRejectSender default: return fmt.Errorf("unknown ResponseOfferSnapshot result %v", resp.Result) @@ -374,7 +374,7 @@ func (s *syncer) applyChunks(chunks *chunkQueue) error { return fmt.Errorf("failed to fetch chunk: %w", err) } - resp, err := s.conn.ApplySnapshotChunkSync(tmabci.RequestApplySnapshotChunk{ + resp, err := s.conn.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{ Index: chunk.Index, Chunk: chunk.Chunk, Sender: string(chunk.Sender), @@ -405,14 +405,14 @@ func (s *syncer) applyChunks(chunks *chunkQueue) error { } switch resp.Result { - case tmabci.ResponseApplySnapshotChunk_ACCEPT: - case tmabci.ResponseApplySnapshotChunk_ABORT: + case abci.ResponseApplySnapshotChunk_ACCEPT: + case abci.ResponseApplySnapshotChunk_ABORT: return errAbort - case tmabci.ResponseApplySnapshotChunk_RETRY: + case abci.ResponseApplySnapshotChunk_RETRY: chunks.Retry(chunk.Index) - case tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT: + case abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT: return errRetrySnapshot - case tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT: + case abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT: return errRejectSnapshot default: return fmt.Errorf("unknown ResponseApplySnapshotChunk result %v", resp.Result) diff --git a/statesync/syncer_test.go b/statesync/syncer_test.go index ca489efd6..4ff959fa6 100644 --- a/statesync/syncer_test.go +++ b/statesync/syncer_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" @@ -129,17 +129,17 @@ func TestSyncer_SyncAny(t *testing.T) { // We start a sync, with peers sending back chunks when requested. We first reject the snapshot // with height 2 format 2, and accept the snapshot at height 1. - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ - Snapshot: &tmabci.Snapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + Snapshot: &abci.Snapshot{ Height: 2, Format: 2, Chunks: 3, Hash: []byte{1}, }, AppHash: []byte("app_hash_2"), - }).Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ - Snapshot: &tmabci.Snapshot{ + }).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ + Snapshot: &abci.Snapshot{ Height: s.Height, Format: s.Format, Chunks: s.Chunks, @@ -147,7 +147,7 @@ func TestSyncer_SyncAny(t *testing.T) { Metadata: s.Metadata, }, AppHash: []byte("app_hash"), - }).Times(2).Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT}, nil) + }).Times(2).Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) chunkRequests := make(map[uint32]int) chunkRequestsMtx := tmsync.Mutex{} @@ -173,24 +173,24 @@ func TestSyncer_SyncAny(t *testing.T) { // The first time we're applying chunk 2 we tell it to retry the snapshot and discard chunk 1, // which should cause it to keep the existing chunk 0 and 2, and restart restoration from // beginning. We also wait for a little while, to exercise the retry logic in fetchChunks(). - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{1, 1, 2}, }).Once().Run(func(args mock.Arguments) { time.Sleep(2 * time.Second) }).Return( - &tmabci.ResponseApplySnapshotChunk{ - Result: tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, + &abci.ResponseApplySnapshotChunk{ + Result: abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, RefetchChunks: []uint32{1}, }, nil) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 0, Chunk: []byte{1, 1, 0}, - }).Times(2).Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 1, Chunk: []byte{1, 1, 1}, - }).Times(2).Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + }).Times(2).Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{1, 1, 2}, - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connQuery.On("InfoSync", proxy.RequestInfo).Return(&tmabci.ResponseInfo{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connQuery.On("InfoSync", proxy.RequestInfo).Return(&abci.ResponseInfo{ AppVersion: testAppVersion, LastBlockHeight: 1, LastBlockAppHash: []byte("app_hash"), @@ -230,9 +230,9 @@ func TestSyncer_SyncAny_abort(t *testing.T) { s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} _, err := syncer.AddSnapshot(simplePeer("id"), s) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ABORT}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errAbort, err) @@ -253,17 +253,17 @@ func TestSyncer_SyncAny_reject(t *testing.T) { _, err = syncer.AddSnapshot(simplePeer("id"), s11) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s12), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errNoSnapshots, err) @@ -284,13 +284,13 @@ func TestSyncer_SyncAny_reject_format(t *testing.T) { _, err = syncer.AddSnapshot(simplePeer("id"), s11) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s22), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT}, nil) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s11), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ABORT}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errAbort, err) @@ -322,13 +322,13 @@ func TestSyncer_SyncAny_reject_sender(t *testing.T) { _, err = syncer.AddSnapshot(peerC, sbc) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(sbc), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT_SENDER}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_SENDER}, nil) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(sa), AppHash: []byte("app_hash"), - }).Once().Return(&tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_REJECT}, nil) + }).Once().Return(&abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil) _, _, _, err = syncer.SyncAny(0, func() {}) assert.Equal(t, errNoSnapshots, err) @@ -342,7 +342,7 @@ func TestSyncer_SyncAny_abciError(t *testing.T) { s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}} _, err := syncer.AddSnapshot(simplePeer("id"), s) require.NoError(t, err) - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), }).Once().Return(nil, errBoom) @@ -356,16 +356,16 @@ func TestSyncer_offerSnapshot(t *testing.T) { boom := errors.New("boom") testcases := map[string]struct { - result tmabci.ResponseOfferSnapshot_Result + result abci.ResponseOfferSnapshot_Result err error expectErr error }{ - "accept": {tmabci.ResponseOfferSnapshot_ACCEPT, nil, nil}, - "abort": {tmabci.ResponseOfferSnapshot_ABORT, nil, errAbort}, - "reject": {tmabci.ResponseOfferSnapshot_REJECT, nil, errRejectSnapshot}, - "reject_format": {tmabci.ResponseOfferSnapshot_REJECT_FORMAT, nil, errRejectFormat}, - "reject_sender": {tmabci.ResponseOfferSnapshot_REJECT_SENDER, nil, errRejectSender}, - "unknown": {tmabci.ResponseOfferSnapshot_UNKNOWN, nil, unknownErr}, + "accept": {abci.ResponseOfferSnapshot_ACCEPT, nil, nil}, + "abort": {abci.ResponseOfferSnapshot_ABORT, nil, errAbort}, + "reject": {abci.ResponseOfferSnapshot_REJECT, nil, errRejectSnapshot}, + "reject_format": {abci.ResponseOfferSnapshot_REJECT_FORMAT, nil, errRejectFormat}, + "reject_sender": {abci.ResponseOfferSnapshot_REJECT_SENDER, nil, errRejectSender}, + "unknown": {abci.ResponseOfferSnapshot_UNKNOWN, nil, unknownErr}, "error": {0, boom, boom}, "unknown non-zero": {9, nil, unknownErr}, } @@ -374,10 +374,10 @@ func TestSyncer_offerSnapshot(t *testing.T) { t.Run(name, func(t *testing.T) { syncer, connSnapshot := setupOfferSyncer(t) s := &snapshot{Height: 1, Format: 1, Chunks: 3, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} - connSnapshot.On("OfferSnapshotSync", tmabci.RequestOfferSnapshot{ + connSnapshot.On("OfferSnapshotSync", abci.RequestOfferSnapshot{ Snapshot: toABCI(s), AppHash: []byte("app_hash"), - }).Return(&tmabci.ResponseOfferSnapshot{Result: tc.result}, tc.err) + }).Return(&abci.ResponseOfferSnapshot{Result: tc.result}, tc.err) err := syncer.offerSnapshot(s) if tc.expectErr == unknownErr { require.Error(t, err) @@ -397,16 +397,16 @@ func TestSyncer_applyChunks_Results(t *testing.T) { boom := errors.New("boom") testcases := map[string]struct { - result tmabci.ResponseApplySnapshotChunk_Result + result abci.ResponseApplySnapshotChunk_Result err error expectErr error }{ - "accept": {tmabci.ResponseApplySnapshotChunk_ACCEPT, nil, nil}, - "abort": {tmabci.ResponseApplySnapshotChunk_ABORT, nil, errAbort}, - "retry": {tmabci.ResponseApplySnapshotChunk_RETRY, nil, nil}, - "retry_snapshot": {tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, nil, errRetrySnapshot}, - "reject_snapshot": {tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT, nil, errRejectSnapshot}, - "unknown": {tmabci.ResponseApplySnapshotChunk_UNKNOWN, nil, unknownErr}, + "accept": {abci.ResponseApplySnapshotChunk_ACCEPT, nil, nil}, + "abort": {abci.ResponseApplySnapshotChunk_ABORT, nil, errAbort}, + "retry": {abci.ResponseApplySnapshotChunk_RETRY, nil, nil}, + "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT, nil, errRetrySnapshot}, + "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT, nil, errRejectSnapshot}, + "unknown": {abci.ResponseApplySnapshotChunk_UNKNOWN, nil, unknownErr}, "error": {0, boom, boom}, "unknown non-zero": {9, nil, unknownErr}, } @@ -427,14 +427,14 @@ func TestSyncer_applyChunks_Results(t *testing.T) { _, err = chunks.Add(&chunk{Height: 1, Format: 1, Index: 0, Chunk: body}) require.NoError(t, err) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 0, Chunk: body, - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tc.result}, tc.err) - if tc.result == tmabci.ResponseApplySnapshotChunk_RETRY { - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: tc.result}, tc.err) + if tc.result == abci.ResponseApplySnapshotChunk_RETRY { + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 0, Chunk: body, - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{ - Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + }).Once().Return(&abci.ResponseApplySnapshotChunk{ + Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) } err = syncer.applyChunks(chunks) @@ -455,13 +455,13 @@ func TestSyncer_applyChunks_Results(t *testing.T) { func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { // Discarding chunks via refetch_chunks should work the same for all results testcases := map[string]struct { - result tmabci.ResponseApplySnapshotChunk_Result + result abci.ResponseApplySnapshotChunk_Result }{ - "accept": {tmabci.ResponseApplySnapshotChunk_ACCEPT}, - "abort": {tmabci.ResponseApplySnapshotChunk_ABORT}, - "retry": {tmabci.ResponseApplySnapshotChunk_RETRY}, - "retry_snapshot": {tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, - "reject_snapshot": {tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, + "accept": {abci.ResponseApplySnapshotChunk_ACCEPT}, + "abort": {abci.ResponseApplySnapshotChunk_ABORT}, + "retry": {abci.ResponseApplySnapshotChunk_RETRY}, + "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, + "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, } for name, tc := range testcases { tc := tc @@ -487,15 +487,15 @@ func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { require.NoError(t, err) // The first two chunks are accepted, before the last one asks for 1 to be refetched - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 0, Chunk: []byte{0}, - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 1, Chunk: []byte{1}, - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{2}, - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{ Result: tc.result, RefetchChunks: []uint32{1}, }, nil) @@ -520,13 +520,13 @@ func TestSyncer_applyChunks_RefetchChunks(t *testing.T) { func TestSyncer_applyChunks_RejectSenders(t *testing.T) { // Banning chunks senders via ban_chunk_senders should work the same for all results testcases := map[string]struct { - result tmabci.ResponseApplySnapshotChunk_Result + result abci.ResponseApplySnapshotChunk_Result }{ - "accept": {tmabci.ResponseApplySnapshotChunk_ACCEPT}, - "abort": {tmabci.ResponseApplySnapshotChunk_ABORT}, - "retry": {tmabci.ResponseApplySnapshotChunk_RETRY}, - "retry_snapshot": {tmabci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, - "reject_snapshot": {tmabci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, + "accept": {abci.ResponseApplySnapshotChunk_ACCEPT}, + "abort": {abci.ResponseApplySnapshotChunk_ABORT}, + "retry": {abci.ResponseApplySnapshotChunk_RETRY}, + "retry_snapshot": {abci.ResponseApplySnapshotChunk_RETRY_SNAPSHOT}, + "reject_snapshot": {abci.ResponseApplySnapshotChunk_REJECT_SNAPSHOT}, } for name, tc := range testcases { tc := tc @@ -573,24 +573,24 @@ func TestSyncer_applyChunks_RejectSenders(t *testing.T) { require.NoError(t, err) // The first two chunks are accepted, before the last one asks for b sender to be rejected - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 0, Chunk: []byte{0}, Sender: "a", - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 1, Chunk: []byte{1}, Sender: "b", - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{2}, Sender: "c", - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{ + }).Once().Return(&abci.ResponseApplySnapshotChunk{ Result: tc.result, RejectSenders: []string{string(peerB.ID())}, }, nil) // On retry, the last chunk will be tried again, so we just accept it then. - if tc.result == tmabci.ResponseApplySnapshotChunk_RETRY { - connSnapshot.On("ApplySnapshotChunkSync", tmabci.RequestApplySnapshotChunk{ + if tc.result == abci.ResponseApplySnapshotChunk_RETRY { + connSnapshot.On("ApplySnapshotChunkSync", abci.RequestApplySnapshotChunk{ Index: 2, Chunk: []byte{2}, Sender: "c", - }).Once().Return(&tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT}, nil) + }).Once().Return(&abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT}, nil) } // We don't really care about the result of applyChunks, since it has separate test. @@ -626,26 +626,26 @@ func TestSyncer_verifyApp(t *testing.T) { s := &snapshot{Height: 3, Format: 1, Chunks: 5, Hash: []byte{1, 2, 3}, trustedAppHash: []byte("app_hash")} testcases := map[string]struct { - response *tmabci.ResponseInfo + response *abci.ResponseInfo err error expectErr error }{ - "verified": {&tmabci.ResponseInfo{ + "verified": {&abci.ResponseInfo{ LastBlockHeight: 3, LastBlockAppHash: []byte("app_hash"), AppVersion: appVersion, }, nil, nil}, - "invalid app version": {&tmabci.ResponseInfo{ + "invalid app version": {&abci.ResponseInfo{ LastBlockHeight: 3, LastBlockAppHash: []byte("app_hash"), AppVersion: invalidAppVersion, }, nil, appVersionMismatchErr}, - "invalid height": {&tmabci.ResponseInfo{ + "invalid height": {&abci.ResponseInfo{ LastBlockHeight: 5, LastBlockAppHash: []byte("app_hash"), AppVersion: appVersion, }, nil, errVerifyFailed}, - "invalid hash": {&tmabci.ResponseInfo{ + "invalid hash": {&abci.ResponseInfo{ LastBlockHeight: 3, LastBlockAppHash: []byte("xxx"), AppVersion: appVersion, @@ -706,7 +706,7 @@ func TestSyncer_Sync(t *testing.T) { stateProvider.On("AppHash", mock.Anything, mock.Anything).Return([]byte("app_hash"), nil) connSnapshot.On("OfferSnapshotSync", mock.Anything).Return( - &tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT}, nil) + &abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, nil) snapshot.Height = 2 { @@ -780,8 +780,8 @@ func TestSyncer_Sync(t *testing.T) { } } -func toABCI(s *snapshot) *tmabci.Snapshot { - return &tmabci.Snapshot{ +func toABCI(s *snapshot) *abci.Snapshot { + return &abci.Snapshot{ Height: s.Height, Format: s.Format, Chunks: s.Chunks, diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index 82c26c478..ecc2a259d 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -10,10 +10,10 @@ import ( "strconv" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/abci/example/code" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/proto/ostracon/crypto" @@ -27,12 +27,12 @@ const E2EAppVersion = 999 // to disk as JSON, taking state sync snapshots if requested. type Application struct { - abci.BaseApplication + ocabci.BaseApplication logger log.Logger state *State snapshots *SnapshotStore cfg *Config - restoreSnapshot *tmabci.Snapshot + restoreSnapshot *abci.Snapshot restoreChunks [][]byte } @@ -111,8 +111,8 @@ func NewApplication(cfg *Config) (*Application, error) { } // Info implements ABCI. -func (app *Application) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { - return tmabci.ResponseInfo{ +func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo { + return abci.ResponseInfo{ Version: version.ABCIVersion, AppVersion: E2EAppVersion, LastBlockHeight: int64(app.state.Height), @@ -121,7 +121,7 @@ func (app *Application) Info(req tmabci.RequestInfo) tmabci.ResponseInfo { } // Info implements ABCI. -func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { +func (app *Application) InitChain(req ocabci.RequestInitChain) ocabci.ResponseInitChain { var err error app.state.initialHeight = uint64(req.InitialHeight) if len(req.AppStateBytes) > 0 { @@ -130,7 +130,7 @@ func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitCh panic(err) } } - resp := abci.ResponseInitChain{ + resp := ocabci.ResponseInitChain{ AppHash: app.state.Hash, } if resp.Validators, err = app.validatorUpdates(0); err != nil { @@ -140,10 +140,10 @@ func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitCh } // CheckTx implements ABCI. -func (app *Application) CheckTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx { +func (app *Application) CheckTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { _, _, err := parseTx(req.Tx) if err != nil { - return abci.ResponseCheckTx{ + return ocabci.ResponseCheckTx{ Code: code.CodeTypeEncodingError, Log: err.Error(), } @@ -153,32 +153,32 @@ func (app *Application) CheckTx(req tmabci.RequestCheckTx) abci.ResponseCheckTx time.Sleep(app.cfg.CheckTxDelay) } - return abci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} + return ocabci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} } // DeliverTx implements ABCI. -func (app *Application) DeliverTx(req tmabci.RequestDeliverTx) tmabci.ResponseDeliverTx { +func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { key, value, err := parseTx(req.Tx) if err != nil { panic(err) // shouldn't happen since we verified it in CheckTx } app.state.Set(key, value) - return tmabci.ResponseDeliverTx{Code: code.CodeTypeOK} + return abci.ResponseDeliverTx{Code: code.CodeTypeOK} } // EndBlock implements ABCI. -func (app *Application) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlock { +func (app *Application) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { valUpdates, err := app.validatorUpdates(uint64(req.Height)) if err != nil { panic(err) } - return abci.ResponseEndBlock{ + return ocabci.ResponseEndBlock{ ValidatorUpdates: valUpdates, - Events: []tmabci.Event{ + Events: []abci.Event{ { Type: "val_updates", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ { Key: []byte("size"), Value: []byte(strconv.Itoa(valUpdates.Len())), @@ -194,7 +194,7 @@ func (app *Application) EndBlock(req tmabci.RequestEndBlock) abci.ResponseEndBlo } // Commit implements ABCI. -func (app *Application) Commit() tmabci.ResponseCommit { +func (app *Application) Commit() abci.ResponseCommit { height, hash, err := app.state.Commit() if err != nil { panic(err) @@ -210,15 +210,15 @@ func (app *Application) Commit() tmabci.ResponseCommit { if app.cfg.RetainBlocks > 0 { retainHeight = int64(height - app.cfg.RetainBlocks + 1) } - return tmabci.ResponseCommit{ + return abci.ResponseCommit{ Data: hash, RetainHeight: retainHeight, } } // Query implements ABCI. -func (app *Application) Query(req tmabci.RequestQuery) tmabci.ResponseQuery { - return tmabci.ResponseQuery{ +func (app *Application) Query(req abci.RequestQuery) abci.ResponseQuery { + return abci.ResponseQuery{ Height: int64(app.state.Height), Key: req.Data, Value: []byte(app.state.Get(string(req.Data))), @@ -226,35 +226,35 @@ func (app *Application) Query(req tmabci.RequestQuery) tmabci.ResponseQuery { } // ListSnapshots implements ABCI. -func (app *Application) ListSnapshots(req tmabci.RequestListSnapshots) tmabci.ResponseListSnapshots { +func (app *Application) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots { snapshots, err := app.snapshots.List() if err != nil { panic(err) } - return tmabci.ResponseListSnapshots{Snapshots: snapshots} + return abci.ResponseListSnapshots{Snapshots: snapshots} } // LoadSnapshotChunk implements ABCI. -func (app *Application) LoadSnapshotChunk(req tmabci.RequestLoadSnapshotChunk) tmabci.ResponseLoadSnapshotChunk { +func (app *Application) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { chunk, err := app.snapshots.LoadChunk(req.Height, req.Format, req.Chunk) if err != nil { panic(err) } - return tmabci.ResponseLoadSnapshotChunk{Chunk: chunk} + return abci.ResponseLoadSnapshotChunk{Chunk: chunk} } // OfferSnapshot implements ABCI. -func (app *Application) OfferSnapshot(req tmabci.RequestOfferSnapshot) tmabci.ResponseOfferSnapshot { +func (app *Application) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { if app.restoreSnapshot != nil { panic("A snapshot is already being restored") } app.restoreSnapshot = req.Snapshot app.restoreChunks = [][]byte{} - return tmabci.ResponseOfferSnapshot{Result: tmabci.ResponseOfferSnapshot_ACCEPT} + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT} } // ApplySnapshotChunk implements ABCI. -func (app *Application) ApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) tmabci.ResponseApplySnapshotChunk { +func (app *Application) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { if app.restoreSnapshot == nil { panic("No restore in progress") } @@ -271,7 +271,7 @@ func (app *Application) ApplySnapshotChunk(req tmabci.RequestApplySnapshotChunk) app.restoreSnapshot = nil app.restoreChunks = nil } - return tmabci.ResponseApplySnapshotChunk{Result: tmabci.ResponseApplySnapshotChunk_ACCEPT} + return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT} } func (app *Application) Rollback() error { @@ -279,13 +279,13 @@ func (app *Application) Rollback() error { } // validatorUpdates generates a validator set update. -func (app *Application) validatorUpdates(height uint64) (abci.ValidatorUpdates, error) { +func (app *Application) validatorUpdates(height uint64) (ocabci.ValidatorUpdates, error) { updates := app.cfg.ValidatorUpdates[fmt.Sprintf("%v", height)] if len(updates) == 0 { return nil, nil } - valUpdates := abci.ValidatorUpdates{} + valUpdates := ocabci.ValidatorUpdates{} for keyString, power := range updates { keyBytes, err := base64.StdEncoding.DecodeString(keyString) @@ -301,7 +301,7 @@ func (app *Application) validatorUpdates(height uint64) (abci.ValidatorUpdates, if err != nil { return nil, fmt.Errorf("invalid crypto pubkey %q: %w", keyString, err) } - valUpdates = append(valUpdates, abci.NewValidatorUpdate(pubKey, int64(power))) + valUpdates = append(valUpdates, ocabci.NewValidatorUpdate(pubKey, int64(power))) } return valUpdates, nil } diff --git a/test/e2e/app/snapshots.go b/test/e2e/app/snapshots.go index 6c766b14b..bd6c8686a 100644 --- a/test/e2e/app/snapshots.go +++ b/test/e2e/app/snapshots.go @@ -9,7 +9,7 @@ import ( "path/filepath" "sync" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ) const ( @@ -22,7 +22,7 @@ const ( type SnapshotStore struct { sync.RWMutex dir string - metadata []tmabci.Snapshot + metadata []abci.Snapshot } // NewSnapshotStore creates a new snapshot store. @@ -41,7 +41,7 @@ func NewSnapshotStore(dir string) (*SnapshotStore, error) { // called internally on construction. func (s *SnapshotStore) loadMetadata() error { file := filepath.Join(s.dir, "metadata.json") - metadata := []tmabci.Snapshot{} + metadata := []abci.Snapshot{} bz, err := os.ReadFile(file) switch { @@ -78,14 +78,14 @@ func (s *SnapshotStore) saveMetadata() error { } // Create creates a snapshot of the given application state's key/value pairs. -func (s *SnapshotStore) Create(state *State) (tmabci.Snapshot, error) { +func (s *SnapshotStore) Create(state *State) (abci.Snapshot, error) { s.Lock() defer s.Unlock() bz, err := state.Export() if err != nil { - return tmabci.Snapshot{}, err + return abci.Snapshot{}, err } - snapshot := tmabci.Snapshot{ + snapshot := abci.Snapshot{ Height: state.Height, Format: 1, Hash: hashItems(state.Values), @@ -93,21 +93,21 @@ func (s *SnapshotStore) Create(state *State) (tmabci.Snapshot, error) { } err = os.WriteFile(filepath.Join(s.dir, fmt.Sprintf("%v.json", state.Height)), bz, 0o644) //nolint:gosec if err != nil { - return tmabci.Snapshot{}, err + return abci.Snapshot{}, err } s.metadata = append(s.metadata, snapshot) err = s.saveMetadata() if err != nil { - return tmabci.Snapshot{}, err + return abci.Snapshot{}, err } return snapshot, nil } // List lists available snapshots. -func (s *SnapshotStore) List() ([]*tmabci.Snapshot, error) { +func (s *SnapshotStore) List() ([]*abci.Snapshot, error) { s.RLock() defer s.RUnlock() - snapshots := make([]*tmabci.Snapshot, len(s.metadata)) + snapshots := make([]*abci.Snapshot, len(s.metadata)) for idx := range s.metadata { snapshots[idx] = &s.metadata[idx] } diff --git a/types/event_bus.go b/types/event_bus.go index 11e4ab6f1..d876c454e 100644 --- a/types/event_bus.go +++ b/types/event_bus.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/log" tmpubsub "github.com/line/ostracon/libs/pubsub" @@ -110,7 +110,7 @@ func (b *EventBus) Publish(eventType string, eventData OCEventData) error { // map of stringified events where each key is composed of the event // type and each of the event's attributes keys in the form of // "{event.Type}.{attribute.Key}" and the value is each attribute's value. -func (b *EventBus) validateAndStringifyEvents(events []tmabci.Event, logger log.Logger) map[string][]string { +func (b *EventBus) validateAndStringifyEvents(events []abci.Event, logger log.Logger) map[string][]string { result := make(map[string][]string) for _, event := range events { if len(event.Type) == 0 { diff --git a/types/event_bus_test.go b/types/event_bus_test.go index 94a21b2f2..da3b69203 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmpubsub "github.com/line/ostracon/libs/pubsub" tmquery "github.com/line/ostracon/libs/pubsub/query" tmrand "github.com/line/ostracon/libs/rand" @@ -29,10 +29,10 @@ func TestEventBusPublishEventTx(t *testing.T) { }) tx := Tx("foo") - result := tmabci.ResponseDeliverTx{ + result := abci.ResponseDeliverTx{ Data: []byte("bar"), - Events: []tmabci.Event{ - {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, + Events: []abci.Event{ + {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } @@ -52,7 +52,7 @@ func TestEventBusPublishEventTx(t *testing.T) { close(done) }() - err = eventBus.PublishEventTx(EventDataTx{tmabci.TxResult{ + err = eventBus.PublishEventTx(EventDataTx{abci.TxResult{ Height: 1, Index: 0, Tx: tx, @@ -78,14 +78,14 @@ func TestEventBusPublishEventNewBlock(t *testing.T) { }) block := MakeBlock(0, []Tx{}, nil, []Evidence{}, TestConsensusVersion) - resultBeginBlock := tmabci.ResponseBeginBlock{ - Events: []tmabci.Event{ - {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, + resultBeginBlock := abci.ResponseBeginBlock{ + Events: []abci.Event{ + {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } - resultEndBlock := abci.ResponseEndBlock{ - Events: []tmabci.Event{ - {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, + resultEndBlock := ocabci.ResponseEndBlock{ + Events: []abci.Event{ + {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, }, } @@ -129,12 +129,12 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }) tx := Tx("foo") - result := tmabci.ResponseDeliverTx{ + result := abci.ResponseDeliverTx{ Data: []byte("bar"), - Events: []tmabci.Event{ + Events: []abci.Event{ { Type: "transfer", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ {Key: []byte("sender"), Value: []byte("foo")}, {Key: []byte("recipient"), Value: []byte("bar")}, {Key: []byte("amount"), Value: []byte("5")}, @@ -142,7 +142,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }, { Type: "transfer", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ {Key: []byte("sender"), Value: []byte("baz")}, {Key: []byte("recipient"), Value: []byte("cat")}, {Key: []byte("amount"), Value: []byte("13")}, @@ -150,7 +150,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { }, { Type: "withdraw.rewards", - Attributes: []tmabci.EventAttribute{ + Attributes: []abci.EventAttribute{ {Key: []byte("address"), Value: []byte("bar")}, {Key: []byte("source"), Value: []byte("iceman")}, {Key: []byte("amount"), Value: []byte("33")}, @@ -205,7 +205,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) { } }() - err = eventBus.PublishEventTx(EventDataTx{tmabci.TxResult{ + err = eventBus.PublishEventTx(EventDataTx{abci.TxResult{ Height: 1, Index: 0, Tx: tx, @@ -237,14 +237,14 @@ func TestEventBusPublishEventNewBlockHeader(t *testing.T) { }) block := MakeBlock(0, []Tx{}, nil, []Evidence{}, TestConsensusVersion) - resultBeginBlock := tmabci.ResponseBeginBlock{ - Events: []tmabci.Event{ - {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, + resultBeginBlock := abci.ResponseBeginBlock{ + Events: []abci.Event{ + {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } - resultEndBlock := abci.ResponseEndBlock{ - Events: []tmabci.Event{ - {Type: "testType", Attributes: []tmabci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, + resultEndBlock := ocabci.ResponseEndBlock{ + Events: []abci.Event{ + {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, }, } diff --git a/types/events.go b/types/events.go index 2e620f120..d99e9e96b 100644 --- a/types/events.go +++ b/types/events.go @@ -3,9 +3,9 @@ package types import ( "fmt" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" tmjson "github.com/line/ostracon/libs/json" tmpubsub "github.com/line/ostracon/libs/pubsub" tmquery "github.com/line/ostracon/libs/pubsub/query" @@ -66,16 +66,16 @@ func init() { type EventDataNewBlock struct { Block *Block `json:"block"` - ResultBeginBlock tmabci.ResponseBeginBlock `json:"result_begin_block"` - ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` + ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` + ResultEndBlock ocabci.ResponseEndBlock `json:"result_end_block"` } type EventDataNewBlockHeader struct { Header Header `json:"header"` - NumTxs int64 `json:"num_txs"` // Number of txs in a block - ResultBeginBlock tmabci.ResponseBeginBlock `json:"result_begin_block"` - ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` + NumTxs int64 `json:"num_txs"` // Number of txs in a block + ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` + ResultEndBlock ocabci.ResponseEndBlock `json:"result_end_block"` } type EventDataNewEvidence struct { @@ -86,7 +86,7 @@ type EventDataNewEvidence struct { // All txs fire EventDataTx type EventDataTx struct { - tmabci.TxResult + abci.TxResult } // NOTE: This goes into the replay WAL diff --git a/types/evidence.go b/types/evidence.go index dd9c47c3d..274c7859f 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -9,10 +9,10 @@ import ( "strings" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" tmjson "github.com/line/ostracon/libs/json" @@ -39,13 +39,13 @@ func MaxEvidenceBytes(ev Evidence) int64 { // Evidence represents any provable malicious activity by a validator. // Verification logic for each evidence is part of the evidence module. type Evidence interface { - ABCI() []abci.Evidence // forms individual evidence to be sent to the application - Bytes() []byte // bytes which comprise the evidence - Hash() []byte // hash of the evidence - Height() int64 // height of the infraction - String() string // string format of the evidence - Time() time.Time // time of the infraction - ValidateBasic() error // basic consistency check + ABCI() []ocabci.Evidence // forms individual evidence to be sent to the application + Bytes() []byte // bytes which comprise the evidence + Hash() []byte // hash of the evidence + Height() int64 // height of the infraction + String() string // string format of the evidence + Time() time.Time // time of the infraction + ValidateBasic() error // basic consistency check } //-------------------------------------------------------------------------------------- @@ -92,10 +92,10 @@ func NewDuplicateVoteEvidence(vote1, vote2 *Vote, blockTime time.Time, valSet *V } // ABCI returns the application relevant representation of the evidence -func (dve *DuplicateVoteEvidence) ABCI() []abci.Evidence { - return []abci.Evidence{{ - Type: tmabci.EvidenceType_DUPLICATE_VOTE, - Validator: abci.Validator{ +func (dve *DuplicateVoteEvidence) ABCI() []ocabci.Evidence { + return []ocabci.Evidence{{ + Type: abci.EvidenceType_DUPLICATE_VOTE, + Validator: ocabci.Validator{ Address: dve.VoteA.ValidatorAddress, Power: dve.ValidatorPower, }, @@ -219,11 +219,11 @@ type LightClientAttackEvidence struct { var _ Evidence = &LightClientAttackEvidence{} // ABCI forms an array of abci evidence for each byzantine validator -func (l *LightClientAttackEvidence) ABCI() []abci.Evidence { - abciEv := make([]abci.Evidence, len(l.ByzantineValidators)) +func (l *LightClientAttackEvidence) ABCI() []ocabci.Evidence { + abciEv := make([]ocabci.Evidence, len(l.ByzantineValidators)) for idx, val := range l.ByzantineValidators { - abciEv[idx] = abci.Evidence{ - Type: tmabci.EvidenceType_LIGHT_CLIENT_ATTACK, + abciEv[idx] = ocabci.Evidence{ + Type: abci.EvidenceType_LIGHT_CLIENT_ATTACK, Validator: OC2PB.Validator(val), Height: l.Height(), Time: l.Timestamp, diff --git a/types/params.go b/types/params.go index 70e34904b..fc26efde0 100644 --- a/types/params.go +++ b/types/params.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto/tmhash" @@ -158,7 +158,7 @@ func HashConsensusParams(params tmproto.ConsensusParams) []byte { // Update returns a copy of the params with updates from the non-zero fields of p2. // NOTE: note: must not modify the original -func UpdateConsensusParams(params tmproto.ConsensusParams, params2 *tmabci.ConsensusParams) tmproto.ConsensusParams { +func UpdateConsensusParams(params tmproto.ConsensusParams, params2 *abci.ConsensusParams) tmproto.ConsensusParams { res := params // explicit copy if params2 == nil { diff --git a/types/params_test.go b/types/params_test.go index 51ac80e77..37d004309 100644 --- a/types/params_test.go +++ b/types/params_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" @@ -105,20 +105,20 @@ func TestConsensusParamsHash(t *testing.T) { func TestConsensusParamsUpdate(t *testing.T) { testCases := []struct { params tmproto.ConsensusParams - updates *tmabci.ConsensusParams + updates *abci.ConsensusParams updatedParams tmproto.ConsensusParams }{ // empty updates { makeParams(1, 2, 10, 3, 0, valEd25519), - &tmabci.ConsensusParams{}, + &abci.ConsensusParams{}, makeParams(1, 2, 10, 3, 0, valEd25519), }, // fine updates { makeParams(1, 2, 10, 3, 0, valEd25519), - &tmabci.ConsensusParams{ - Block: &tmabci.BlockParams{ + &abci.ConsensusParams{ + Block: &abci.BlockParams{ MaxBytes: 100, MaxGas: 200, }, @@ -145,7 +145,7 @@ func TestConsensusParamsUpdate_AppVersion(t *testing.T) { assert.EqualValues(t, 0, params.Version.AppVersion) updated := UpdateConsensusParams(params, - &tmabci.ConsensusParams{Version: &tmproto.VersionParams{AppVersion: 77}}) + &abci.ConsensusParams{Version: &tmproto.VersionParams{AppVersion: 77}}) assert.EqualValues(t, 77, updated.Version.AppVersion) } diff --git a/types/protobuf.go b/types/protobuf.go index 16f51c15d..41dc562eb 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -1,10 +1,10 @@ package types import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -62,8 +62,8 @@ func (oc2pb) Header(header *Header) ocproto.Header { } } -func (oc2pb) Validator(val *Validator) abci.Validator { - return abci.Validator{ +func (oc2pb) Validator(val *Validator) ocabci.Validator { + return ocabci.Validator{ Address: val.PubKey.Address(), Power: val.VotingPower, } @@ -84,29 +84,29 @@ func (oc2pb) PartSetHeader(header PartSetHeader) tmproto.PartSetHeader { } // XXX: panics on unknown pubkey type -func (oc2pb) ValidatorUpdate(val *Validator) abci.ValidatorUpdate { +func (oc2pb) ValidatorUpdate(val *Validator) ocabci.ValidatorUpdate { pk, err := cryptoenc.PubKeyToProto(val.PubKey) if err != nil { panic(err) } - return abci.ValidatorUpdate{ + return ocabci.ValidatorUpdate{ PubKey: pk, Power: val.VotingPower, } } // XXX: panics on nil or unknown pubkey type -func (oc2pb) ValidatorUpdates(vals *ValidatorSet) []abci.ValidatorUpdate { - validators := make([]abci.ValidatorUpdate, vals.Size()) +func (oc2pb) ValidatorUpdates(vals *ValidatorSet) []ocabci.ValidatorUpdate { + validators := make([]ocabci.ValidatorUpdate, vals.Size()) for i, val := range vals.Validators { validators[i] = OC2PB.ValidatorUpdate(val) } return validators } -func (oc2pb) ConsensusParams(params *tmproto.ConsensusParams) *tmabci.ConsensusParams { - return &tmabci.ConsensusParams{ - Block: &tmabci.BlockParams{ +func (oc2pb) ConsensusParams(params *tmproto.ConsensusParams) *abci.ConsensusParams { + return &abci.ConsensusParams{ + Block: &abci.BlockParams{ MaxBytes: params.Block.MaxBytes, MaxGas: params.Block.MaxGas, }, @@ -116,12 +116,12 @@ func (oc2pb) ConsensusParams(params *tmproto.ConsensusParams) *tmabci.ConsensusP } // XXX: panics on nil or unknown pubkey type -func (oc2pb) NewValidatorUpdate(pubkey crypto.PubKey, power int64) abci.ValidatorUpdate { +func (oc2pb) NewValidatorUpdate(pubkey crypto.PubKey, power int64) ocabci.ValidatorUpdate { pubkeyABCI, err := cryptoenc.PubKeyToProto(pubkey) if err != nil { panic(err) } - return abci.ValidatorUpdate{ + return ocabci.ValidatorUpdate{ PubKey: pubkeyABCI, Power: power, } @@ -135,7 +135,7 @@ var PB2OC = pb2tm{} type pb2tm struct{} -func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error) { +func (pb2tm) ValidatorUpdates(vals []ocabci.ValidatorUpdate) ([]*Validator, error) { tmVals := make([]*Validator, len(vals)) for i, v := range vals { pub, err := cryptoenc.PubKeyFromProto(&v.PubKey) diff --git a/types/protobuf_test.go b/types/protobuf_test.go index f358d53fe..395d4e7be 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -9,7 +9,7 @@ import ( "github.com/tendermint/go-amino" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -44,18 +44,18 @@ func TestABCIValidators(t *testing.T) { tmVal := NewValidator(pkEd, 10) abciVal := OC2PB.ValidatorUpdate(tmVal) - tmVals, err := PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) + tmVals, err := PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) abciVals := OC2PB.ValidatorUpdates(NewValidatorSet(tmVals)) - assert.Equal(t, []abci.ValidatorUpdate{abciVal}, abciVals) + assert.Equal(t, []ocabci.ValidatorUpdate{abciVal}, abciVals) // val with address tmVal.Address = pkEd.Address() abciVal = OC2PB.ValidatorUpdate(tmVal) - tmVals, err = PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) + tmVals, err = PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) } @@ -169,7 +169,7 @@ func TestABCIValidatorWithoutPubKey(t *testing.T) { abciVal := OC2PB.Validator(NewValidator(pkEd, 10)) // pubkey must be nil - tmValExpected := abci.Validator{ + tmValExpected := ocabci.Validator{ Address: pkEd.Address(), Power: 10, } diff --git a/types/results.go b/types/results.go index 1390eb56f..251c1a5a6 100644 --- a/types/results.go +++ b/types/results.go @@ -1,17 +1,17 @@ package types import ( - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/crypto/merkle" ) // ABCIResults wraps the deliver tx results to return a proof. -type ABCIResults []*tmabci.ResponseDeliverTx +type ABCIResults []*abci.ResponseDeliverTx // NewResults strips non-deterministic fields from ResponseDeliverTx responses // and returns ABCIResults. -func NewResults(responses []*tmabci.ResponseDeliverTx) ABCIResults { +func NewResults(responses []*abci.ResponseDeliverTx) ABCIResults { res := make(ABCIResults, len(responses)) for i, d := range responses { res[i] = deterministicResponseDeliverTx(d) @@ -45,8 +45,8 @@ func (a ABCIResults) toByteSlices() [][]byte { // deterministicResponseDeliverTx strips non-deterministic fields from // ResponseDeliverTx and returns another ResponseDeliverTx. -func deterministicResponseDeliverTx(response *tmabci.ResponseDeliverTx) *tmabci.ResponseDeliverTx { - return &tmabci.ResponseDeliverTx{ +func deterministicResponseDeliverTx(response *abci.ResponseDeliverTx) *abci.ResponseDeliverTx { + return &abci.ResponseDeliverTx{ Code: response.Code, Data: response.Data, GasWanted: response.GasWanted, diff --git a/types/results_test.go b/types/results_test.go index c7eba0b9a..5b1be3466 100644 --- a/types/results_test.go +++ b/types/results_test.go @@ -6,16 +6,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmabci "github.com/tendermint/tendermint/abci/types" + abci "github.com/tendermint/tendermint/abci/types" ) func TestABCIResults(t *testing.T) { - a := &tmabci.ResponseDeliverTx{Code: 0, Data: nil} - b := &tmabci.ResponseDeliverTx{Code: 0, Data: []byte{}} - c := &tmabci.ResponseDeliverTx{Code: 0, Data: []byte("one")} - d := &tmabci.ResponseDeliverTx{Code: 14, Data: nil} - e := &tmabci.ResponseDeliverTx{Code: 14, Data: []byte("foo")} - f := &tmabci.ResponseDeliverTx{Code: 14, Data: []byte("bar")} + a := &abci.ResponseDeliverTx{Code: 0, Data: nil} + b := &abci.ResponseDeliverTx{Code: 0, Data: []byte{}} + c := &abci.ResponseDeliverTx{Code: 0, Data: []byte("one")} + d := &abci.ResponseDeliverTx{Code: 14, Data: nil} + e := &abci.ResponseDeliverTx{Code: 14, Data: []byte("foo")} + f := &abci.ResponseDeliverTx{Code: 14, Data: []byte("bar")} // Nil and []byte{} should produce the same bytes bzA, err := a.Marshal() From 02f81a954fac845bb848eb50996aad89ad16a46c Mon Sep 17 00:00:00 2001 From: zemyblue Date: Mon, 23 Jan 2023 20:00:17 +0900 Subject: [PATCH 13/25] feat: clean up the `PublicKey` of `ostracon/crypto/keys` message and `AuthSigMessage` of `ostracon/p2p/conn` --- abci/example/kvstore/persistent_kvstore.go | 2 +- abci/types/types.pb.go | 239 ++++---- crypto/encoding/codec.go | 3 +- p2p/conn/evil_secret_connection_test.go | 4 +- p2p/conn/secret_connection.go | 6 +- privval/msgs_test.go | 2 +- privval/signer_client_test.go | 2 +- privval/signer_requestHandler.go | 2 +- proto/ostracon/abci/types.proto | 4 +- proto/ostracon/crypto/keys.pb.go | 655 --------------------- proto/ostracon/crypto/keys.proto | 17 - proto/ostracon/p2p/conn.pb.go | 376 ------------ proto/ostracon/p2p/conn.proto | 30 - proto/ostracon/privval/types.pb.go | 74 +-- proto/ostracon/privval/types.proto | 4 +- proto/ostracon/types/validator.pb.go | 49 +- proto/ostracon/types/validator.proto | 6 +- test/e2e/app/app.go | 2 +- 18 files changed, 200 insertions(+), 1277 deletions(-) delete mode 100644 proto/ostracon/crypto/keys.pb.go delete mode 100644 proto/ostracon/crypto/keys.proto delete mode 100644 proto/ostracon/p2p/conn.pb.go delete mode 100644 proto/ostracon/p2p/conn.proto diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index 57759ba05..392c3ee84 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -8,13 +8,13 @@ import ( "strings" abci "github.com/tendermint/tendermint/abci/types" + pc "github.com/tendermint/tendermint/proto/tendermint/crypto" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" ocabci "github.com/line/ostracon/abci/types" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/libs/log" - pc "github.com/line/ostracon/proto/ostracon/crypto" ) const ( diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 4ec9e2e4f..7011bdaeb 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -10,10 +10,9 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - crypto "github.com/line/ostracon/proto/ostracon/crypto" types2 "github.com/line/ostracon/proto/ostracon/types" types "github.com/tendermint/tendermint/abci/types" - _ "github.com/tendermint/tendermint/proto/tendermint/crypto" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" _ "github.com/tendermint/tendermint/proto/tendermint/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -1501,124 +1500,124 @@ func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_add var fileDescriptor_addf585b2317eb36 = []byte{ // 1904 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x59, 0x4f, 0x93, 0xdb, 0x48, - 0x15, 0xb7, 0xc7, 0x9e, 0xb1, 0xf5, 0x66, 0xc6, 0x33, 0xf3, 0x32, 0x9b, 0x75, 0xc4, 0x66, 0x26, - 0x38, 0x64, 0x0b, 0x42, 0xb0, 0x8b, 0x04, 0xb6, 0x76, 0x6b, 0x97, 0x3f, 0xb1, 0x77, 0x52, 0x0e, - 0x49, 0x36, 0x89, 0x12, 0x02, 0xc5, 0xc2, 0xaa, 0xda, 0x52, 0x8f, 0x2d, 0x46, 0x56, 0x6b, 0xa5, - 0xf6, 0x6c, 0xcc, 0x8d, 0x23, 0xb7, 0xfd, 0x22, 0x1c, 0xf8, 0x08, 0xdc, 0x96, 0xdb, 0x1e, 0x39, - 0x50, 0x0b, 0x95, 0x5c, 0x80, 0xaf, 0x40, 0x15, 0x45, 0x75, 0xeb,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c3, 0xb7, 0x72, 0x98, 0x34, 0x1a, 0x3d, 0x93, - 0xc4, 0xdf, 0x89, 0x48, 0xbc, 0x51, 0xb0, 0xe8, 0x25, 0x16, 0xbf, 0x97, 0x66, 0xf1, 0x80, 0x83, - 0xaf, 0xe7, 0x46, 0xe7, 0x12, 0xf9, 0xfb, 0x09, 0x22, 0x57, 0xc2, 0x29, 0x64, 0x2f, 0x20, 0x83, - 0xc7, 0x07, 0x29, 0x1e, 0x87, 0x82, 0x4d, 0xcc, 0x21, 0xf2, 0x1f, 0x26, 0x89, 0x7c, 0x3b, 0x47, - 0x07, 0x85, 0xe9, 0x92, 0xc5, 0xe3, 0xef, 0xc5, 0x3c, 0xbe, 0x93, 0x2b, 0x44, 0xc2, 0x15, 0x2c, - 0x13, 0xf9, 0xe3, 0x15, 0x22, 0x0f, 0x88, 0xf7, 0xed, 0x5c, 0x88, 0x02, 0x26, 0x7f, 0xbc, 0xc2, - 0xe4, 0xad, 0x02, 0xc0, 0x02, 0x2a, 0xff, 0x65, 0x36, 0x95, 0xe7, 0x93, 0x6d, 0x38, 0xcd, 0x72, - 0x5c, 0xae, 0xe7, 0x70, 0xf9, 0xbe, 0x84, 0xff, 0x76, 0x2e, 0x7c, 0x69, 0x32, 0xd7, 0xf2, 0xc9, - 0xfc, 0x46, 0xce, 0x19, 0x17, 0xb2, 0xf9, 0xc3, 0x3c, 0x36, 0xbf, 0x9e, 0x9f, 0x35, 0x25, 0xe8, - 0xfc, 0x8f, 0x92, 0x82, 0x96, 0xee, 0x6a, 0x26, 0xf5, 0x56, 0xff, 0x3f, 0xd4, 0xbb, 0xf1, 0x5f, - 0x52, 0xef, 0x15, 0x68, 0x0a, 0xea, 0x95, 0xcc, 0x58, 0x93, 0xcc, 0xd8, 0x20, 0xae, 0x3b, 0x24, - 0xfe, 0xa4, 0xf3, 0x97, 0x0d, 0xd8, 0x5b, 0xba, 0xae, 0x82, 0x44, 0x0d, 0x66, 0x06, 0x8a, 0x64, - 0x57, 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x08, 0x47, 0x9d, 0xdf, 0x01, 0x34, 0x35, 0xea, 0xbb, 0x22, 0x55, 0xb0, 0x0f, 0x0a, 0x7d, 0x65, + 0xd0, 0x00, 0xdb, 0xaa, 0xe1, 0x3b, 0x59, 0x7d, 0xd5, 0x81, 0xf6, 0x71, 0xa4, 0x29, 0x8a, 0x73, + 0x6c, 0x86, 0x77, 0x42, 0xfc, 0xce, 0x87, 0xe2, 0xd0, 0x3c, 0x09, 0xe0, 0xef, 0x46, 0x00, 0x5e, + 0xcb, 0xad, 0xc7, 0x81, 0xd5, 0x12, 0x82, 0xdf, 0x09, 0x11, 0xbc, 0x5e, 0xb0, 0x58, 0x0a, 0xc2, + 0x07, 0x29, 0x08, 0xdf, 0x2c, 0x08, 0x33, 0x07, 0xc3, 0xef, 0xa5, 0x30, 0x7c, 0x2b, 0x07, 0x49, + 0xa3, 0xd5, 0x33, 0x41, 0xfc, 0xdd, 0x08, 0xc4, 0x1b, 0x05, 0x41, 0x2f, 0xa1, 0xf8, 0xfd, 0x34, + 0x8a, 0x07, 0x18, 0x7c, 0x3d, 0xd7, 0x3a, 0x17, 0xc8, 0xef, 0x26, 0x80, 0x5c, 0x09, 0xb7, 0x90, + 0x1d, 0x40, 0x06, 0x8e, 0x0f, 0x52, 0x38, 0x0e, 0x05, 0x87, 0x98, 0x03, 0xe4, 0x3f, 0x4a, 0x02, + 0xf9, 0x85, 0x1c, 0x1e, 0x14, 0xa6, 0x4b, 0x16, 0x8e, 0xff, 0x20, 0xc6, 0xf1, 0xed, 0x5c, 0x22, + 0x12, 0x46, 0xb0, 0x0c, 0xe4, 0x4f, 0x56, 0x80, 0x3c, 0x00, 0xde, 0x77, 0x72, 0x5d, 0x14, 0x20, + 0xf9, 0x93, 0x15, 0x24, 0x6f, 0x15, 0x38, 0x2c, 0x80, 0xf2, 0x5f, 0x65, 0x43, 0x79, 0x3e, 0xd8, + 0x86, 0xdb, 0x2c, 0x87, 0xe5, 0x7a, 0x0e, 0x96, 0xef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, 0xfe, 0xfa, 0xb0, 0xfa, 0xc5, 0xeb, 0xc3, 0xea, 0xdf, 0x5f, 0x1f, 0x56, 0x3f, 0x7b, 0x73, + 0x58, 0xf9, 0xe2, 0xcd, 0x61, 0xe5, 0x2f, 0x6f, 0x0e, 0x2b, 0xbf, 0xbc, 0x3e, 0xb6, 0xf8, 0x64, + 0x36, 0xea, 0x1a, 0x6c, 0xda, 0xb3, 0x2d, 0x87, 0xf6, 0x32, 0xfe, 0x4f, 0x19, 0x6d, 0x49, 0x10, + 0xb9, 0xf3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0xe6, 0x98, 0x9a, 0x6d, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/crypto/encoding/codec.go b/crypto/encoding/codec.go index 333206eb0..4e20536b8 100644 --- a/crypto/encoding/codec.go +++ b/crypto/encoding/codec.go @@ -3,11 +3,12 @@ package encoding import ( "fmt" + pc "github.com/tendermint/tendermint/proto/tendermint/crypto" + "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/secp256k1" "github.com/line/ostracon/libs/json" - pc "github.com/line/ostracon/proto/ostracon/crypto" ) func init() { diff --git a/p2p/conn/evil_secret_connection_test.go b/p2p/conn/evil_secret_connection_test.go index a20339e64..f2ea2afbb 100644 --- a/p2p/conn/evil_secret_connection_test.go +++ b/p2p/conn/evil_secret_connection_test.go @@ -9,13 +9,13 @@ import ( gogotypes "github.com/gogo/protobuf/types" "github.com/gtank/merlin" "github.com/stretchr/testify/assert" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" "golang.org/x/crypto/chacha20poly1305" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/libs/protoio" - ocp2p "github.com/line/ostracon/proto/ostracon/p2p" ) type buffer struct { @@ -117,7 +117,7 @@ func (c *evilConn) Read(data []byte) (n int, err error) { if err != nil { panic(err) } - bz, err := protoio.MarshalDelimited(&ocp2p.AuthSigMessage{PubKey: pkpb, Sig: signature}) + bz, err := protoio.MarshalDelimited(&tmp2p.AuthSigMessage{PubKey: pkpb, Sig: signature}) if err != nil { panic(err) } diff --git a/p2p/conn/secret_connection.go b/p2p/conn/secret_connection.go index 4f849dcf0..17697db5f 100644 --- a/p2p/conn/secret_connection.go +++ b/p2p/conn/secret_connection.go @@ -16,6 +16,7 @@ import ( gogotypes "github.com/gogo/protobuf/types" "github.com/gtank/merlin" pool "github.com/libp2p/go-buffer-pool" + tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p" "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/curve25519" "golang.org/x/crypto/hkdf" @@ -27,7 +28,6 @@ import ( "github.com/line/ostracon/libs/async" "github.com/line/ostracon/libs/protoio" tmsync "github.com/line/ostracon/libs/sync" - ocp2p "github.com/line/ostracon/proto/ostracon/p2p" ) // 4 + 1024 == 1028 total frame size @@ -406,14 +406,14 @@ func shareAuthSignature(sc io.ReadWriter, pubKey crypto.PubKey, signature []byte if err != nil { return nil, true, err } - _, err = protoio.NewDelimitedWriter(sc).WriteMsg(&ocp2p.AuthSigMessage{PubKey: pbpk, Sig: signature}) + _, err = protoio.NewDelimitedWriter(sc).WriteMsg(&tmp2p.AuthSigMessage{PubKey: pbpk, Sig: signature}) if err != nil { return nil, true, err // abort } return nil, false, nil }, func(_ int) (val interface{}, abort bool, err error) { - var pba ocp2p.AuthSigMessage + var pba tmp2p.AuthSigMessage _, err = protoio.NewDelimitedReader(sc, 1024*1024).ReadMsg(&pba) if err != nil { return nil, true, err // abort diff --git a/privval/msgs_test.go b/privval/msgs_test.go index 556d0bd1e..75794c7b4 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -15,7 +16,6 @@ import ( "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/tmhash" - cryptoproto "github.com/line/ostracon/proto/ostracon/crypto" privvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) diff --git a/privval/signer_client_test.go b/privval/signer_client_test.go index 8a1b3428b..9a155db1e 100644 --- a/privval/signer_client_test.go +++ b/privval/signer_client_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -16,7 +17,6 @@ import ( "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/crypto/vrf" tmrand "github.com/line/ostracon/libs/rand" - cryptoproto "github.com/line/ostracon/proto/ostracon/crypto" privvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) diff --git a/privval/signer_requestHandler.go b/privval/signer_requestHandler.go index 00f51243e..dcb55219f 100644 --- a/privval/signer_requestHandler.go +++ b/privval/signer_requestHandler.go @@ -3,12 +3,12 @@ package privval import ( "fmt" + cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" - cryptoproto "github.com/line/ostracon/proto/ostracon/crypto" privvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index 7a81263c8..452946736 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -9,7 +9,7 @@ import "tendermint/crypto/proof.proto"; import "tendermint/types/params.proto"; import "tendermint/abci/types.proto"; import "ostracon/types/types.proto"; -import "ostracon/crypto/keys.proto"; +import "tendermint/crypto/keys.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; @@ -368,7 +368,7 @@ message Validator { // ValidatorUpdate message ValidatorUpdate { - ostracon.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; int64 power = 2; // The voting power } diff --git a/proto/ostracon/crypto/keys.pb.go b/proto/ostracon/crypto/keys.pb.go deleted file mode 100644 index 7ecafbc7b..000000000 --- a/proto/ostracon/crypto/keys.pb.go +++ /dev/null @@ -1,655 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/crypto/keys.proto - -package crypto - -import ( - bytes "bytes" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PublicKey defines the keys available for use with Ostracon Validators -type PublicKey struct { - // Types that are valid to be assigned to Sum: - // *PublicKey_Ed25519 - // *PublicKey_Secp256K1 - Sum isPublicKey_Sum `protobuf_oneof:"sum"` -} - -func (m *PublicKey) Reset() { *m = PublicKey{} } -func (m *PublicKey) String() string { return proto.CompactTextString(m) } -func (*PublicKey) ProtoMessage() {} -func (*PublicKey) Descriptor() ([]byte, []int) { - return fileDescriptor_fe45c29a2e63dfe7, []int{0} -} -func (m *PublicKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PublicKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PublicKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PublicKey.Merge(m, src) -} -func (m *PublicKey) XXX_Size() int { - return m.Size() -} -func (m *PublicKey) XXX_DiscardUnknown() { - xxx_messageInfo_PublicKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PublicKey proto.InternalMessageInfo - -type isPublicKey_Sum interface { - isPublicKey_Sum() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int - Compare(interface{}) int -} - -type PublicKey_Ed25519 struct { - Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"` -} -type PublicKey_Secp256K1 struct { - Secp256K1 []byte `protobuf:"bytes,2,opt,name=secp256k1,proto3,oneof" json:"secp256k1,omitempty"` -} - -func (*PublicKey_Ed25519) isPublicKey_Sum() {} -func (*PublicKey_Secp256K1) isPublicKey_Sum() {} - -func (m *PublicKey) GetSum() isPublicKey_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *PublicKey) GetEd25519() []byte { - if x, ok := m.GetSum().(*PublicKey_Ed25519); ok { - return x.Ed25519 - } - return nil -} - -func (m *PublicKey) GetSecp256K1() []byte { - if x, ok := m.GetSum().(*PublicKey_Secp256K1); ok { - return x.Secp256K1 - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*PublicKey) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*PublicKey_Ed25519)(nil), - (*PublicKey_Secp256K1)(nil), - } -} - -func init() { - proto.RegisterType((*PublicKey)(nil), "ostracon.crypto.PublicKey") -} - -func init() { proto.RegisterFile("ostracon/crypto/keys.proto", fileDescriptor_fe45c29a2e63dfe7) } - -var fileDescriptor_fe45c29a2e63dfe7 = []byte{ - // 200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b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 0x85, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x75, 0xfb, 0x97, 0xf1, 0xef, 0x00, 0x00, 0x00, -} - -func (this *PublicKey) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*PublicKey) - if !ok { - that2, ok := that.(PublicKey) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if that1.Sum == nil { - if this.Sum != nil { - return 1 - } - } else if this.Sum == nil { - return -1 - } else { - thisType := -1 - switch this.Sum.(type) { - case *PublicKey_Ed25519: - thisType = 0 - case *PublicKey_Secp256K1: - thisType = 1 - default: - panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Sum)) - } - that1Type := -1 - switch that1.Sum.(type) { - case *PublicKey_Ed25519: - that1Type = 0 - case *PublicKey_Secp256K1: - that1Type = 1 - default: - panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Sum)) - } - if thisType == that1Type { - if c := this.Sum.Compare(that1.Sum); c != 0 { - return c - } - } else if thisType < that1Type { - return -1 - } else if thisType > that1Type { - return 1 - } - } - return 0 -} -func (this *PublicKey_Ed25519) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*PublicKey_Ed25519) - if !ok { - that2, ok := that.(PublicKey_Ed25519) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := bytes.Compare(this.Ed25519, that1.Ed25519); c != 0 { - return c - } - return 0 -} -func (this *PublicKey_Secp256K1) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*PublicKey_Secp256K1) - if !ok { - that2, ok := that.(PublicKey_Secp256K1) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := bytes.Compare(this.Secp256K1, that1.Secp256K1); c != 0 { - return c - } - return 0 -} -func (this *PublicKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PublicKey) - if !ok { - that2, ok := that.(PublicKey) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Sum == nil { - if this.Sum != nil { - return false - } - } else if this.Sum == nil { - return false - } else if !this.Sum.Equal(that1.Sum) { - return false - } - return true -} -func (this *PublicKey_Ed25519) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PublicKey_Ed25519) - if !ok { - that2, ok := that.(PublicKey_Ed25519) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Ed25519, that1.Ed25519) { - return false - } - return true -} -func (this *PublicKey_Secp256K1) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PublicKey_Secp256K1) - if !ok { - that2, ok := that.(PublicKey_Secp256K1) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Secp256K1, that1.Secp256K1) { - return false - } - return true -} -func (m *PublicKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PublicKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *PublicKey_Ed25519) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey_Ed25519) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Ed25519 != nil { - i -= len(m.Ed25519) - copy(dAtA[i:], m.Ed25519) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Ed25519))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *PublicKey_Secp256K1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey_Secp256K1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Secp256K1 != nil { - i -= len(m.Secp256K1) - copy(dAtA[i:], m.Secp256K1) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Secp256K1))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { - offset -= sovKeys(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PublicKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *PublicKey_Ed25519) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Ed25519 != nil { - l = len(m.Ed25519) - n += 1 + l + sovKeys(uint64(l)) - } - return n -} -func (m *PublicKey_Secp256K1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secp256K1 != nil { - l = len(m.Secp256K1) - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func sovKeys(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKeys(x uint64) (n int) { - return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PublicKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PublicKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PublicKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ed25519", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.Sum = &PublicKey_Ed25519{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secp256K1", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.Sum = &PublicKey_Secp256K1{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKeys(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKeys - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKeys - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKeys - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthKeys - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKeys - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKeys - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/crypto/keys.proto b/proto/ostracon/crypto/keys.proto deleted file mode 100644 index c375549cb..000000000 --- a/proto/ostracon/crypto/keys.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package ostracon.crypto; - -option go_package = "github.com/line/ostracon/proto/ostracon/crypto"; - -import "gogoproto/gogo.proto"; - -// PublicKey defines the keys available for use with Ostracon Validators -message PublicKey { - option (gogoproto.compare) = true; - option (gogoproto.equal) = true; - - oneof sum { - bytes ed25519 = 1; - bytes secp256k1 = 2; - } -} diff --git a/proto/ostracon/p2p/conn.pb.go b/proto/ostracon/p2p/conn.pb.go deleted file mode 100644 index aca675994..000000000 --- a/proto/ostracon/p2p/conn.pb.go +++ /dev/null @@ -1,376 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/p2p/conn.proto - -package p2p - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - crypto "github.com/line/ostracon/proto/ostracon/crypto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type AuthSigMessage struct { - PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Sig []byte `protobuf:"bytes,2,opt,name=sig,proto3" json:"sig,omitempty"` -} - -func (m *AuthSigMessage) Reset() { *m = AuthSigMessage{} } -func (m *AuthSigMessage) String() string { return proto.CompactTextString(m) } -func (*AuthSigMessage) ProtoMessage() {} -func (*AuthSigMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_aeb1ccf8456edf44, []int{0} -} -func (m *AuthSigMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthSigMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthSigMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthSigMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthSigMessage.Merge(m, src) -} -func (m *AuthSigMessage) XXX_Size() int { - return m.Size() -} -func (m *AuthSigMessage) XXX_DiscardUnknown() { - xxx_messageInfo_AuthSigMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthSigMessage proto.InternalMessageInfo - -func (m *AuthSigMessage) GetPubKey() crypto.PublicKey { - if m != nil { - return m.PubKey - } - return crypto.PublicKey{} -} - -func (m *AuthSigMessage) GetSig() []byte { - if m != nil { - return m.Sig - } - return nil -} - -func init() { - proto.RegisterType((*AuthSigMessage)(nil), "ostracon.p2p.AuthSigMessage") -} - -func init() { proto.RegisterFile("ostracon/p2p/conn.proto", fileDescriptor_aeb1ccf8456edf44) } - -var fileDescriptor_aeb1ccf8456edf44 = []byte{ - // 226 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x2f, 0x2e, 0x29, - 0x4a, 0x4c, 0xce, 0xcf, 0xd3, 0x2f, 0x30, 0x2a, 0xd0, 0x4f, 0xce, 0xcf, 0xcb, 0xd3, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x49, 0xe8, 0x15, 0x18, 0x15, 0x48, 0x89, 0xa4, 0xe7, 0xa7, - 0xe7, 0x83, 0x25, 0xf4, 0x41, 0x2c, 0x88, 0x1a, 0x29, 0x29, 0xb8, 0xe6, 0xe4, 0xa2, 0xca, 0x82, - 0x92, 0x7c, 0xfd, 0xec, 0xd4, 0xca, 0x62, 0x88, 0x9c, 0x52, 0x2c, 0x17, 0x9f, 0x63, 0x69, 0x49, - 0x46, 0x70, 0x66, 0xba, 0x6f, 0x6a, 0x71, 0x71, 0x62, 0x7a, 0xaa, 0x90, 0x25, 0x17, 0x7b, 0x41, - 0x69, 0x52, 0x7c, 0x76, 0x6a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x94, 0x1e, 0xdc, - 0x0e, 0x88, 0x7e, 0xbd, 0x80, 0xd2, 0xa4, 0x9c, 0xcc, 0x64, 0xef, 0xd4, 0x4a, 0x27, 0x96, 0x13, - 0xf7, 0xe4, 0x19, 0x82, 0xd8, 0x0a, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, 0x04, 0xb8, 0x98, 0x8b, - 0x33, 0xd3, 0x25, 0x98, 0x14, 0x18, 0x35, 0x78, 0x82, 0x40, 0x4c, 0x27, 0xd7, 0x13, 0x8f, 0xe4, - 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, - 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, - 0xce, 0xcf, 0xd5, 0xcf, 0xc9, 0xcc, 0x4b, 0xd5, 0x47, 0xf8, 0x10, 0xec, 0x7e, 0x64, 0x0f, 0x27, - 0xb1, 0x81, 0xc5, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xc0, 0xb7, 0x36, 0x07, 0x01, - 0x00, 0x00, -} - -func (m *AuthSigMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthSigMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthSigMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Sig) > 0 { - i -= len(m.Sig) - copy(dAtA[i:], m.Sig) - i = encodeVarintConn(dAtA, i, uint64(len(m.Sig))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintConn(dAtA []byte, offset int, v uint64) int { - offset -= sovConn(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AuthSigMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PubKey.Size() - n += 1 + l + sovConn(uint64(l)) - l = len(m.Sig) - if l > 0 { - n += 1 + l + sovConn(uint64(l)) - } - return n -} - -func sovConn(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozConn(x uint64) (n int) { - return sovConn(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *AuthSigMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthSigMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthSigMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sig", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sig = append(m.Sig[:0], dAtA[iNdEx:postIndex]...) - if m.Sig == nil { - m.Sig = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipConn(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConn - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConn - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConn - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthConn - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupConn - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthConn - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthConn = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowConn = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupConn = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/p2p/conn.proto b/proto/ostracon/p2p/conn.proto deleted file mode 100644 index b2535503b..000000000 --- a/proto/ostracon/p2p/conn.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package ostracon.p2p; - -option go_package = "github.com/line/ostracon/proto/ostracon/p2p"; - -import "gogoproto/gogo.proto"; -import "ostracon/crypto/keys.proto"; - -//message PacketPing {} - -//message PacketPong {} - -//message PacketMsg { -// int32 channel_id = 1 [(gogoproto.customname) = "ChannelID"]; -// bool eof = 2 [(gogoproto.customname) = "EOF"]; -// bytes data = 3; -//} - -//message Packet { -// oneof sum { -// PacketPing packet_ping = 1; -// PacketPong packet_pong = 2; -// PacketMsg packet_msg = 3; -// } -//} - -message AuthSigMessage { - ostracon.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; - bytes sig = 2; -} diff --git a/proto/ostracon/privval/types.pb.go b/proto/ostracon/privval/types.pb.go index b33d056bc..8a136e4d0 100644 --- a/proto/ostracon/privval/types.pb.go +++ b/proto/ostracon/privval/types.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - crypto "github.com/line/ostracon/proto/ostracon/crypto" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" privval "github.com/tendermint/tendermint/proto/tendermint/privval" _ "github.com/tendermint/tendermint/proto/tendermint/types" io "io" @@ -377,42 +377,42 @@ func init() { proto.RegisterFile("ostracon/privval/types.proto", fileDescriptor_ var fileDescriptor_abbbbe5131a55005 = []byte{ // 578 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x4d, 0x6f, 0xd3, 0x30, - 0x18, 0xc7, 0x13, 0xb6, 0xb6, 0xe8, 0x59, 0xb7, 0x76, 0xa6, 0xa0, 0xaa, 0x9a, 0xb2, 0x51, 0xc4, - 0x8b, 0x40, 0x4a, 0x24, 0x38, 0x21, 0x6e, 0x15, 0x2f, 0x43, 0x05, 0xa9, 0x64, 0xd2, 0x0e, 0x93, - 0x50, 0xd5, 0x97, 0xa7, 0x21, 0x5a, 0x1b, 0x1b, 0xdb, 0xa9, 0x94, 0x6f, 0xc0, 0x91, 0x8f, 0xb5, - 0xe3, 0x6e, 0x70, 0x42, 0xa8, 0xbd, 0xc0, 0xb7, 0x40, 0x71, 0xdc, 0x24, 0x7d, 0xe3, 0xb2, 0x5b, - 0xfc, 0xf7, 0x93, 0x9f, 0x7f, 0x76, 0x9e, 0x18, 0x8e, 0xa8, 0x90, 0xbc, 0x37, 0xa0, 0x81, 0xc3, - 0xb8, 0x3f, 0x9d, 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, 0xc0, 0x4b, 0xed, 0x4b, 0x8a, 0x7d, 0xb2, 0xb5, 0x1b, 0xfc, 0xc0, 0xcb, 0xac, 0x0f, 0x58, + 0x36, 0x24, 0x6f, 0xe0, 0x50, 0x53, 0xb4, 0xe2, 0xff, 0xba, 0x0d, 0x76, 0x62, 0x52, 0xb1, 0x32, + 0xcb, 0x8d, 0x49, 0x17, 0x8e, 0x67, 0x7c, 0xdc, 0x53, 0x5d, 0x9f, 0x3a, 0xfd, 0x2a, 0xe9, 0x16, + 0xdd, 0x68, 0xaa, 0xb5, 0x7f, 0x2d, 0xee, 0x81, 0x19, 0x1f, 0xaf, 0xfc, 0x7e, 0x17, 0x40, 0xf2, + 0x44, 0xed, 0xf7, 0x3b, 0x41, 0xb6, 0xfe, 0x86, 0x4c, 0x15, 0xab, 0x19, 0x33, 0xc9, 0xda, 0x05, + 0xd8, 0x13, 0xe1, 0xb4, 0xfd, 0xf6, 0x66, 0x6e, 0x99, 0xb7, 0x73, 0xcb, 0xfc, 0x39, 0xb7, 0xcc, + 0xaf, 0x0b, 0xcb, 0xb8, 0x5d, 0x58, 0xc6, 0xf7, 0x85, 0x65, 0x5c, 0x39, 0x9e, 0x2f, 0x3f, 0x85, + 0x03, 0x7b, 0x48, 0xa7, 0xce, 0xc4, 0x0f, 0xd0, 0xc9, 0x5d, 0xa3, 0xf1, 0xed, 0xb7, 0x7e, 0xab, + 0x0e, 0x8a, 0x2a, 0x7f, 0xf1, 0x27, 0x00, 0x00, 0xff, 0xff, 0x40, 0x6c, 0x4e, 0xf2, 0x70, 0x05, 0x00, 0x00, } diff --git a/proto/ostracon/privval/types.proto b/proto/ostracon/privval/types.proto index 01397862e..5279faae2 100644 --- a/proto/ostracon/privval/types.proto +++ b/proto/ostracon/privval/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package ostracon.privval; -import "ostracon/crypto/keys.proto"; +import "tendermint/crypto/keys.proto"; import "gogoproto/gogo.proto"; import "tendermint/types/types.proto"; import "tendermint/privval/types.proto"; @@ -29,7 +29,7 @@ option go_package = "github.com/line/ostracon/proto/ostracon/privval"; // PubKeyResponse is a response message containing the public key. message PubKeyResponse { - ostracon.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; tendermint.privval.RemoteSignerError error = 2; } diff --git a/proto/ostracon/types/validator.pb.go b/proto/ostracon/types/validator.pb.go index 4b5249603..135822ee0 100644 --- a/proto/ostracon/types/validator.pb.go +++ b/proto/ostracon/types/validator.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - crypto "github.com/line/ostracon/proto/ostracon/crypto" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" io "io" math "math" math_bits "math/bits" @@ -206,29 +206,30 @@ func init() { func init() { proto.RegisterFile("ostracon/types/validator.proto", fileDescriptor_eeeaf81579407bf3) } var fileDescriptor_eeeaf81579407bf3 = []byte{ - // 351 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xb1, 0x6e, 0xf2, 0x30, - 0x10, 0xc7, 0x63, 0x40, 0xa0, 0xcf, 0xa0, 0xaf, 0xad, 0xd5, 0x21, 0xcd, 0x90, 0x52, 0xa6, 0x48, - 0x6d, 0x13, 0x09, 0x26, 0x56, 0x96, 0x0e, 0x2c, 0x28, 0x48, 0x0c, 0x5d, 0xa2, 0x24, 0x58, 0xa9, - 0x45, 0xe0, 0x2c, 0xc7, 0x01, 0xf9, 0x2d, 0xfa, 0x28, 0x7d, 0x0c, 0x46, 0xc6, 0x4e, 0x55, 0x05, - 0x2f, 0x52, 0x91, 0x34, 0x49, 0x51, 0x5b, 0x75, 0x4b, 0xee, 0x77, 0xbe, 0xff, 0xcf, 0x3a, 0x63, - 0x13, 0x12, 0x29, 0xfc, 0x10, 0x56, 0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0xf2, 0x59, 0xef, - 0x31, 0x7c, 0x36, 0x65, 0x4b, 0x1e, 0xd3, 0xca, 0x7b, 0x50, 0xd9, 0xa1, 0xbf, 0xec, 0x7e, 0xf5, - 0xaa, 0x7d, 0xf3, 0x1a, 0x3d, 0x6c, 0xf7, 0x26, 0xda, 0xed, 0x4d, 0xf4, 0xbe, 0x37, 0xd1, 0xf3, - 0xc1, 0xd4, 0x76, 0x07, 0x53, 0x7b, 0x3d, 0x98, 0xda, 0xe3, 0x7d, 0xc4, 0xe4, 0x53, 0x1a, 0xd8, - 0x21, 0x2c, 0x9d, 0x98, 0xad, 0xa8, 0x53, 0x2e, 0x37, 0xdf, 0xfb, 0xe9, 0x8b, 0x09, 0x9a, 0x59, - 0x75, 0xf0, 0x11, 0x00, 0x00, 0xff, 0xff, 0x44, 0x09, 0x04, 0x59, 0x4a, 0x02, 0x00, 0x00, + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xbd, 0x6e, 0xe2, 0x40, + 0x10, 0x80, 0xbd, 0x80, 0x40, 0xb7, 0xa0, 0xfb, 0x59, 0x5d, 0xe1, 0x43, 0xc8, 0xc7, 0x51, 0x59, + 0xba, 0x64, 0x2d, 0x11, 0xa5, 0x88, 0xd2, 0xd1, 0xa4, 0xa0, 0x41, 0x46, 0xa2, 0x48, 0x63, 0xf9, + 0x67, 0xe5, 0xac, 0x30, 0x9e, 0xd5, 0x7a, 0x0d, 0xf2, 0x5b, 0xe4, 0x59, 0xf2, 0x14, 0x94, 0x94, + 0xa9, 0xa2, 0x08, 0x5e, 0x24, 0xc2, 0x8e, 0xed, 0xa0, 0x24, 0x4a, 0xb7, 0x3b, 0xdf, 0xec, 0xcc, + 0x37, 0xda, 0xc1, 0x06, 0x24, 0x4a, 0xba, 0x3e, 0xc4, 0x96, 0xca, 0x04, 0x4b, 0xac, 0xb5, 0x1b, + 0xf1, 0xc0, 0x55, 0x20, 0xa9, 0x90, 0xa0, 0x80, 0x7c, 0x2f, 0x39, 0xcd, 0x79, 0xff, 0x77, 0x08, + 0x21, 0xe4, 0xc8, 0x3a, 0x9e, 0x8a, 0xac, 0xfe, 0x40, 0xb1, 0x38, 0x60, 0x72, 0xc5, 0x63, 0x65, + 0xf9, 0x32, 0x13, 0x0a, 0xac, 0x25, 0xcb, 0x92, 0x82, 0x8e, 0x36, 0xb8, 0xb7, 0x28, 0xcb, 0xce, + 0x99, 0x22, 0x57, 0x18, 0x57, 0x6d, 0x12, 0x1d, 0x0d, 0x9b, 0x66, 0x77, 0xfc, 0x87, 0x9e, 0x36, + 0xa2, 0xd5, 0x0b, 0xfb, 0x4d, 0x32, 0x39, 0xc3, 0x44, 0x81, 0x72, 0x23, 0x67, 0x0d, 0x8a, 0xc7, + 0xa1, 0x23, 0x60, 0xc3, 0xa4, 0xde, 0x1c, 0x22, 0xb3, 0x69, 0xff, 0xcc, 0xc9, 0x22, 0x07, 0xb3, + 0x63, 0x7c, 0xf4, 0x80, 0xf0, 0xb7, 0xaa, 0x0e, 0xd1, 0x71, 0xc7, 0x0d, 0x02, 0xc9, 0x92, 0x63, + 0x4f, 0x64, 0xf6, 0xec, 0xf2, 0x4a, 0xae, 0x71, 0x47, 0xa4, 0x9e, 0xb3, 0x64, 0x99, 0xde, 0x18, + 0x22, 0xb3, 0x3b, 0x1e, 0xd0, 0x7a, 0x20, 0x5a, 0x0c, 0x44, 0x67, 0xa9, 0x17, 0x71, 0x7f, 0xca, + 0xb2, 0x49, 0x6b, 0xfb, 0xf4, 0x57, 0xb3, 0xdb, 0x22, 0xf5, 0xa6, 0x2c, 0x23, 0xff, 0x70, 0xef, + 0x03, 0x99, 0xee, 0xba, 0xf6, 0x20, 0xff, 0xf1, 0x2f, 0x21, 0x41, 0x40, 0xc2, 0xa4, 0x23, 0x24, + 0x07, 0xc9, 0x55, 0xa6, 0xb7, 0x0a, 0xe9, 0x12, 0xcc, 0x5e, 0xe3, 0xa3, 0x25, 0xfe, 0x31, 0xe7, + 0x2b, 0x11, 0xb1, 0xda, 0xfc, 0xb2, 0xf6, 0x43, 0x5f, 0xfb, 0x7d, 0x6a, 0xd6, 0x78, 0x67, 0x36, + 0xb9, 0xd9, 0xee, 0x0d, 0xb4, 0xdb, 0x1b, 0xe8, 0x79, 0x6f, 0xa0, 0xfb, 0x83, 0xa1, 0xed, 0x0e, + 0x86, 0xf6, 0x78, 0x30, 0xb4, 0xdb, 0xf3, 0x90, 0xab, 0xbb, 0xd4, 0xa3, 0x3e, 0xac, 0xac, 0x88, + 0xc7, 0xcc, 0xaa, 0x16, 0xa5, 0xf8, 0xfd, 0xd3, 0xbd, 0xf1, 0xda, 0x79, 0xf4, 0xe2, 0x25, 0x00, + 0x00, 0xff, 0xff, 0x38, 0x9e, 0xda, 0xa7, 0x50, 0x02, 0x00, 0x00, } func (m *ValidatorSet) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/types/validator.proto b/proto/ostracon/types/validator.proto index 2e0b57b66..5741ef4fb 100644 --- a/proto/ostracon/types/validator.proto +++ b/proto/ostracon/types/validator.proto @@ -4,7 +4,7 @@ package ostracon.types; option go_package = "github.com/line/ostracon/proto/ostracon/types"; import "gogoproto/gogo.proto"; -import "ostracon/crypto/keys.proto"; +import "tendermint/crypto/keys.proto"; message ValidatorSet { repeated Validator validators = 1; @@ -14,12 +14,12 @@ message ValidatorSet { message Validator { bytes address = 1; - ostracon.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; + tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; int64 voting_power = 3; int64 proposer_priority = 4; } message SimpleValidator { - ostracon.crypto.PublicKey pub_key = 1; + tendermint.crypto.PublicKey pub_key = 1; int64 voting_power = 2; } diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index ecc2a259d..b3cb81aa8 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -11,12 +11,12 @@ import ( "time" abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/proto/tendermint/crypto" "github.com/line/ostracon/abci/example/code" ocabci "github.com/line/ostracon/abci/types" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/libs/log" - "github.com/line/ostracon/proto/ostracon/crypto" "github.com/line/ostracon/version" ) From 3668c26052df6ab00528e7730e51c09dfd9b91aa Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 25 Jan 2023 14:56:27 +0900 Subject: [PATCH 14/25] feat!: replace `types.validator.proto` to Tendermint proto - ValidatorSet, Validator, SimpleValidator --- proto/ostracon/state/types.pb.go | 108 ++-- proto/ostracon/state/types.proto | 10 +- proto/ostracon/types/evidence.pb.go | 85 +-- proto/ostracon/types/evidence.proto | 4 +- proto/ostracon/types/types.pb.go | 108 ++-- proto/ostracon/types/types.proto | 4 +- proto/ostracon/types/validator.pb.go | 885 --------------------------- proto/ostracon/types/validator.proto | 25 - types/evidence.go | 2 +- types/validator.go | 11 +- types/validator_set.go | 13 +- types/validator_set_test.go | 3 +- 12 files changed, 175 insertions(+), 1083 deletions(-) delete mode 100644 proto/ostracon/types/validator.pb.go delete mode 100644 proto/ostracon/types/validator.proto diff --git a/proto/ostracon/state/types.pb.go b/proto/ostracon/state/types.pb.go index 53145af5c..2e7bbb9ac 100644 --- a/proto/ostracon/state/types.pb.go +++ b/proto/ostracon/state/types.pb.go @@ -10,10 +10,10 @@ import ( _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types1 "github.com/line/ostracon/abci/types" - types2 "github.com/line/ostracon/proto/ostracon/types" + _ "github.com/line/ostracon/proto/ostracon/types" types "github.com/tendermint/tendermint/abci/types" state "github.com/tendermint/tendermint/proto/tendermint/state" - types3 "github.com/tendermint/tendermint/proto/tendermint/types" + types2 "github.com/tendermint/tendermint/proto/tendermint/types" _ "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" @@ -156,7 +156,7 @@ type State struct { InitialHeight int64 `protobuf:"varint,14,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockID types3.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` + LastBlockID types2.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` // LastValidators is used to validate block.LastCommit. // Validators are persisted to the database separately every time they change, @@ -170,7 +170,7 @@ type State struct { LastHeightValidatorsChanged int64 `protobuf:"varint,9,opt,name=last_height_validators_changed,json=lastHeightValidatorsChanged,proto3" json:"last_height_validators_changed,omitempty"` // Consensus parameters used for validating blocks. // Changes returned by EndBlock and updated after Commit. - ConsensusParams types3.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` + ConsensusParams types2.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` LastHeightConsensusParamsChanged int64 `protobuf:"varint,11,opt,name=last_height_consensus_params_changed,json=lastHeightConsensusParamsChanged,proto3" json:"last_height_consensus_params_changed,omitempty"` // Merkle root of the results from executing prev block LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` @@ -241,11 +241,11 @@ func (m *State) GetLastBlockHeight() int64 { return 0 } -func (m *State) GetLastBlockID() types3.BlockID { +func (m *State) GetLastBlockID() types2.BlockID { if m != nil { return m.LastBlockID } - return types3.BlockID{} + return types2.BlockID{} } func (m *State) GetLastBlockTime() time.Time { @@ -283,11 +283,11 @@ func (m *State) GetLastHeightValidatorsChanged() int64 { return 0 } -func (m *State) GetConsensusParams() types3.ConsensusParams { +func (m *State) GetConsensusParams() types2.ConsensusParams { if m != nil { return m.ConsensusParams } - return types3.ConsensusParams{} + return types2.ConsensusParams{} } func (m *State) GetLastHeightConsensusParamsChanged() int64 { @@ -329,52 +329,52 @@ func init() { proto.RegisterFile("ostracon/state/types.proto", fileDescriptor_89 var fileDescriptor_898987a4421067cd = []byte{ // 754 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x4f, 0xdb, 0x4a, - 0x14, 0x8d, 0x5f, 0x80, 0x84, 0x31, 0x49, 0xde, 0x1b, 0xde, 0xc2, 0x04, 0x9e, 0x93, 0x97, 0xf7, - 0x51, 0x54, 0xa9, 0x8e, 0x44, 0x57, 0x95, 0xd8, 0xe0, 0x04, 0x95, 0x48, 0xa8, 0x42, 0x06, 0xb1, - 0xe8, 0xc6, 0x9a, 0xd8, 0x83, 0x3d, 0xaa, 0xe3, 0xb1, 0x3c, 0x93, 0x88, 0xae, 0xdb, 0x1f, 0xc0, - 0xcf, 0x62, 0xc9, 0x92, 0x15, 0xad, 0xc2, 0xa6, 0x3f, 0xa3, 0x9a, 0x19, 0xdb, 0x71, 0x88, 0x2a, - 0x65, 0x37, 0xbe, 0xe7, 0xdc, 0x33, 0x67, 0xee, 0xbd, 0xe3, 0x01, 0x6d, 0xca, 0x78, 0x8a, 0x3c, - 0x1a, 0xf7, 0x19, 0x47, 0x1c, 0xf7, 0xf9, 0xe7, 0x04, 0x33, 0x2b, 0x49, 0x29, 0xa7, 0xb0, 0x99, - 0x63, 0x96, 0xc4, 0xda, 0x7f, 0x06, 0x34, 0xa0, 0x12, 0xea, 0x8b, 0x95, 0x62, 0xb5, 0xf7, 0x0a, - 0x05, 0x34, 0xf6, 0x48, 0x59, 0xa0, 0xbd, 0x10, 0x97, 0xd1, 0x25, 0xcc, 0x7c, 0x81, 0xcd, 0x50, - 0x44, 0x7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0x4d, 0xed, 0x61, 0x6e, 0x6a, 0xdf, 0xe7, 0xa6, 0x76, 0xf7, - 0x6c, 0x56, 0x1e, 0x9e, 0xcd, 0xca, 0xe3, 0xb3, 0x59, 0xf9, 0xf8, 0x26, 0x20, 0x3c, 0x9c, 0x8e, - 0x2d, 0x8f, 0x4e, 0xfa, 0x11, 0x89, 0x71, 0xbf, 0x78, 0x08, 0xd4, 0xd3, 0xb2, 0xfc, 0x20, 0x8d, - 0xb7, 0x64, 0xf4, 0xed, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0x5a, 0xa7, 0xe8, 0xa9, 0x06, + 0x14, 0x8d, 0x5f, 0x80, 0x84, 0x31, 0x49, 0xde, 0x1b, 0xde, 0xc2, 0x84, 0xf7, 0x9c, 0x34, 0xfd, + 0x42, 0x95, 0xea, 0x48, 0x74, 0x55, 0xa9, 0xaa, 0x54, 0x27, 0x15, 0x44, 0x42, 0x15, 0x32, 0x88, + 0x45, 0x37, 0xd6, 0xc4, 0x1e, 0xec, 0x51, 0x1d, 0xdb, 0xf2, 0x4c, 0x22, 0xfa, 0x03, 0xba, 0xe9, + 0x8a, 0x9f, 0xc5, 0x92, 0x25, 0x2b, 0x5a, 0x85, 0x4d, 0x7f, 0x46, 0x35, 0x33, 0xb6, 0x33, 0x21, + 0xaa, 0x94, 0xdd, 0xe4, 0x9e, 0x73, 0x8f, 0x8f, 0xef, 0x3d, 0x13, 0x83, 0x76, 0x42, 0x59, 0x86, + 0xbc, 0x24, 0xee, 0x53, 0x86, 0x18, 0xee, 0xb3, 0xaf, 0x29, 0xa6, 0x56, 0x9a, 0x25, 0x2c, 0x81, + 0xcd, 0x02, 0xb3, 0x04, 0xd6, 0xfe, 0x37, 0x48, 0x82, 0x44, 0x40, 0x7d, 0x7e, 0x92, 0xac, 0xf6, + 0x5e, 0xa9, 0x80, 0xc6, 0x1e, 0x51, 0x05, 0xda, 0x0b, 0x71, 0x51, 0x5d, 0xc2, 0xba, 0x0c, 0xc7, + 0x3e, 0xce, 0x26, 0x24, 0x66, 0x39, 0x3a, 0x43, 0x11, 0xf1, 0x11, 0x4b, 0xb2, 0x9c, 0xf1, 0xff, + 0x0a, 0x23, 0x45, 0x19, 0x9a, 0x14, 0x02, 0xff, 0xad, 0xc0, 0xaa, 0xbc, 0xa9, 0xa0, 0x33, 0x9c, + 0x51, 0x52, 0x98, 0xc8, 0xf1, 0x4e, 0x90, 0x24, 0x41, 0x84, 0xfb, 0xe2, 0xd7, 0x78, 0x7a, 0xd9, + 0x67, 0x64, 0x82, 0x29, 0x43, 0x93, 0x74, 0x2d, 0x79, 0x15, 0x5d, 0x19, 0x5c, 0x7b, 0x5f, 0x41, + 0x1f, 0x0f, 0xa5, 0x77, 0xa7, 0x81, 0xc6, 0x07, 0x7b, 0x30, 0x72, 0x30, 0x4d, 0x93, 0x98, 0x62, + 0x0a, 0x07, 0x40, 0xf7, 0x71, 0x44, 0x66, 0x38, 0x73, 0xd9, 0x15, 0x35, 0xb4, 0x6e, 0xf5, 0x40, + 0x3f, 0xec, 0x59, 0x0b, 0x11, 0x8b, 0x8b, 0x58, 0x45, 0xc3, 0x50, 0x72, 0xcf, 0xaf, 0x1c, 0xe0, + 0x17, 0x47, 0x0a, 0xdf, 0x81, 0x6d, 0x1c, 0xfb, 0xee, 0x38, 0x4a, 0xbc, 0x2f, 0xc6, 0x5f, 0x5d, + 0xed, 0x40, 0x3f, 0xec, 0x58, 0xe5, 0x02, 0x97, 0x04, 0x3e, 0xc6, 0xbe, 0xcd, 0x69, 0x4e, 0x1d, + 0xe7, 0x27, 0x38, 0x04, 0xfa, 0x18, 0x07, 0x24, 0xce, 0xfb, 0xab, 0xa2, 0xff, 0xe9, 0x1f, 0x2d, + 0xd8, 0x9c, 0x2b, 0x35, 0xc0, 0xb8, 0x3c, 0xf7, 0xbe, 0x69, 0xa0, 0x79, 0x51, 0x6c, 0x91, 0x8e, + 0xe2, 0xcb, 0x04, 0x0e, 0x40, 0xa3, 0xdc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ba, 0x99, 0x9b, 0xda, 0xed, 0xdc, 0xd4, 0x7e, 0xce, 0x4d, 0xed, 0xfa, + 0xc1, 0xac, 0xdc, 0x3e, 0x98, 0x95, 0xbb, 0x07, 0xb3, 0xf2, 0xf9, 0x75, 0x40, 0x58, 0x38, 0x1d, + 0x5b, 0x5e, 0x32, 0xe9, 0x47, 0x24, 0xc6, 0xfd, 0xf2, 0x73, 0x21, 0x3f, 0x32, 0xcb, 0x9f, 0xa6, + 0xf1, 0x96, 0xa8, 0xbe, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x58, 0x80, 0x9e, 0xad, 0xb3, 0x06, 0x00, 0x00, } diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index 6e487f31d..fce3ad884 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -6,7 +6,7 @@ option go_package = "github.com/line/ostracon/proto/ostracon/state"; import "gogoproto/gogo.proto"; import "ostracon/abci/types.proto"; import "ostracon/types/types.proto"; -import "ostracon/types/validator.proto"; +import "tendermint/types/validator.proto"; import "tendermint/types/params.proto"; import "tendermint/types/types.proto"; import "tendermint/version/types.proto"; @@ -26,7 +26,7 @@ message ABCIResponses { // ValidatorsInfo represents the latest validator set, or the last height it changed message ValidatorsInfo { - ostracon.types.ValidatorSet validator_set = 1; + tendermint.types.ValidatorSet validator_set = 1; int64 last_height_changed = 2; } @@ -61,9 +61,9 @@ message State { // Note that if s.LastBlockHeight causes a valset change, // we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1 // Extra +1 due to nextValSet delay. - ostracon.types.ValidatorSet next_validators = 6; - ostracon.types.ValidatorSet validators = 7; - ostracon.types.ValidatorSet last_validators = 8; + tendermint.types.ValidatorSet next_validators = 6; + tendermint.types.ValidatorSet validators = 7; + tendermint.types.ValidatorSet last_validators = 8; int64 last_height_validators_changed = 9; // Consensus parameters used for validating blocks. diff --git a/proto/ostracon/types/evidence.pb.go b/proto/ostracon/types/evidence.pb.go index 09812a3b7..d9beb7cd9 100644 --- a/proto/ostracon/types/evidence.pb.go +++ b/proto/ostracon/types/evidence.pb.go @@ -192,11 +192,11 @@ func (m *DuplicateVoteEvidence) GetTimestamp() time.Time { // LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. type LightClientAttackEvidence struct { - ConflictingBlock *LightBlock `protobuf:"bytes,1,opt,name=conflicting_block,json=conflictingBlock,proto3" json:"conflicting_block,omitempty"` - CommonHeight int64 `protobuf:"varint,2,opt,name=common_height,json=commonHeight,proto3" json:"common_height,omitempty"` - ByzantineValidators []*Validator `protobuf:"bytes,3,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators,omitempty"` - TotalVotingPower int64 `protobuf:"varint,4,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` + ConflictingBlock *LightBlock `protobuf:"bytes,1,opt,name=conflicting_block,json=conflictingBlock,proto3" json:"conflicting_block,omitempty"` + CommonHeight int64 `protobuf:"varint,2,opt,name=common_height,json=commonHeight,proto3" json:"common_height,omitempty"` + ByzantineValidators []*types.Validator `protobuf:"bytes,3,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators,omitempty"` + TotalVotingPower int64 `protobuf:"varint,4,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` + Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` } func (m *LightClientAttackEvidence) Reset() { *m = LightClientAttackEvidence{} } @@ -246,7 +246,7 @@ func (m *LightClientAttackEvidence) GetCommonHeight() int64 { return 0 } -func (m *LightClientAttackEvidence) GetByzantineValidators() []*Validator { +func (m *LightClientAttackEvidence) GetByzantineValidators() []*types.Validator { if m != nil { return m.ByzantineValidators } @@ -321,41 +321,42 @@ func init() { func init() { proto.RegisterFile("ostracon/types/evidence.proto", fileDescriptor_97062afbc223b6b9) } var fileDescriptor_97062afbc223b6b9 = []byte{ - // 543 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xe3, 0x38, 0xa9, 0xc2, 0xb6, 0x94, 0xb2, 0xb4, 0x90, 0x44, 0xc5, 0x89, 0x82, 0x10, - 0x41, 0xa2, 0xb6, 0x54, 0x6e, 0xdc, 0x6a, 0x40, 0xad, 0x50, 0x0e, 0xc8, 0x42, 0x39, 0x70, 0xb1, - 0x6c, 0x67, 0xeb, 0xac, 0xba, 0xde, 0x8d, 0xe2, 0x49, 0x50, 0x79, 0x8a, 0x3c, 0x56, 0xb9, 0xf5, - 0xc8, 0x09, 0xaa, 0xe4, 0x45, 0xd0, 0x6e, 0xec, 0x4d, 0x6a, 0x12, 0x4e, 0x5c, 0xa2, 0x78, 0xfe, - 0x6f, 0x3c, 0x33, 0xbf, 0x67, 0x17, 0x3d, 0x17, 0x29, 0x8c, 0x83, 0x48, 0x70, 0x07, 0xae, 0x47, - 0x24, 0x75, 0xc8, 0x94, 0x0e, 0x08, 0x8f, 0x88, 0x3d, 0x1a, 0x0b, 0x10, 0x78, 0x3f, 0x97, 0x6d, - 0x25, 0x37, 0x0f, 0x63, 0x11, 0x0b, 0x25, 0x39, 0xf2, 0xdf, 0x92, 0x6a, 0xb6, 0x62, 0x21, 0x62, - 0x46, 0x1c, 0xf5, 0x14, 0x4e, 0x2e, 0x1d, 0xa0, 0x09, 0x49, 0x21, 0x48, 0x46, 0x19, 0xd0, 0x2c, - 0x54, 0x51, 0xbf, 0x99, 0x66, 0x15, 0xb4, 0x69, 0xc0, 0xe8, 0x20, 0x00, 0x31, 0xce, 0xf4, 0x63, - 0x20, 0x7c, 0x40, 0xc6, 0x09, 0xe5, 0xf0, 0x77, 0x76, 0xe7, 0xce, 0x40, 0xb5, 0x8f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4, 0x67, 0x9f, 0x04, 0x00, 0x00, + // 545 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6f, 0x12, 0x41, + 0x14, 0xc7, 0x59, 0x16, 0x1a, 0x9c, 0xd6, 0x5a, 0xc7, 0x56, 0x29, 0xd6, 0x85, 0x60, 0x8c, 0x98, + 0xd8, 0xdd, 0xa4, 0xde, 0xbc, 0x75, 0xd5, 0xb4, 0x31, 0x8d, 0x31, 0x1b, 0xd3, 0x83, 0x97, 0xcd, + 0xee, 0x32, 0x5d, 0x26, 0x9d, 0x9d, 0x21, 0xec, 0x03, 0x53, 0x3f, 0x05, 0x1f, 0xab, 0x89, 0x97, + 0x1e, 0x3d, 0x69, 0x03, 0x5f, 0xc4, 0xcc, 0x30, 0x3b, 0x50, 0x04, 0x4f, 0x5e, 0x08, 0xbc, 0xff, + 0xef, 0xcd, 0x7b, 0xef, 0x3f, 0x8f, 0x41, 0xcf, 0x44, 0x0e, 0x83, 0x28, 0x11, 0xdc, 0x83, 0xab, + 0x3e, 0xc9, 0x3d, 0x32, 0xa2, 0x5d, 0xc2, 0x13, 0xe2, 0xf6, 0x07, 0x02, 0x04, 0xde, 0x2e, 0x64, + 0x57, 0xc9, 0x8d, 0xdd, 0x54, 0xa4, 0x42, 0x49, 0x9e, 0xfc, 0x36, 0xa3, 0x1a, 0xcd, 0x54, 0x88, + 0x94, 0x11, 0x4f, 0xfd, 0x8a, 0x87, 0x17, 0x1e, 0xd0, 0x8c, 0xe4, 0x10, 0x65, 0x7d, 0x0d, 0x34, + 0x96, 0xaa, 0xa8, 0x4f, 0xad, 0xb5, 0x80, 0xf0, 0x2e, 0x19, 0x64, 0x94, 0x83, 0x56, 0x47, 0x11, + 0xa3, 0xdd, 0x08, 0xc4, 0x40, 0x13, 0x07, 0x7f, 0x11, 0x0b, 0xf9, 0xed, 0x5b, 0x0b, 0xd5, 0x3e, + 0xe8, 0xae, 0x71, 0x88, 0x9e, 0x74, 0x87, 0x7d, 0x46, 0x93, 0x08, 0x48, 0x38, 0x12, 0x40, 0xc2, + 0x62, 0xa0, 0xba, 0xd5, 0xb2, 0x3a, 0x9b, 0x47, 0x2f, 0xdc, 0xbb, 0x13, 0xb9, 0xef, 0x0b, 0xfc, + 0x5c, 0x00, 0x29, 0xce, 0x39, 0x2d, 0x05, 0x7b, 0xdd, 0x55, 0x02, 0x66, 0xe8, 0x80, 0xd1, 0xb4, + 0x07, 0x61, 0xc2, 0x28, 0xe1, 0x10, 0x46, 0x00, 0x51, 0x72, 0x39, 0xaf, 0x52, 0x56, 0x55, 0x5e, + 0x2d, 0x57, 0x39, 0x93, 0x39, 0xef, 0x54, 0xca, 0xb1, 0xca, 0x58, 0xa8, 0xb4, 0xcf, 0xd6, 0x89, + 0x7e, 0x15, 0xd9, 0xf9, 0x30, 0x6b, 0x8f, 0xcb, 0x68, 0x6f, 0x65, 0x9f, 0xf8, 0x10, 0x6d, 0xa8, + 0x29, 0x23, 0x3d, 0xde, 0x63, 0x77, 0xee, 0x95, 0x2e, 0x2d, 0xf9, 0xa0, 0x2a, 0xa9, 0x63, 0x83, + 0xc7, 0xba, 0xcf, 0x7f, 0xe2, 0x3e, 0x7e, 0x8d, 0x30, 0x08, 0x88, 0x98, 0x74, 0x92, 0xf2, 0x34, + 0xec, 0x8b, 0x6f, 0x64, 0x50, 0xb7, 0x5b, 0x56, 0xc7, 0x0e, 0x76, 0x94, 0x72, 0xae, 0x84, 0xcf, + 0x32, 0x8e, 0x5f, 0xa2, 0x07, 0xe6, 0xe6, 0x34, 0x5a, 0x51, 0xe8, 0xb6, 0x09, 0xcf, 0x40, 0x1f, + 0xdd, 0x33, 0x0b, 0x52, 0xaf, 0xaa, 0x46, 0x1a, 0xee, 0x6c, 0x85, 0xdc, 0x62, 0x85, 0xdc, 0x2f, + 0x05, 0xe1, 0xd7, 0xae, 0x7f, 0x35, 0x4b, 0xe3,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 0x04, 0x00, + 0x00, } func (m *Evidence) Marshal() (dAtA []byte, err error) { @@ -1147,7 +1148,7 @@ func (m *LightClientAttackEvidence) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ByzantineValidators = append(m.ByzantineValidators, &Validator{}) + m.ByzantineValidators = append(m.ByzantineValidators, &types.Validator{}) if err := m.ByzantineValidators[len(m.ByzantineValidators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ostracon/types/evidence.proto b/proto/ostracon/types/evidence.proto index be39092f3..82c5c5bb8 100644 --- a/proto/ostracon/types/evidence.proto +++ b/proto/ostracon/types/evidence.proto @@ -6,7 +6,7 @@ option go_package = "github.com/line/ostracon/proto/ostracon/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "ostracon/types/types.proto"; -import "ostracon/types/validator.proto"; +import "tendermint/types/validator.proto"; import "tendermint/types/types.proto"; message Evidence { @@ -29,7 +29,7 @@ message DuplicateVoteEvidence { message LightClientAttackEvidence { ostracon.types.LightBlock conflicting_block = 1; int64 common_height = 2; - repeated ostracon.types.Validator byzantine_validators = 3; + repeated tendermint.types.Validator byzantine_validators = 3; int64 total_voting_power = 4; // total voting power google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } diff --git a/proto/ostracon/types/types.pb.go b/proto/ostracon/types/types.pb.go index 08f5e112b..8988738e8 100644 --- a/proto/ostracon/types/types.pb.go +++ b/proto/ostracon/types/types.pb.go @@ -323,8 +323,8 @@ func (m *SignedHeader) GetCommit() *Commit { } type LightBlock struct { - SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` - ValidatorSet *ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` } func (m *LightBlock) Reset() { *m = LightBlock{} } @@ -367,7 +367,7 @@ func (m *LightBlock) GetSignedHeader() *SignedHeader { return nil } -func (m *LightBlock) GetValidatorSet() *ValidatorSet { +func (m *LightBlock) GetValidatorSet() *types1.ValidatorSet { if m != nil { return m.ValidatorSet } @@ -453,56 +453,56 @@ func init() { func init() { proto.RegisterFile("ostracon/types/types.proto", fileDescriptor_0e52e849a4baef8c) } var fileDescriptor_0e52e849a4baef8c = []byte{ - // 775 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, - 0x18, 0x8d, 0x9b, 0xff, 0xc9, 0x4f, 0x7b, 0xad, 0xde, 0x5e, 0x37, 0x6d, 0x9d, 0x28, 0x57, 0xf7, - 0x12, 0x90, 0x70, 0x50, 0x61, 0xc1, 0x86, 0x45, 0x92, 0x22, 0x5a, 0x09, 0x36, 0x4e, 0xc5, 0x82, - 0x8d, 0x35, 0xb1, 0xa7, 0xce, 0x88, 0xd8, 0x63, 0x79, 0xc6, 0x51, 0xdb, 0xa7, 0xa8, 0x10, 0x0f, - 0xc4, 0xb2, 0xcb, 0x2e, 0x59, 0x15, 0x94, 0x6e, 0xe0, 0x2d, 0xd0, 0xfc, 0x38, 0x75, 0x5a, 0x04, - 0x12, 0x9b, 0x2a, 0x73, 0xce, 0x99, 0xf3, 0x7d, 0x73, 0xe6, 0xf3, 0x14, 0xb4, 0x08, 0x65, 0x31, - 0x74, 0x49, 0xd8, 0x67, 0x67, 0x11, 0xa2, 0xf2, 0xaf, 0x15, 0xc5, 0x84, 0x11, 0xbd, 0x99, 0x72, - 0x96, 0x40, 0x5b, 0x9b, 0x3e, 0xf1, 0x89, 0xa0, 0xfa, 0xfc, 0x97, 0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0x32, 0x67, 0x32, 0x23, 0xee, 0x7b, 0x5e, 0xbe, 0x28, 0x2c, 0xb6, 0xb3, 0xed, 0xcb, 0x4c, - 0x86, 0x5c, 0x71, 0x74, 0xa0, 0x5a, 0xaf, 0xf1, 0x5d, 0x12, 0xf2, 0xf4, 0x1e, 0xd8, 0x10, 0x26, - 0x2e, 0x09, 0x02, 0xcc, 0x9c, 0x29, 0xa4, 0x53, 0xa3, 0xd4, 0xd1, 0x7a, 0x75, 0xbb, 0xc9, 0xf1, - 0x91, 0x80, 0x0f, 0x21, 0x9d, 0xea, 0x3b, 0xa0, 0xea, 0x41, 0x06, 0xa5, 0xa4, 0x2c, 0x24, 0x15, - 0x0e, 0x08, 0xf2, 0x01, 0x58, 0x5f, 0x46, 0x4c, 0xa5, 0xa4, 0x22, 0x5d, 0x6e, 0x61, 0x21, 0x7c, - 0x02, 0x36, 0x43, 0x74, 0xca, 0x9c, 0xbb, 0xea, 0xaa, 0x50, 0xeb, 0x9c, 0x7b, 0xbb, 0xba, 0xe3, - 0x3f, 0xd0, 0x74, 0xd3, 0xf0, 0xa5, 0x16, 0x08, 0x6d, 0x63, 0x89, 0x0a, 0xd9, 0x36, 0xa8, 0xc0, - 0x28, 0x92, 0x82, 0x9a, 0x10, 0x94, 0x61, 0x14, 0x09, 0xea, 0x11, 0xf8, 0x4b, 0x9c, 0x31, 0x46, - 0x34, 0x99, 0x31, 0x65, 0x52, 0x17, 0x9a, 0x75, 0x4e, 0xd8, 0x12, 0x17, 0xda, 0x7f, 0x41, 0x03, - 0xcd, 0xb1, 0x87, 0x42, 0x17, 0x49, 0x5d, 0x43, 0xe8, 0xea, 0x29, 0x28, 0x44, 0x0f, 0xc1, 0x46, - 0x14, 0x93, 0x88, 0x50, 0x14, 0x3b, 0xd0, 0xf3, 0x62, 0x44, 0xa9, 0xd1, 0x94, 0x7e, 0x29, 0x3e, - 0x90, 0xb0, 0xfe, 0x37, 0x28, 0xc6, 0x24, 0x09, 0x3d, 0xe3,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x39, 0x12, 0x4d, 0xe5, 0xed, 0xaa, 0x40, 0xc6, 0xf8, 0x1c, 0xe9, 0xcf, 0x96, 0x41, 0xe7, 0x7f, - 0x15, 0xb4, 0xba, 0xb2, 0x34, 0xee, 0x7f, 0x40, 0x39, 0x4c, 0x02, 0x87, 0x9d, 0x52, 0xf1, 0x02, - 0xe5, 0xed, 0x52, 0x98, 0x04, 0xc7, 0xa7, 0x74, 0xf8, 0xea, 0x72, 0x61, 0x6a, 0x57, 0x0b, 0x53, - 0xfb, 0xba, 0x30, 0xb5, 0x8b, 0x1b, 0x33, 0x77, 0x75, 0x63, 0xe6, 0x3e, 0xdf, 0x98, 0xb9, 0x77, - 0x8f, 0x7d, 0xcc, 0xa6, 0xc9, 0xc4, 0x72, 0x49, 0xd0, 0x9f, 0xe1, 0x10, 0xf5, 0x97, 0x6f, 0xad, - 0xfc, 0x27, 0xb0, 0xfa, 0xf4, 0x4e, 0x4a, 0x02, 0x7d, 0xfa, 0x23, 0x00, 0x00, 0xff, 0xff, 0x26, - 0x47, 0xde, 0x9a, 0x53, 0x06, 0x00, 0x00, + // 777 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0xcd, 0x6e, 0xd3, 0x4a, + 0x14, 0xc7, 0xe3, 0xe6, 0x7b, 0xf2, 0xd1, 0x5e, 0xab, 0xb7, 0xd7, 0x4d, 0x5b, 0x27, 0xca, 0xd5, + 0xbd, 0x04, 0x24, 0x1c, 0x54, 0x58, 0xb0, 0x61, 0xd1, 0xa4, 0x88, 0x56, 0x82, 0x8d, 0x53, 0xb1, + 0x60, 0x63, 0x4d, 0xec, 0xa9, 0x33, 0x22, 0xf6, 0x58, 0x9e, 0x71, 0xd4, 0xf6, 0x29, 0xba, 0xe8, + 0x03, 0xb1, 0xec, 0xb2, 0x4b, 0x56, 0x05, 0xa5, 0x1b, 0x78, 0x0b, 0x34, 0x1f, 0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0x98, 0x25, 0xdb, 0xa3, 0x5d, 0xa7, 0xd9, 0x8e, 0x87, 0xa0, 0xb1, 0x98, 0x4e, 0x87, 0xa2, + 0xb4, 0x11, 0x73, 0xd5, 0x87, 0xc5, 0xa4, 0x8e, 0x10, 0xb3, 0xeb, 0xb3, 0xcc, 0x8a, 0xdf, 0x64, + 0x55, 0x74, 0xf4, 0x0e, 0x31, 0xb8, 0x74, 0x3d, 0xda, 0x9f, 0x5f, 0xcf, 0x1e, 0x00, 0x32, 0x0d, + 0xc5, 0x17, 0x48, 0xb4, 0x95, 0xb7, 0xab, 0x42, 0x19, 0xe1, 0x0b, 0xa4, 0xbf, 0x58, 0x58, 0x9d, + 0xff, 0x95, 0xd5, 0xea, 0xd2, 0x52, 0xc3, 0xff, 0x01, 0xe5, 0x30, 0x09, 0x1c, 0x76, 0x46, 0xc5, + 0x3b, 0x28, 0x6f, 0x97, 0xc2, 0x24, 0x38, 0x39, 0xa3, 0x83, 0x37, 0xd7, 0x73, 0x53, 0xbb, 0x99, + 0x9b, 0xda, 0xd7, 0xb9, 0xa9, 0x5d, 0xde, 0x99, 0xb9, 0x9b, 0x3b, 0x33, 0xf7, 0xf9, 0xce, 0xcc, + 0x7d, 0x78, 0xea, 0x63, 0x36, 0x49, 0xc6, 0x96, 0x4b, 0x82, 0xfe, 0x14, 0x87, 0xa8, 0xbf, 0xf8, + 0x5e, 0xc8, 0x0f, 0xc1, 0xf2, 0xe7, 0x63, 0x5c, 0x12, 0xea, 0xf3, 0x1f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xd3, 0x75, 0x80, 0x28, 0x57, 0x06, 0x00, 0x00, } func (m *Header) Marshal() (dAtA []byte, err error) { @@ -1940,7 +1940,7 @@ func (m *LightBlock) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.ValidatorSet == nil { - m.ValidatorSet = &ValidatorSet{} + m.ValidatorSet = &types1.ValidatorSet{} } if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/proto/ostracon/types/types.proto b/proto/ostracon/types/types.proto index 534a18551..ba98c44f5 100644 --- a/proto/ostracon/types/types.proto +++ b/proto/ostracon/types/types.proto @@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto"; import "tendermint/crypto/proof.proto"; import "tendermint/version/types.proto"; import "tendermint/types/types.proto"; -import "ostracon/types/validator.proto"; +import "tendermint/types/validator.proto"; // BlockIdFlag indicates which BlcokID the signature is for //enum BlockIDFlag { @@ -147,7 +147,7 @@ message SignedHeader { message LightBlock { SignedHeader signed_header = 1; - ostracon.types.ValidatorSet validator_set = 2; + tendermint.types.ValidatorSet validator_set = 2; } message BlockMeta { diff --git a/proto/ostracon/types/validator.pb.go b/proto/ostracon/types/validator.pb.go deleted file mode 100644 index 135822ee0..000000000 --- a/proto/ostracon/types/validator.pb.go +++ /dev/null @@ -1,885 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ostracon/types/validator.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ValidatorSet struct { - Validators []*Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` - // Validator proposer = 2; // This field has been removed in Ostracon. - TotalVotingPower int64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` -} - -func (m *ValidatorSet) Reset() { *m = ValidatorSet{} } -func (m *ValidatorSet) String() string { return proto.CompactTextString(m) } -func (*ValidatorSet) ProtoMessage() {} -func (*ValidatorSet) Descriptor() ([]byte, []int) { - return fileDescriptor_eeeaf81579407bf3, []int{0} -} -func (m *ValidatorSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorSet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorSet.Merge(m, src) -} -func (m *ValidatorSet) XXX_Size() int { - return m.Size() -} -func (m *ValidatorSet) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorSet.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorSet proto.InternalMessageInfo - -func (m *ValidatorSet) GetValidators() []*Validator { - if m != nil { - return m.Validators - } - return nil -} - -func (m *ValidatorSet) GetTotalVotingPower() int64 { - if m != nil { - return m.TotalVotingPower - } - return 0 -} - -type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey crypto.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` - ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"` -} - -func (m *Validator) Reset() { *m = Validator{} } -func (m *Validator) String() string { return proto.CompactTextString(m) } -func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_eeeaf81579407bf3, []int{1} -} -func (m *Validator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Validator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Validator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Validator.Merge(m, src) -} -func (m *Validator) XXX_Size() int { - return m.Size() -} -func (m *Validator) XXX_DiscardUnknown() { - xxx_messageInfo_Validator.DiscardUnknown(m) -} - -var xxx_messageInfo_Validator proto.InternalMessageInfo - -func (m *Validator) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -func (m *Validator) GetPubKey() crypto.PublicKey { - if m != nil { - return m.PubKey - } - return crypto.PublicKey{} -} - -func (m *Validator) GetVotingPower() int64 { - if m != nil { - return m.VotingPower - } - return 0 -} - -func (m *Validator) GetProposerPriority() int64 { - if m != nil { - return m.ProposerPriority - } - return 0 -} - -type SimpleValidator struct { - PubKey *crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - VotingPower int64 `protobuf:"varint,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` -} - -func (m *SimpleValidator) Reset() { *m = SimpleValidator{} } -func (m *SimpleValidator) String() string { return proto.CompactTextString(m) } -func (*SimpleValidator) ProtoMessage() {} -func (*SimpleValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_eeeaf81579407bf3, []int{2} -} -func (m *SimpleValidator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SimpleValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SimpleValidator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SimpleValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimpleValidator.Merge(m, src) -} -func (m *SimpleValidator) XXX_Size() int { - return m.Size() -} -func (m *SimpleValidator) XXX_DiscardUnknown() { - xxx_messageInfo_SimpleValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_SimpleValidator proto.InternalMessageInfo - -func (m *SimpleValidator) GetPubKey() *crypto.PublicKey { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *SimpleValidator) GetVotingPower() int64 { - if m != nil { - return m.VotingPower - } - return 0 -} - -func init() { - proto.RegisterType((*ValidatorSet)(nil), "ostracon.types.ValidatorSet") - proto.RegisterType((*Validator)(nil), "ostracon.types.Validator") - proto.RegisterType((*SimpleValidator)(nil), "ostracon.types.SimpleValidator") -} - -func init() { proto.RegisterFile("ostracon/types/validator.proto", fileDescriptor_eeeaf81579407bf3) } - -var fileDescriptor_eeeaf81579407bf3 = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xbd, 0x6e, 0xe2, 0x40, - 0x10, 0x80, 0xbd, 0x80, 0x40, 0xb7, 0xa0, 0xfb, 0x59, 0x5d, 0xe1, 0x43, 0xc8, 0xc7, 0x51, 0x59, - 0xba, 0x64, 0x2d, 0x11, 0xa5, 0x88, 0xd2, 0xd1, 0xa4, 0xa0, 0x41, 0x46, 0xa2, 0x48, 0x63, 0xf9, - 0x67, 0xe5, 0xac, 0x30, 0x9e, 0xd5, 0x7a, 0x0d, 0xf2, 0x5b, 0xe4, 0x59, 0xf2, 0x14, 0x94, 0x94, - 0xa9, 0xa2, 0x08, 0x5e, 0x24, 0xc2, 0x8e, 0xed, 0xa0, 0x24, 0x4a, 0xb7, 0x3b, 0xdf, 0xec, 0xcc, - 0x37, 0xda, 0xc1, 0x06, 0x24, 0x4a, 0xba, 0x3e, 0xc4, 0x96, 0xca, 0x04, 0x4b, 0xac, 0xb5, 0x1b, - 0xf1, 0xc0, 0x55, 0x20, 0xa9, 0x90, 0xa0, 0x80, 0x7c, 0x2f, 0x39, 0xcd, 0x79, 0xff, 0x77, 0x08, - 0x21, 0xe4, 0xc8, 0x3a, 0x9e, 0x8a, 0xac, 0xf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36, - 0xb9, 0xd9, 0xee, 0x0d, 0xb4, 0xdb, 0x1b, 0xe8, 0x79, 0x6f, 0xa0, 0xfb, 0x83, 0xa1, 0xed, 0x0e, - 0x86, 0xf6, 0x78, 0x30, 0xb4, 0xdb, 0xf3, 0x90, 0xab, 0xbb, 0xd4, 0xa3, 0x3e, 0xac, 0xac, 0x88, - 0xc7, 0xcc, 0xaa, 0x16, 0xa5, 0xf8, 0xfd, 0xd3, 0xbd, 0xf1, 0xda, 0x79, 0xf4, 0xe2, 0x25, 0x00, - 0x00, 0xff, 0xff, 0x38, 0x9e, 0xda, 0xa7, 0x50, 0x02, 0x00, 0x00, -} - -func (m *ValidatorSet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TotalVotingPower != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.TotalVotingPower)) - i-- - dAtA[i] = 0x18 - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Validator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Validator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposerPriority != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.ProposerPriority)) - i-- - dAtA[i] = 0x20 - } - if m.VotingPower != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.VotingPower)) - i-- - dAtA[i] = 0x18 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintValidator(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SimpleValidator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SimpleValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SimpleValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.VotingPower != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.VotingPower)) - i-- - dAtA[i] = 0x10 - } - if m.PubKey != nil { - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintValidator(dAtA []byte, offset int, v uint64) int { - offset -= sovValidator(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ValidatorSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovValidator(uint64(l)) - } - } - if m.TotalVotingPower != 0 { - n += 1 + sovValidator(uint64(m.TotalVotingPower)) - } - return n -} - -func (m *Validator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovValidator(uint64(l)) - } - l = m.PubKey.Size() - n += 1 + l + sovValidator(uint64(l)) - if m.VotingPower != 0 { - n += 1 + sovValidator(uint64(m.VotingPower)) - } - if m.ProposerPriority != 0 { - n += 1 + sovValidator(uint64(m.ProposerPriority)) - } - return n -} - -func (m *SimpleValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PubKey != nil { - l = m.PubKey.Size() - n += 1 + l + sovValidator(uint64(l)) - } - if m.VotingPower != 0 { - n += 1 + sovValidator(uint64(m.VotingPower)) - } - return n -} - -func sovValidator(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozValidator(x uint64) (n int) { - return sovValidator(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ValidatorSet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Validators = append(m.Validators, &Validator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVotingPower", wireType) - } - m.TotalVotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalVotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipValidator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Validator) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Validator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) - } - m.VotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerPriority", wireType) - } - m.ProposerPriority = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposerPriority |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipValidator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SimpleValidator) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SimpleValidator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SimpleValidator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PubKey == nil { - m.PubKey = &crypto.PublicKey{} - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) - } - m.VotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipValidator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipValidator(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidator - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidator - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidator - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthValidator - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupValidator - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthValidator - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthValidator = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowValidator = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupValidator = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/ostracon/types/validator.proto b/proto/ostracon/types/validator.proto deleted file mode 100644 index 5741ef4fb..000000000 --- a/proto/ostracon/types/validator.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package ostracon.types; - -option go_package = "github.com/line/ostracon/proto/ostracon/types"; - -import "gogoproto/gogo.proto"; -import "tendermint/crypto/keys.proto"; - -message ValidatorSet { - repeated Validator validators = 1; - // Validator proposer = 2; // This field has been removed in Ostracon. - int64 total_voting_power = 3; -} - -message Validator { - bytes address = 1; - tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; - int64 voting_power = 3; - int64 proposer_priority = 4; -} - -message SimpleValidator { - tendermint.crypto.PublicKey pub_key = 1; - int64 voting_power = 2; -} diff --git a/types/evidence.go b/types/evidence.go index 274c7859f..00b706596 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -391,7 +391,7 @@ func (l *LightClientAttackEvidence) ToProto() (*ocproto.LightClientAttackEvidenc return nil, err } - byzVals := make([]*ocproto.Validator, len(l.ByzantineValidators)) + byzVals := make([]*tmproto.Validator, len(l.ByzantineValidators)) for idx, val := range l.ByzantineValidators { valpb, err := val.ToProto() if err != nil { diff --git a/types/validator.go b/types/validator.go index 93612f447..9fb69b9f6 100644 --- a/types/validator.go +++ b/types/validator.go @@ -6,10 +6,11 @@ import ( "fmt" "strings" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto" ce "github.com/line/ostracon/crypto/encoding" tmrand "github.com/line/ostracon/libs/rand" - ocproto "github.com/line/ostracon/proto/ostracon/types" ) // Volatile state for each Validator @@ -120,7 +121,7 @@ func (v *Validator) Bytes() []byte { panic(err) } - pbv := ocproto.SimpleValidator{ + pbv := tmproto.SimpleValidator{ PubKey: &pk, VotingPower: v.VotingPower, } @@ -133,7 +134,7 @@ func (v *Validator) Bytes() []byte { } // ToProto converts Valiator to protobuf -func (v *Validator) ToProto() (*ocproto.Validator, error) { +func (v *Validator) ToProto() (*tmproto.Validator, error) { if v == nil { return nil, errors.New("nil validator") } @@ -143,7 +144,7 @@ func (v *Validator) ToProto() (*ocproto.Validator, error) { return nil, err } - vp := ocproto.Validator{ + vp := tmproto.Validator{ Address: v.Address, PubKey: pk, VotingPower: v.VotingPower, @@ -155,7 +156,7 @@ func (v *Validator) ToProto() (*ocproto.Validator, error) { // FromProto sets a protobuf Validator to the given pointer. // It returns an error if the public key is invalid. -func ValidatorFromProto(vp *ocproto.Validator) (*Validator, error) { +func ValidatorFromProto(vp *tmproto.Validator) (*Validator, error) { if vp == nil { return nil, errors.New("nil validator") } diff --git a/types/validator_set.go b/types/validator_set.go index 2ca26ceef..6bfbf4a85 100644 --- a/types/validator_set.go +++ b/types/validator_set.go @@ -10,11 +10,12 @@ import ( "sort" "strings" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" tmmath "github.com/line/ostracon/libs/math" tmrand "github.com/line/ostracon/libs/rand" - ocproto "github.com/line/ostracon/proto/ostracon/types" ) const ( @@ -909,13 +910,13 @@ func (valz ValidatorsByAddress) Swap(i, j int) { } // ToProto converts ValidatorSet to protobuf -func (vals *ValidatorSet) ToProto() (*ocproto.ValidatorSet, error) { +func (vals *ValidatorSet) ToProto() (*tmproto.ValidatorSet, error) { if vals.IsNilOrEmpty() { - return &ocproto.ValidatorSet{}, nil // validator set should never be nil + return &tmproto.ValidatorSet{}, nil // validator set should never be nil } - vp := new(ocproto.ValidatorSet) - valsProto := make([]*ocproto.Validator, len(vals.Validators)) + vp := new(tmproto.ValidatorSet) + valsProto := make([]*tmproto.Validator, len(vals.Validators)) for i := 0; i < len(vals.Validators); i++ { valp, err := vals.Validators[i].ToProto() if err != nil { @@ -933,7 +934,7 @@ func (vals *ValidatorSet) ToProto() (*ocproto.ValidatorSet, error) { // ValidatorSetFromProto sets a protobuf ValidatorSet to the given pointer. // It returns an error if any of the validators from the set or the proposer // is invalid -func ValidatorSetFromProto(vp *ocproto.ValidatorSet) (*ValidatorSet, error) { +func ValidatorSetFromProto(vp *tmproto.ValidatorSet) (*ValidatorSet, error) { if vp == nil { return nil, errors.New("nil validator set") // validator set should never be nil, bigger issues are at play if empty } diff --git a/types/validator_set_test.go b/types/validator_set_test.go index a408a5be9..ef199f12b 100644 --- a/types/validator_set_test.go +++ b/types/validator_set_test.go @@ -19,7 +19,6 @@ import ( "github.com/line/ostracon/crypto/ed25519" tmmath "github.com/line/ostracon/libs/math" tmrand "github.com/line/ostracon/libs/rand" - ocproto "github.com/line/ostracon/proto/ostracon/types" ) func TestValidatorSetBasic(t *testing.T) { @@ -414,7 +413,7 @@ func (vals *ValidatorSet) toBytes() []byte { } func (vals *ValidatorSet) fromBytes(b []byte) *ValidatorSet { - pbvs := new(ocproto.ValidatorSet) + pbvs := new(tmproto.ValidatorSet) err := pbvs.Unmarshal(b) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED From 0bc4c6f7d2d98699bfd18e0617889cf7f8452665 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 25 Jan 2023 16:22:31 +0900 Subject: [PATCH 15/25] feat!: replace `abci/types.proto` and `state/types.proto` to Tendermint proto. - abci.RequestInitChain - abci.ResponseEndBlock - abci.LastCommitInfo - abci.Validator - abci.ValidatorUpdate - abci.VoterInfo - state.ValidatorsInfo --- abci/client/client.go | 6 +- abci/client/grpc_client.go | 8 +- abci/client/grpc_client_test.go | 4 +- abci/client/local_client.go | 8 +- abci/client/local_client_test.go | 4 +- abci/client/mocks/client.go | 18 +- abci/client/socket_client.go | 6 +- abci/client/socket_client_test.go | 4 +- abci/cmd/abci-cli/abci-cli.go | 2 +- abci/example/kvstore/helpers.go | 10 +- abci/example/kvstore/kvstore_test.go | 22 +- abci/example/kvstore/persistent_kvstore.go | 18 +- abci/tests/server/client.go | 4 +- abci/types/application.go | 14 +- abci/types/messages.go | 4 +- abci/types/mocks/application.go | 12 +- abci/types/pubkey.go | 6 +- abci/types/types.pb.go | 2424 ++++---------------- abci/types/util.go | 60 +- blockchain/v0/reactor_test.go | 4 +- consensus/byzantine_test.go | 4 +- consensus/common_test.go | 7 +- consensus/reactor_test.go | 4 +- consensus/replay.go | 5 +- consensus/replay_stubs.go | 2 +- consensus/replay_test.go | 10 +- consensus/state_test.go | 2 +- light/rpc/client.go | 4 +- proto/ostracon/abci/types.proto | 84 +- proto/ostracon/state/types.pb.go | 362 +-- proto/ostracon/state/types.proto | 10 +- proxy/app_conn.go | 8 +- proxy/mocks/app_conn_consensus.go | 14 +- rpc/client/evidence_test.go | 3 +- rpc/core/blocks_test.go | 3 +- rpc/core/types/responses.go | 2 +- state/execution.go | 10 +- state/execution_test.go | 24 +- state/export_test.go | 4 +- state/helpers_test.go | 22 +- state/indexer/block/kv/kv_test.go | 5 +- state/indexer/sink/psql/psql_test.go | 2 +- state/state_test.go | 51 +- state/store.go | 6 +- state/store_test.go | 5 +- test/e2e/app/app.go | 10 +- types/event_bus_test.go | 5 +- types/events.go | 5 +- types/evidence.go | 2 +- types/protobuf.go | 19 +- types/protobuf_test.go | 10 +- 51 files changed, 764 insertions(+), 2578 deletions(-) diff --git a/abci/client/client.go b/abci/client/client.go index d3e4f7c56..deadb0344 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -37,7 +37,7 @@ type Client interface { CheckTxAsync(abci.RequestCheckTx, ResponseCallback) *ReqRes QueryAsync(abci.RequestQuery, ResponseCallback) *ReqRes CommitAsync(ResponseCallback) *ReqRes - InitChainAsync(ocabci.RequestInitChain, ResponseCallback) *ReqRes + InitChainAsync(abci.RequestInitChain, ResponseCallback) *ReqRes BeginBlockAsync(ocabci.RequestBeginBlock, ResponseCallback) *ReqRes EndBlockAsync(abci.RequestEndBlock, ResponseCallback) *ReqRes BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx, ResponseCallback) *ReqRes @@ -55,9 +55,9 @@ type Client interface { CheckTxSync(abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) QuerySync(abci.RequestQuery) (*abci.ResponseQuery, error) CommitSync() (*abci.ResponseCommit, error) - InitChainSync(ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) + InitChainSync(abci.RequestInitChain) (*ocabci.ResponseInitChain, error) BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) - EndBlockSync(abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) + EndBlockSync(abci.RequestEndBlock) (*abci.ResponseEndBlock, error) BeginRecheckTxSync(ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) EndRecheckTxSync(ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) ListSnapshotsSync(abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index b72a8436a..0e7d49db4 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -210,7 +210,7 @@ func (cli *grpcClient) CommitAsync(cb ResponseCallback) *ReqRes { return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Commit{Commit: res}}, cb) } -func (cli *grpcClient) InitChainAsync(params ocabci.RequestInitChain, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) InitChainAsync(params abci.RequestInitChain, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestInitChain(params) res, err := cli.client.InitChain(context.Background(), req.GetInitChain(), grpc.WaitForReady(true)) if err != nil { @@ -309,7 +309,7 @@ func (cli *grpcClient) finishAsyncCall(req *ocabci.Request, res *ocabci.Response return reqRes } -//---------------------------------------- +// ---------------------------------------- func (cli *grpcClient) FlushSync() (*abci.ResponseFlush, error) { reqres := cli.FlushAsync(nil) reqres.Wait() @@ -359,7 +359,7 @@ func (cli *grpcClient) CommitSync() (*abci.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *grpcClient) InitChainSync(params ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (cli *grpcClient) InitChainSync(params abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { reqres := cli.InitChainAsync(params, nil) reqres.Wait() return reqres.Response.GetInitChain(), cli.Error() @@ -371,7 +371,7 @@ func (cli *grpcClient) BeginBlockSync(params ocabci.RequestBeginBlock) (*abci.Re return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *grpcClient) EndBlockSync(params abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { +func (cli *grpcClient) EndBlockSync(params abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { reqres := cli.EndBlockAsync(params, nil) reqres.Wait() return reqres.Response.GetEndBlock(), cli.Error() diff --git a/abci/client/grpc_client_test.go b/abci/client/grpc_client_test.go index 6a2c62aad..eed8cc155 100644 --- a/abci/client/grpc_client_test.go +++ b/abci/client/grpc_client_test.go @@ -37,7 +37,7 @@ func TestGrpcClientCalls(t *testing.T) { c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(ocabci.RequestInitChain{}, getResponseCallback(t)) + c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) @@ -71,7 +71,7 @@ func TestGrpcClientCalls(t *testing.T) { _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(ocabci.RequestInitChain{}) + _, err = c.InitChainSync(abci.RequestInitChain{}) require.NoError(t, err) _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) diff --git a/abci/client/local_client.go b/abci/client/local_client.go index 4c586ee6b..dc42241df 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -137,7 +137,7 @@ func (app *localClient) CommitAsync(cb ResponseCallback) *ReqRes { return app.done(reqRes, ocabci.ToResponseCommit(res)) } -func (app *localClient) InitChainAsync(req ocabci.RequestInitChain, cb ResponseCallback) *ReqRes { +func (app *localClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -220,7 +220,7 @@ func (app *localClient) ApplySnapshotChunkAsync(req abci.RequestApplySnapshotChu return app.done(reqRes, ocabci.ToResponseApplySnapshotChunk(res)) } -//------------------------------------------------------- +// ------------------------------------------------------- func (app *localClient) FlushSync() (*abci.ResponseFlush, error) { return &abci.ResponseFlush{}, nil } @@ -282,7 +282,7 @@ func (app *localClient) CommitSync() (*abci.ResponseCommit, error) { return &res, nil } -func (app *localClient) InitChainSync(req ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (app *localClient) InitChainSync(req abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -298,7 +298,7 @@ func (app *localClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.Resp return &res, nil } -func (app *localClient) EndBlockSync(req abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { +func (app *localClient) EndBlockSync(req abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { app.mtx.Lock() defer app.mtx.Unlock() diff --git a/abci/client/local_client_test.go b/abci/client/local_client_test.go index 20d12394c..ac218b348 100644 --- a/abci/client/local_client_test.go +++ b/abci/client/local_client_test.go @@ -50,7 +50,7 @@ func TestLocalClientCalls(t *testing.T) { c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(ocabci.RequestInitChain{}, getResponseCallback(t)) + c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) @@ -84,7 +84,7 @@ func TestLocalClientCalls(t *testing.T) { _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(ocabci.RequestInitChain{}) + _, err = c.InitChainSync(abci.RequestInitChain{}) require.NoError(t, err) _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 1f7833083..9694d6ac9 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -307,15 +307,15 @@ func (_m *Client) EndBlockAsync(_a0 abci.RequestEndBlock, _a1 abcicli.ResponseCa } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *Client) EndBlockSync(_a0 abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { +func (_m *Client) EndBlockSync(_a0 abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *ocabci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *ocabci.ResponseEndBlock); ok { + var r0 *abci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *abci.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ocabci.ResponseEndBlock) + r0 = ret.Get(0).(*abci.ResponseEndBlock) } } @@ -477,11 +477,11 @@ func (_m *Client) InfoSync(_a0 abci.RequestInfo) (*abci.ResponseInfo, error) { } // InitChainAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) InitChainAsync(_a0 ocabci.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) InitChainAsync(_a0 abci.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(abci.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -493,11 +493,11 @@ func (_m *Client) InitChainAsync(_a0 ocabci.RequestInitChain, _a1 abcicli.Respon } // InitChainSync provides a mock function with given fields: _a0 -func (_m *Client) InitChainSync(_a0 ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (_m *Client) InitChainSync(_a0 abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { ret := _m.Called(_a0) var r0 *ocabci.ResponseInitChain - if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain) *ocabci.ResponseInitChain); ok { + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *ocabci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { @@ -506,7 +506,7 @@ func (_m *Client) InitChainSync(_a0 ocabci.RequestInitChain) (*ocabci.ResponseIn } var r1 error - if rf, ok := ret.Get(1).(func(ocabci.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index c4a095649..df80cb740 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -258,7 +258,7 @@ func (cli *socketClient) CommitAsync(cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestCommit(), cb) } -func (cli *socketClient) InitChainAsync(req ocabci.RequestInitChain, cb ResponseCallback) *ReqRes { +func (cli *socketClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestInitChain(req), cb) } @@ -368,7 +368,7 @@ func (cli *socketClient) CommitSync() (*abci.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *socketClient) InitChainSync(req ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { reqres := cli.queueRequest(ocabci.ToRequestInitChain(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -386,7 +386,7 @@ func (cli *socketClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.Res return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *socketClient) EndBlockSync(req abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { +func (cli *socketClient) EndBlockSync(req abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { reqres := cli.queueRequest(ocabci.ToRequestEndBlock(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err diff --git a/abci/client/socket_client_test.go b/abci/client/socket_client_test.go index e482fbbe8..8d349ffb4 100644 --- a/abci/client/socket_client_test.go +++ b/abci/client/socket_client_test.go @@ -147,7 +147,7 @@ func TestSockerClientCalls(t *testing.T) { c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(ocabci.RequestInitChain{}, getResponseCallback(t)) + c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) @@ -181,7 +181,7 @@ func TestSockerClientCalls(t *testing.T) { _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(ocabci.RequestInitChain{}) + _, err = c.InitChainSync(abci.RequestInitChain{}) require.NoError(t, err) _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index ad5f14681..f2d2372e4 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -757,7 +757,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro Log: res.Log, }) fmt.Printf("original:publicKey:%s\n", publicKey) - validatorUpdate := ocabci.ValidatorUpdate{} + validatorUpdate := abci.ValidatorUpdate{} err = ocabci.ReadMessage(bytes.NewReader(res.Value), &validatorUpdate) if err != nil { panic(err) diff --git a/abci/example/kvstore/helpers.go b/abci/example/kvstore/helpers.go index 423e1313d..86901beb0 100644 --- a/abci/example/kvstore/helpers.go +++ b/abci/example/kvstore/helpers.go @@ -4,6 +4,8 @@ import ( "fmt" "os" + abci "github.com/tendermint/tendermint/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -34,7 +36,7 @@ func GenDefaultPrivKey() crypto.PrivKey { // RandVal creates one random validator, with a key derived // from the input value -func RandVal(i int) ocabci.ValidatorUpdate { +func RandVal(i int) abci.ValidatorUpdate { pk := GenDefaultPrivKey().PubKey() power := tmrand.Uint16() + 1 v := ocabci.NewValidatorUpdate(pk, int64(power)) @@ -45,8 +47,8 @@ func RandVal(i int) ocabci.ValidatorUpdate { // the application. Note that the keys are deterministically // derived from the index in the array, while the power is // random (Change this if not desired) -func RandVals(cnt int) []ocabci.ValidatorUpdate { - res := make([]ocabci.ValidatorUpdate, cnt) +func RandVals(cnt int) []abci.ValidatorUpdate { + res := make([]abci.ValidatorUpdate, cnt) for i := 0; i < cnt; i++ { res[i] = RandVal(i) } @@ -57,7 +59,7 @@ func RandVals(cnt int) []ocabci.ValidatorUpdate { // which allows tests to pass and is fine as long as you // don't make any tx that modify the validator state func InitKVStore(app *PersistentKVStoreApplication) { - app.InitChain(ocabci.RequestInitChain{ + app.InitChain(abci.RequestInitChain{ Validators: RandVals(1), }) } diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 1aef271a1..2cf836438 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -132,18 +132,18 @@ func TestValUpdates(t *testing.T) { nInit := 5 vals := RandVals(total) // initialize with the first nInit - kvstore.InitChain(ocabci.RequestInitChain{ + kvstore.InitChain(abci.RequestInitChain{ Validators: vals[:nInit], }) vals1, vals2 := vals[:nInit], kvstore.Validators() valsEqual(t, vals1, vals2) - var v1, v2, v3 ocabci.ValidatorUpdate + var v1, v2, v3 abci.ValidatorUpdate // add some validators v1, v2 = vals[nInit], vals[nInit+1] - diff := []ocabci.ValidatorUpdate{v1, v2} + diff := []abci.ValidatorUpdate{v1, v2} tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power) @@ -157,7 +157,7 @@ func TestValUpdates(t *testing.T) { v1.Power = 0 v2.Power = 0 v3.Power = 0 - diff = []ocabci.ValidatorUpdate{v1, v2, v3} + diff = []abci.ValidatorUpdate{v1, v2, v3} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power) tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power) @@ -175,12 +175,12 @@ func TestValUpdates(t *testing.T) { } else { v1.Power = 5 } - diff = []ocabci.ValidatorUpdate{v1} + diff = []abci.ValidatorUpdate{v1} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) makeApplyBlock(t, kvstore, 3, diff, tx1) - vals1 = append([]ocabci.ValidatorUpdate{v1}, vals1[1:]...) + vals1 = append([]abci.ValidatorUpdate{v1}, vals1[1:]...) vals2 = kvstore.Validators() valsEqual(t, vals1, vals2) @@ -193,7 +193,7 @@ func makeApplyBlock( t *testing.T, kvstore ocabci.Application, heightInt int, - diff []ocabci.ValidatorUpdate, + diff []abci.ValidatorUpdate, txs ...[]byte) { // make and apply block height := int64(heightInt) @@ -215,7 +215,7 @@ func makeApplyBlock( } -func existInPersistStore(t *testing.T, kvstore ocabci.Application, v ocabci.ValidatorUpdate) { +func existInPersistStore(t *testing.T, kvstore ocabci.Application, v abci.ValidatorUpdate) { // success pubkeyStr, _ := MakeValSetChangeTxAndMore(v.PubKey, v.Power) resQuery := kvstore.Query(abci.RequestQuery{Path: "/val", Data: []byte(pubkeyStr)}) @@ -237,12 +237,12 @@ func existInPersistStore(t *testing.T, kvstore ocabci.Application, v ocabci.Vali } // order doesn't matter -func valsEqual(t *testing.T, vals1, vals2 []ocabci.ValidatorUpdate) { +func valsEqual(t *testing.T, vals1, vals2 []abci.ValidatorUpdate) { if len(vals1) != len(vals2) { t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1)) } - sort.Sort(ocabci.ValidatorUpdates(vals1)) - sort.Sort(ocabci.ValidatorUpdates(vals2)) + sort.Sort(abci.ValidatorUpdates(vals1)) + sort.Sort(abci.ValidatorUpdates(vals2)) for i, v1 := range vals1 { v2 := vals2[i] if !v1.PubKey.Equal(v2.PubKey) || diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index 392c3ee84..0ed35ac90 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -29,7 +29,7 @@ type PersistentKVStoreApplication struct { app *Application // validator set - ValUpdates []ocabci.ValidatorUpdate + ValUpdates []abci.ValidatorUpdate valAddrToPubKeyMap map[string]pc.PublicKey @@ -122,7 +122,7 @@ func (app *PersistentKVStoreApplication) Query(reqQuery abci.RequestQuery) (resQ } // Save the validators in the merkle tree -func (app *PersistentKVStoreApplication) InitChain(req ocabci.RequestInitChain) ocabci.ResponseInitChain { +func (app *PersistentKVStoreApplication) InitChain(req abci.RequestInitChain) ocabci.ResponseInitChain { for _, v := range req.Validators { r := app.updateValidator(v) if r.IsErr() { @@ -135,14 +135,14 @@ func (app *PersistentKVStoreApplication) InitChain(req ocabci.RequestInitChain) // Track the block hash and header information func (app *PersistentKVStoreApplication) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { // reset valset changes - app.ValUpdates = make([]ocabci.ValidatorUpdate, 0) + app.ValUpdates = make([]abci.ValidatorUpdate, 0) // Punish validators who committed equivocation. for _, ev := range req.ByzantineValidators { if ev.Type == abci.EvidenceType_DUPLICATE_VOTE { addr := string(ev.Validator.Address) if pubKey, ok := app.valAddrToPubKeyMap[addr]; ok { - app.updateValidator(ocabci.ValidatorUpdate{ + app.updateValidator(abci.ValidatorUpdate{ PubKey: pubKey, Power: ev.Validator.Power - 1, }) @@ -159,8 +159,8 @@ func (app *PersistentKVStoreApplication) BeginBlock(req ocabci.RequestBeginBlock } // Update the validator set -func (app *PersistentKVStoreApplication) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { - return ocabci.ResponseEndBlock{ValidatorUpdates: app.ValUpdates} +func (app *PersistentKVStoreApplication) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { + return abci.ResponseEndBlock{ValidatorUpdates: app.ValUpdates} } func (app *PersistentKVStoreApplication) ListSnapshots( @@ -186,14 +186,14 @@ func (app *PersistentKVStoreApplication) ApplySnapshotChunk( //--------------------------------------------- // update validators -func (app *PersistentKVStoreApplication) Validators() (validators []ocabci.ValidatorUpdate) { +func (app *PersistentKVStoreApplication) Validators() (validators []abci.ValidatorUpdate) { itr, err := app.app.state.db.Iterator(nil, nil) if err != nil { panic(err) } for ; itr.Valid(); itr.Next() { if isValidatorTx(itr.Key()) { - validator := new(ocabci.ValidatorUpdate) + validator := new(abci.ValidatorUpdate) err := ocabci.ReadMessage(bytes.NewBuffer(itr.Value()), validator) if err != nil { panic(err) @@ -275,7 +275,7 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) abci.Respons // add, update, or remove a validator // See MakeValSetChangeTx -func (app *PersistentKVStoreApplication) updateValidator(v ocabci.ValidatorUpdate) abci.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) updateValidator(v abci.ValidatorUpdate) abci.ResponseDeliverTx { pubkey, err := cryptoenc.PubKeyFromProto(&v.PubKey) if err != nil { return abci.ResponseDeliverTx{ diff --git a/abci/tests/server/client.go b/abci/tests/server/client.go index a68dbfdf6..892a4dba2 100644 --- a/abci/tests/server/client.go +++ b/abci/tests/server/client.go @@ -15,13 +15,13 @@ import ( func InitChain(client abcicli.Client) error { total := 10 - vals := make([]ocabci.ValidatorUpdate, total) + vals := make([]abci.ValidatorUpdate, total) for i := 0; i < total; i++ { pubkey := kvstore.GenDefaultPrivKey().PubKey() power := tmrand.Int() vals[i] = ocabci.NewValidatorUpdate(pubkey, int64(power)) } - _, err := client.InitChainSync(ocabci.RequestInitChain{ + _, err := client.InitChainSync(abci.RequestInitChain{ Validators: vals, }) if err != nil { diff --git a/abci/types/application.go b/abci/types/application.go index eb1906037..f8b518aca 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -27,10 +27,10 @@ type Application interface { EndRecheckTx(RequestEndRecheckTx) ResponseEndRecheckTx // Signals the end of rechecking // Consensus Connection - InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore + InitChain(abci.RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore BeginBlock(RequestBeginBlock) abci.ResponseBeginBlock // Signals the beginning of a block DeliverTx(abci.RequestDeliverTx) abci.ResponseDeliverTx // Deliver a tx for full processing - EndBlock(abci.RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set + EndBlock(abci.RequestEndBlock) abci.ResponseEndBlock // Signals the end of a block, returns changes to the validator set Commit() abci.ResponseCommit // Commit the state and return the application Merkle root hash // State Sync Connection @@ -88,7 +88,7 @@ func (BaseApplication) Query(req abci.RequestQuery) abci.ResponseQuery { return abci.ResponseQuery{Code: CodeTypeOK} } -func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { +func (BaseApplication) InitChain(req abci.RequestInitChain) ResponseInitChain { return ResponseInitChain{} } @@ -96,8 +96,8 @@ func (BaseApplication) BeginBlock(req RequestBeginBlock) abci.ResponseBeginBlock return abci.ResponseBeginBlock{} } -func (BaseApplication) EndBlock(req abci.RequestEndBlock) ResponseEndBlock { - return ResponseEndBlock{} +func (BaseApplication) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { + return abci.ResponseEndBlock{} } func (BaseApplication) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots { @@ -176,7 +176,7 @@ func (app *GRPCApplication) Commit(ctx context.Context, req *abci.RequestCommit) return &res, nil } -func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { +func (app *GRPCApplication) InitChain(ctx context.Context, req *abci.RequestInitChain) (*ResponseInitChain, error) { res := app.app.InitChain(*req) return &res, nil } @@ -186,7 +186,7 @@ func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlo return &res, nil } -func (app *GRPCApplication) EndBlock(ctx context.Context, req *abci.RequestEndBlock) (*ResponseEndBlock, error) { +func (app *GRPCApplication) EndBlock(ctx context.Context, req *abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { res := app.app.EndBlock(*req) return &res, nil } diff --git a/abci/types/messages.go b/abci/types/messages.go index ff8df7f2e..40da47676 100644 --- a/abci/types/messages.go +++ b/abci/types/messages.go @@ -119,7 +119,7 @@ func ToRequestQuery(req abci.RequestQuery) *Request { } } -func ToRequestInitChain(req RequestInitChain) *Request { +func ToRequestInitChain(req abci.RequestInitChain) *Request { return &Request{ Value: &Request_InitChain{&req}, } @@ -241,7 +241,7 @@ func ToResponseBeginBlock(res abci.ResponseBeginBlock) *Response { } } -func ToResponseEndBlock(res ResponseEndBlock) *Response { +func ToResponseEndBlock(res abci.ResponseEndBlock) *Response { return &Response{ Value: &Response_EndBlock{&res}, } diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index ab1227ba8..3cbba579b 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -104,14 +104,14 @@ func (_m *Application) DeliverTx(_a0 abci.RequestDeliverTx) abci.ResponseDeliver } // EndBlock provides a mock function with given fields: _a0 -func (_m *Application) EndBlock(_a0 abci.RequestEndBlock) ocabci.ResponseEndBlock { +func (_m *Application) EndBlock(_a0 abci.RequestEndBlock) abci.ResponseEndBlock { ret := _m.Called(_a0) - var r0 ocabci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) ocabci.ResponseEndBlock); ok { + var r0 abci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) abci.ResponseEndBlock); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(ocabci.ResponseEndBlock) + r0 = ret.Get(0).(abci.ResponseEndBlock) } return r0 @@ -146,11 +146,11 @@ func (_m *Application) Info(_a0 abci.RequestInfo) abci.ResponseInfo { } // InitChain provides a mock function with given fields: _a0 -func (_m *Application) InitChain(_a0 ocabci.RequestInitChain) ocabci.ResponseInitChain { +func (_m *Application) InitChain(_a0 abci.RequestInitChain) ocabci.ResponseInitChain { ret := _m.Called(_a0) var r0 ocabci.ResponseInitChain - if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain) ocabci.ResponseInitChain); ok { + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) ocabci.ResponseInitChain); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(ocabci.ResponseInitChain) diff --git a/abci/types/pubkey.go b/abci/types/pubkey.go index 3ea2e9dd5..d7ab7c2b3 100644 --- a/abci/types/pubkey.go +++ b/abci/types/pubkey.go @@ -1,17 +1,19 @@ package types import ( + abci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" ) -func NewValidatorUpdate(pk crypto.PubKey, power int64) ValidatorUpdate { +func NewValidatorUpdate(pk crypto.PubKey, power int64) abci.ValidatorUpdate { pkp, err := cryptoenc.PubKeyToProto(pk) if err != nil { panic(err) } - return ValidatorUpdate{ + return abci.ValidatorUpdate{ // Address: PubKey: pkp, Power: power, diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 7011bdaeb..2da35b46d 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -10,9 +10,9 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - types2 "github.com/line/ostracon/proto/ostracon/types" + types1 "github.com/line/ostracon/proto/ostracon/types" types "github.com/tendermint/tendermint/abci/types" - crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + _ "github.com/tendermint/tendermint/proto/tendermint/crypto" _ "github.com/tendermint/tendermint/proto/tendermint/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -109,7 +109,7 @@ type Request_SetOption struct { SetOption *types.RequestSetOption `protobuf:"bytes,4,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` } type Request_InitChain struct { - InitChain *RequestInitChain `protobuf:"bytes,5,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` + InitChain *types.RequestInitChain `protobuf:"bytes,5,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } type Request_Query struct { Query *types.RequestQuery `protobuf:"bytes,6,opt,name=query,proto3,oneof" json:"query,omitempty"` @@ -201,7 +201,7 @@ func (m *Request) GetSetOption() *types.RequestSetOption { return nil } -func (m *Request) GetInitChain() *RequestInitChain { +func (m *Request) GetInitChain() *types.RequestInitChain { if x, ok := m.GetValue().(*Request_InitChain); ok { return x.InitChain } @@ -315,102 +315,18 @@ func (*Request) XXX_OneofWrappers() []interface{} { } } -type RequestInitChain struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - ConsensusParams *types.ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` - Validators []ValidatorUpdate `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators"` - AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` - InitialHeight int64 `protobuf:"varint,6,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` -} - -func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } -func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } -func (*RequestInitChain) ProtoMessage() {} -func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{1} -} -func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestInitChain.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestInitChain) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestInitChain.Merge(m, src) -} -func (m *RequestInitChain) XXX_Size() int { - return m.Size() -} -func (m *RequestInitChain) XXX_DiscardUnknown() { - xxx_messageInfo_RequestInitChain.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestInitChain proto.InternalMessageInfo - -func (m *RequestInitChain) GetTime() time.Time { - if m != nil { - return m.Time - } - return time.Time{} -} - -func (m *RequestInitChain) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *RequestInitChain) GetConsensusParams() *types.ConsensusParams { - if m != nil { - return m.ConsensusParams - } - return nil -} - -func (m *RequestInitChain) GetValidators() []ValidatorUpdate { - if m != nil { - return m.Validators - } - return nil -} - -func (m *RequestInitChain) GetAppStateBytes() []byte { - if m != nil { - return m.AppStateBytes - } - return nil -} - -func (m *RequestInitChain) GetInitialHeight() int64 { - if m != nil { - return m.InitialHeight - } - return 0 -} - type RequestBeginBlock struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Header types2.Header `protobuf:"bytes,2,opt,name=header,proto3" json:"header"` - LastCommitInfo LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo,proto3" json:"last_commit_info"` - ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Header types1.Header `protobuf:"bytes,2,opt,name=header,proto3" json:"header"` + LastCommitInfo types.LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo,proto3" json:"last_commit_info"` + ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators"` } func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{2} + return fileDescriptor_addf585b2317eb36, []int{1} } func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -446,18 +362,18 @@ func (m *RequestBeginBlock) GetHash() []byte { return nil } -func (m *RequestBeginBlock) GetHeader() types2.Header { +func (m *RequestBeginBlock) GetHeader() types1.Header { if m != nil { return m.Header } - return types2.Header{} + return types1.Header{} } -func (m *RequestBeginBlock) GetLastCommitInfo() LastCommitInfo { +func (m *RequestBeginBlock) GetLastCommitInfo() types.LastCommitInfo { if m != nil { return m.LastCommitInfo } - return LastCommitInfo{} + return types.LastCommitInfo{} } func (m *RequestBeginBlock) GetByzantineValidators() []Evidence { @@ -468,14 +384,14 @@ func (m *RequestBeginBlock) GetByzantineValidators() []Evidence { } type RequestBeginRecheckTx struct { - Header types2.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` + Header types1.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` } func (m *RequestBeginRecheckTx) Reset() { *m = RequestBeginRecheckTx{} } func (m *RequestBeginRecheckTx) String() string { return proto.CompactTextString(m) } func (*RequestBeginRecheckTx) ProtoMessage() {} func (*RequestBeginRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{3} + return fileDescriptor_addf585b2317eb36, []int{2} } func (m *RequestBeginRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -504,11 +420,11 @@ func (m *RequestBeginRecheckTx) XXX_DiscardUnknown() { var xxx_messageInfo_RequestBeginRecheckTx proto.InternalMessageInfo -func (m *RequestBeginRecheckTx) GetHeader() types2.Header { +func (m *RequestBeginRecheckTx) GetHeader() types1.Header { if m != nil { return m.Header } - return types2.Header{} + return types1.Header{} } type RequestEndRecheckTx struct { @@ -519,7 +435,7 @@ func (m *RequestEndRecheckTx) Reset() { *m = RequestEndRecheckTx{} } func (m *RequestEndRecheckTx) String() string { return proto.CompactTextString(m) } func (*RequestEndRecheckTx) ProtoMessage() {} func (*RequestEndRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{4} + return fileDescriptor_addf585b2317eb36, []int{3} } func (m *RequestEndRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -582,7 +498,7 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{5} + return fileDescriptor_addf585b2317eb36, []int{4} } func (m *Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -648,7 +564,7 @@ type Response_DeliverTx struct { DeliverTx *types.ResponseDeliverTx `protobuf:"bytes,10,opt,name=deliver_tx,json=deliverTx,proto3,oneof" json:"deliver_tx,omitempty"` } type Response_EndBlock struct { - EndBlock *ResponseEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` + EndBlock *types.ResponseEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,proto3,oneof" json:"end_block,omitempty"` } type Response_Commit struct { Commit *types.ResponseCommit `protobuf:"bytes,12,opt,name=commit,proto3,oneof" json:"commit,omitempty"` @@ -768,7 +684,7 @@ func (m *Response) GetDeliverTx() *types.ResponseDeliverTx { return nil } -func (m *Response) GetEndBlock() *ResponseEndBlock { +func (m *Response) GetEndBlock() *types.ResponseEndBlock { if x, ok := m.GetValue().(*Response_EndBlock); ok { return x.EndBlock } @@ -849,16 +765,16 @@ func (*Response) XXX_OneofWrappers() []interface{} { } type ResponseInitChain struct { - ConsensusParams *types.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` - Validators []ValidatorUpdate `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"` - AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + ConsensusParams *types.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` + Validators []types.ValidatorUpdate `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"` + AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{6} + return fileDescriptor_addf585b2317eb36, []int{5} } func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -894,7 +810,7 @@ func (m *ResponseInitChain) GetConsensusParams() *types.ConsensusParams { return nil } -func (m *ResponseInitChain) GetValidators() []ValidatorUpdate { +func (m *ResponseInitChain) GetValidators() []types.ValidatorUpdate { if m != nil { return m.Validators } @@ -928,7 +844,7 @@ func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{7} + return fileDescriptor_addf585b2317eb36, []int{6} } func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1034,66 +950,6 @@ func (m *ResponseCheckTx) GetMempoolError() string { return "" } -type ResponseEndBlock struct { - ValidatorUpdates []ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates"` - ConsensusParamUpdates *types.ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` - Events []types.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"` -} - -func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } -func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } -func (*ResponseEndBlock) ProtoMessage() {} -func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{8} -} -func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseEndBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResponseEndBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseEndBlock.Merge(m, src) -} -func (m *ResponseEndBlock) XXX_Size() int { - return m.Size() -} -func (m *ResponseEndBlock) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseEndBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseEndBlock proto.InternalMessageInfo - -func (m *ResponseEndBlock) GetValidatorUpdates() []ValidatorUpdate { - if m != nil { - return m.ValidatorUpdates - } - return nil -} - -func (m *ResponseEndBlock) GetConsensusParamUpdates() *types.ConsensusParams { - if m != nil { - return m.ConsensusParamUpdates - } - return nil -} - -func (m *ResponseEndBlock) GetEvents() []types.Event { - if m != nil { - return m.Events - } - return nil -} - type ResponseBeginRecheckTx struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` } @@ -1102,7 +958,7 @@ func (m *ResponseBeginRecheckTx) Reset() { *m = ResponseBeginRecheckTx{} func (m *ResponseBeginRecheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseBeginRecheckTx) ProtoMessage() {} func (*ResponseBeginRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{9} + return fileDescriptor_addf585b2317eb36, []int{7} } func (m *ResponseBeginRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1146,7 +1002,7 @@ func (m *ResponseEndRecheckTx) Reset() { *m = ResponseEndRecheckTx{} } func (m *ResponseEndRecheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseEndRecheckTx) ProtoMessage() {} func (*ResponseEndRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{10} + return fileDescriptor_addf585b2317eb36, []int{8} } func (m *ResponseEndRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1182,222 +1038,10 @@ func (m *ResponseEndRecheckTx) GetCode() uint32 { return 0 } -type LastCommitInfo struct { - Round int32 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` - Votes []VoteInfo `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes"` -} - -func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } -func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } -func (*LastCommitInfo) ProtoMessage() {} -func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{11} -} -func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LastCommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LastCommitInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LastCommitInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LastCommitInfo.Merge(m, src) -} -func (m *LastCommitInfo) XXX_Size() int { - return m.Size() -} -func (m *LastCommitInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LastCommitInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_LastCommitInfo proto.InternalMessageInfo - -func (m *LastCommitInfo) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *LastCommitInfo) GetVotes() []VoteInfo { - if m != nil { - return m.Votes - } - return nil -} - -// Validator -type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` -} - -func (m *Validator) Reset() { *m = Validator{} } -func (m *Validator) String() string { return proto.CompactTextString(m) } -func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{12} -} -func (m *Validator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Validator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Validator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Validator.Merge(m, src) -} -func (m *Validator) XXX_Size() int { - return m.Size() -} -func (m *Validator) XXX_DiscardUnknown() { - xxx_messageInfo_Validator.DiscardUnknown(m) -} - -var xxx_messageInfo_Validator proto.InternalMessageInfo - -func (m *Validator) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -func (m *Validator) GetPower() int64 { - if m != nil { - return m.Power - } - return 0 -} - -// ValidatorUpdate -type ValidatorUpdate struct { - PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` -} - -func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } -func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } -func (*ValidatorUpdate) ProtoMessage() {} -func (*ValidatorUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{13} -} -func (m *ValidatorUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorUpdate.Merge(m, src) -} -func (m *ValidatorUpdate) XXX_Size() int { - return m.Size() -} -func (m *ValidatorUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorUpdate.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorUpdate proto.InternalMessageInfo - -func (m *ValidatorUpdate) GetPubKey() crypto.PublicKey { - if m != nil { - return m.PubKey - } - return crypto.PublicKey{} -} - -func (m *ValidatorUpdate) GetPower() int64 { - if m != nil { - return m.Power - } - return 0 -} - -// VoteInfo -type VoteInfo struct { - Validator Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` - SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` -} - -func (m *VoteInfo) Reset() { *m = VoteInfo{} } -func (m *VoteInfo) String() string { return proto.CompactTextString(m) } -func (*VoteInfo) ProtoMessage() {} -func (*VoteInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{14} -} -func (m *VoteInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VoteInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VoteInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteInfo.Merge(m, src) -} -func (m *VoteInfo) XXX_Size() int { - return m.Size() -} -func (m *VoteInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VoteInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_VoteInfo proto.InternalMessageInfo - -func (m *VoteInfo) GetValidator() Validator { - if m != nil { - return m.Validator - } - return Validator{} -} - -func (m *VoteInfo) GetSignedLastBlock() bool { - if m != nil { - return m.SignedLastBlock - } - return false -} - type Evidence struct { Type types.EvidenceType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.abci.EvidenceType" json:"type,omitempty"` // The offending validator - Validator Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator"` + Validator types.Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator"` // The height when the offense occurred Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` // The corresponding time where the offense occurred @@ -1412,7 +1056,7 @@ func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{15} + return fileDescriptor_addf585b2317eb36, []int{9} } func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1448,11 +1092,11 @@ func (m *Evidence) GetType() types.EvidenceType { return types.EvidenceType_UNKNOWN } -func (m *Evidence) GetValidator() Validator { +func (m *Evidence) GetValidator() types.Validator { if m != nil { return m.Validator } - return Validator{} + return types.Validator{} } func (m *Evidence) GetHeight() int64 { @@ -1478,146 +1122,123 @@ func (m *Evidence) GetTotalVotingPower() int64 { func init() { proto.RegisterType((*Request)(nil), "ostracon.abci.Request") - proto.RegisterType((*RequestInitChain)(nil), "ostracon.abci.RequestInitChain") proto.RegisterType((*RequestBeginBlock)(nil), "ostracon.abci.RequestBeginBlock") proto.RegisterType((*RequestBeginRecheckTx)(nil), "ostracon.abci.RequestBeginRecheckTx") proto.RegisterType((*RequestEndRecheckTx)(nil), "ostracon.abci.RequestEndRecheckTx") proto.RegisterType((*Response)(nil), "ostracon.abci.Response") proto.RegisterType((*ResponseInitChain)(nil), "ostracon.abci.ResponseInitChain") proto.RegisterType((*ResponseCheckTx)(nil), "ostracon.abci.ResponseCheckTx") - proto.RegisterType((*ResponseEndBlock)(nil), "ostracon.abci.ResponseEndBlock") proto.RegisterType((*ResponseBeginRecheckTx)(nil), "ostracon.abci.ResponseBeginRecheckTx") proto.RegisterType((*ResponseEndRecheckTx)(nil), "ostracon.abci.ResponseEndRecheckTx") - proto.RegisterType((*LastCommitInfo)(nil), "ostracon.abci.LastCommitInfo") - proto.RegisterType((*Validator)(nil), "ostracon.abci.Validator") - proto.RegisterType((*ValidatorUpdate)(nil), "ostracon.abci.ValidatorUpdate") - proto.RegisterType((*VoteInfo)(nil), "ostracon.abci.VoteInfo") proto.RegisterType((*Evidence)(nil), "ostracon.abci.Evidence") } func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_addf585b2317eb36) } var fileDescriptor_addf585b2317eb36 = []byte{ - // 1904 bytes of a gzipped FileDescriptorProto - 0x1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x12, 0x82, 0x97, 0xea, 0xb3, 0xa9, 0xe5, - 0x08, 0x3c, 0xfe, 0x1c, 0xb6, 0x53, 0x90, 0x5f, 0xa2, 0xe7, 0xa6, 0x96, 0x61, 0xf2, 0xfd, 0x1f, - 0x7e, 0xfe, 0xfa, 0xb0, 0xfa, 0xc5, 0xeb, 0xc3, 0xea, 0xdf, 0x5f, 0x1f, 0x56, 0x3f, 0x7b, 0x73, - 0x58, 0xf9, 0xe2, 0xcd, 0x61, 0xe5, 0x2f, 0x6f, 0x0e, 0x2b, 0xbf, 0xbc, 0x3e, 0xb6, 0xf8, 0x64, - 0x36, 0xea, 0x1a, 0x6c, 0xda, 0xb3, 0x2d, 0x87, 0xf6, 0x32, 0xfe, 0x4f, 0x19, 0x6d, 0x49, 0x10, - 0xb9, 0xf3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0xe6, 0x98, 0x9a, 0x6d, 0x19, 0x00, 0x00, + // 1620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0xdd, 0x6e, 0xdb, 0xc6, + 0x12, 0x96, 0x2c, 0xd9, 0x12, 0xc7, 0xb6, 0xec, 0x4c, 0x7c, 0x7c, 0x14, 0x9e, 0x44, 0xce, 0x91, + 0x4f, 0x0e, 0xd2, 0x34, 0x95, 0x50, 0xa7, 0x0d, 0x52, 0xf4, 0x37, 0x52, 0x6d, 0xc8, 0x4d, 0x5a, + 0x3b, 0x4c, 0x9a, 0x02, 0xfd, 0x09, 0x41, 0x91, 0x6b, 0x89, 0x35, 0xc5, 0x65, 0xc8, 0x95, 0x13, + 0xf5, 0xaa, 0x40, 0x5f, 0x20, 0x6f, 0xd2, 0xab, 0x3e, 0x41, 0x6f, 0x72, 0x99, 0xcb, 0x5e, 0x14, + 0x69, 0x91, 0xdc, 0xb4, 0x7d, 0x87, 0x02, 0xc5, 0x2e, 0x7f, 0x4c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 0x85, 0x62, 0xc0, 0xf9, 0xa3, 0xac, + 0x9c, 0x22, 0x38, 0xf8, 0xc3, 0x08, 0xf5, 0x37, 0x77, 0xb6, 0x95, 0xe7, 0xeb, 0x0f, 0x54, 0x40, + 0x8a, 0xc4, 0x04, 0xa6, 0xcf, 0xba, 0x72, 0x06, 0x4d, 0xc2, 0x31, 0x23, 0x6e, 0xc5, 0xf4, 0xe9, + 0x4f, 0xce, 0x40, 0xd1, 0xf8, 0x09, 0x94, 0xc2, 0xee, 0x91, 0x36, 0x8f, 0xca, 0x29, 0x8a, 0x81, + 0xbf, 0x00, 0xa1, 0x5e, 0x70, 0xfe, 0x60, 0x2d, 0xa7, 0x88, 0x1f, 0xdc, 0x87, 0x25, 0x9f, 0xc0, + 0x31, 0x65, 0xc2, 0x94, 0xd3, 0x14, 0x00, 0x1e, 0x82, 0x74, 0xda, 0xe2, 0xd3, 0xff, 0x2e, 0x90, + 0x53, 0x55, 0x1d, 0xde, 0x05, 0x88, 0x0d, 0x2f, 0xa9, 0xff, 0x02, 0xc8, 0x59, 0xb4, 0x1a, 0x1e, + 0x40, 0x39, 0x54, 0x3c, 0x98, 0x3a, 0x93, 0xcb, 0xe9, 0xb2, 0x09, 0x1f, 0xc0, 0xea, 0x98, 0x80, + 0xc1, 0x6c, 0x93, 0xb6, 0x9c, 0x51, 0x0f, 0x71, 0xfc, 0x31, 0x3d, 0x83, 0xd9, 0x26, 0x6f, 0x39, + 0xa3, 0x3c, 0xc2, 0x6f, 0xe1, 0xcc, 0x94, 0xb2, 0xc1, 0xec, 0x83, 0xb8, 0xfc, 0x0a, 0x82, 0x09, + 0x07, 0x80, 0xd3, 0x32, 0x07, 0x5f, 0x61, 0x2e, 0x97, 0x5f, 0x45, 0x3f, 0xe1, 0x37, 0x50, 0x99, + 0x60, 0x94, 0x4c, 0x53, 0xba, 0x9c, 0x4d, 0x46, 0xe1, 0x17, 0xb0, 0x32, 0x46, 0x41, 0x19, 0x26, + 0x76, 0x39, 0x8b, 0x9e, 0x6a, 0xbd, 0xff, 0xf4, 0x45, 0x2d, 0xff, 0xec, 0x45, 0x2d, 0xff, 0xfb, + 0x8b, 0x5a, 0xfe, 0xc9, 0xcb, 0x5a, 0xee, 0xd9, 0xcb, 0x5a, 0xee, 0x97, 0x97, 0xb5, 0xdc, 0x97, + 0xdb, 0x3d, 0x93, 0xf5, 0x87, 0xdd, 0x86, 0x4e, 0x07, 0x4d, 0xcb, 0xb4, 0x49, 0x73, 0xc6, 0xff, + 0xb1, 0xdd, 0x25, 0x41, 0x24, 0xd7, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x30, 0xde, 0xf2, + 0xad, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1640,9 +1261,9 @@ type ABCIApplicationClient interface { CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) Query(ctx context.Context, in *types.RequestQuery, opts ...grpc.CallOption) (*types.ResponseQuery, error) Commit(ctx context.Context, in *types.RequestCommit, opts ...grpc.CallOption) (*types.ResponseCommit, error) - InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) + InitChain(ctx context.Context, in *types.RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*types.ResponseBeginBlock, error) - EndBlock(ctx context.Context, in *types.RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) + EndBlock(ctx context.Context, in *types.RequestEndBlock, opts ...grpc.CallOption) (*types.ResponseEndBlock, error) ListSnapshots(ctx context.Context, in *types.RequestListSnapshots, opts ...grpc.CallOption) (*types.ResponseListSnapshots, error) OfferSnapshot(ctx context.Context, in *types.RequestOfferSnapshot, opts ...grpc.CallOption) (*types.ResponseOfferSnapshot, error) LoadSnapshotChunk(ctx context.Context, in *types.RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*types.ResponseLoadSnapshotChunk, error) @@ -1731,7 +1352,7 @@ func (c *aBCIApplicationClient) Commit(ctx context.Context, in *types.RequestCom return out, nil } -func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { +func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *types.RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { out := new(ResponseInitChain) err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/InitChain", in, out, opts...) if err != nil { @@ -1749,8 +1370,8 @@ func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBegin return out, nil } -func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *types.RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) { - out := new(ResponseEndBlock) +func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *types.RequestEndBlock, opts ...grpc.CallOption) (*types.ResponseEndBlock, error) { + out := new(types.ResponseEndBlock) err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/EndBlock", in, out, opts...) if err != nil { return nil, err @@ -1822,9 +1443,9 @@ type ABCIApplicationServer interface { CheckTx(context.Context, *types.RequestCheckTx) (*ResponseCheckTx, error) Query(context.Context, *types.RequestQuery) (*types.ResponseQuery, error) Commit(context.Context, *types.RequestCommit) (*types.ResponseCommit, error) - InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) + InitChain(context.Context, *types.RequestInitChain) (*ResponseInitChain, error) BeginBlock(context.Context, *RequestBeginBlock) (*types.ResponseBeginBlock, error) - EndBlock(context.Context, *types.RequestEndBlock) (*ResponseEndBlock, error) + EndBlock(context.Context, *types.RequestEndBlock) (*types.ResponseEndBlock, error) ListSnapshots(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) OfferSnapshot(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) LoadSnapshotChunk(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) @@ -1861,13 +1482,13 @@ func (*UnimplementedABCIApplicationServer) Query(ctx context.Context, req *types func (*UnimplementedABCIApplicationServer) Commit(ctx context.Context, req *types.RequestCommit) (*types.ResponseCommit, error) { return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") } -func (*UnimplementedABCIApplicationServer) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { +func (*UnimplementedABCIApplicationServer) InitChain(ctx context.Context, req *types.RequestInitChain) (*ResponseInitChain, error) { return nil, status.Errorf(codes.Unimplemented, "method InitChain not implemented") } func (*UnimplementedABCIApplicationServer) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*types.ResponseBeginBlock, error) { return nil, status.Errorf(codes.Unimplemented, "method BeginBlock not implemented") } -func (*UnimplementedABCIApplicationServer) EndBlock(ctx context.Context, req *types.RequestEndBlock) (*ResponseEndBlock, error) { +func (*UnimplementedABCIApplicationServer) EndBlock(ctx context.Context, req *types.RequestEndBlock) (*types.ResponseEndBlock, error) { return nil, status.Errorf(codes.Unimplemented, "method EndBlock not implemented") } func (*UnimplementedABCIApplicationServer) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { @@ -2038,7 +1659,7 @@ func _ABCIApplication_Commit_Handler(srv interface{}, ctx context.Context, dec f } func _ABCIApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestInitChain) + in := new(types.RequestInitChain) if err := dec(in); err != nil { return nil, err } @@ -2050,7 +1671,7 @@ func _ABCIApplication_InitChain_Handler(srv interface{}, ctx context.Context, de FullMethod: "/ostracon.abci.ABCIApplication/InitChain", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).InitChain(ctx, req.(*RequestInitChain)) + return srv.(ABCIApplicationServer).InitChain(ctx, req.(*types.RequestInitChain)) } return interceptor(ctx, in, info, handler) } @@ -2669,7 +2290,7 @@ func (m *Request_EndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } -func (m *RequestInitChain) Marshal() (dAtA []byte, err error) { +func (m *RequestBeginBlock) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2679,96 +2300,20 @@ func (m *RequestInitChain) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RequestInitChain) MarshalTo(dAtA []byte) (int, error) { +func (m *RequestBeginBlock) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RequestInitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RequestBeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.InitialHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.InitialHeight)) - i-- - dAtA[i] = 0x30 - } - if len(m.AppStateBytes) > 0 { - i -= len(m.AppStateBytes) - copy(dAtA[i:], m.AppStateBytes) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppStateBytes))) - i-- - dAtA[i] = 0x2a - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ByzantineValidators) > 0 { + for iNdEx := len(m.ByzantineValidators) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.ConsensusParams != nil { - { - size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - n19, err19 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err19 != nil { - return 0, err19 - } - i -= n19 - i = encodeVarintTypes(dAtA, i, uint64(n19)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *RequestBeginBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestBeginBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestBeginBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ByzantineValidators) > 0 { - for iNdEx := len(m.ByzantineValidators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ByzantineValidators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ByzantineValidators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3441,69 +2986,6 @@ func (m *ResponseCheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ResponseEndBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseEndBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseEndBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.ConsensusParamUpdates != nil { - { - size, err := m.ConsensusParamUpdates.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ValidatorUpdates) > 0 { - for iNdEx := len(m.ValidatorUpdates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *ResponseBeginRecheckTx) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3560,164 +3042,6 @@ func (m *ResponseEndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *LastCommitInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LastCommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Validator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Validator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Power != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Power)) - i-- - dAtA[i] = 0x18 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ValidatorUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Power != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Power)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *VoteInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VoteInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SignedLastBlock { - i-- - if m.SignedLastBlock { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *Evidence) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3743,12 +3067,12 @@ func (m *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x28 } - n45, err45 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err45 != nil { - return 0, err45 + n40, err40 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err40 != nil { + return 0, err40 } - i -= n45 - i = encodeVarintTypes(dAtA, i, uint64(n45)) + i -= n40 + i = encodeVarintTypes(dAtA, i, uint64(n40)) i-- dAtA[i] = 0x22 if m.Height != 0 { @@ -4001,38 +3325,6 @@ func (m *Request_EndRecheckTx) Size() (n int) { } return n } -func (m *RequestInitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.ConsensusParams != nil { - l = m.ConsensusParams.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.AppStateBytes) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.InitialHeight != 0 { - n += 1 + sovTypes(uint64(m.InitialHeight)) - } - return n -} - func (m *RequestBeginBlock) Size() (n int) { if m == nil { return 0 @@ -4381,39 +3673,14 @@ func (m *ResponseCheckTx) Size() (n int) { return n } -func (m *ResponseEndBlock) Size() (n int) { +func (m *ResponseBeginRecheckTx) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.ValidatorUpdates) > 0 { - for _, e := range m.ValidatorUpdates { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.ConsensusParamUpdates != nil { - l = m.ConsensusParamUpdates.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ResponseBeginRecheckTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) + if m.Code != 0 { + n += 1 + sovTypes(uint64(m.Code)) } return n } @@ -4430,68 +3697,6 @@ func (m *ResponseEndRecheckTx) Size() (n int) { return n } -func (m *LastCommitInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Validator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Power != 0 { - n += 1 + sovTypes(uint64(m.Power)) - } - return n -} - -func (m *ValidatorUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PubKey.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Power != 0 { - n += 1 + sovTypes(uint64(m.Power)) - } - return n -} - -func (m *VoteInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Validator.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.SignedLastBlock { - n += 2 - } - return n -} - func (m *Evidence) Size() (n int) { if m == nil { return 0 @@ -4718,7 +3923,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &RequestInitChain{} + v := &types.RequestInitChain{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5165,7 +4370,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } return nil } -func (m *RequestInitChain) Unmarshal(dAtA []byte) error { +func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5188,17 +4393,17 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RequestInitChain: wiretype end group for non-group") + return fmt.Errorf("proto: RequestBeginBlock: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RequestInitChain: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RequestBeginBlock: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5208,30 +4413,31 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5241,27 +4447,28 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastCommitInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5288,16 +4495,13 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusParams == nil { - m.ConsensusParams = &types.ConsensusParams{} - } - if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.LastCommitInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ByzantineValidators", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5324,16 +4528,66 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, ValidatorUpdate{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ByzantineValidators = append(m.ByzantineValidators, Evidence{}) + if err := m.ByzantineValidators[len(m.ByzantineValidators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestBeginRecheckTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestBeginRecheckTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppStateBytes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5343,31 +4597,80 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.AppStateBytes = append(m.AppStateBytes[:0], dAtA[iNdEx:postIndex]...) - if m.AppStateBytes == nil { - m.AppStateBytes = []byte{} + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 6: + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestEndRecheckTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestEndRecheckTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestEndRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - m.InitialHeight = 0 + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5377,7 +4680,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.InitialHeight |= int64(b&0x7F) << shift + m.Height |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -5403,7 +4706,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { } return nil } -func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { +func (m *Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5426,17 +4729,17 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RequestBeginBlock: wiretype end group for non-group") + return fmt.Errorf("proto: Response: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RequestBeginBlock: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Exception", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5446,29 +4749,30 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} + v := &types.ResponseException{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + m.Value = &Response_Exception{v} iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5495,13 +4799,15 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.ResponseEcho{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_Echo{v} iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommitInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5528,13 +4834,15 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LastCommitInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.ResponseFlush{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_Flush{v} iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ByzantineValidators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5561,64 +4869,15 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ByzantineValidators = append(m.ByzantineValidators, Evidence{}) - if err := m.ByzantineValidators[len(m.ByzantineValidators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.ResponseInfo{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_Info{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestBeginRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestBeginRecheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SetOption", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5645,65 +4904,17 @@ func (m *RequestBeginRecheckTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &types.ResponseSetOption{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Value = &Response_SetOption{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestEndRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestEndRecheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestEndRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) } - m.Height = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5713,64 +4924,30 @@ func (m *RequestEndRecheckTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Height |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Response) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &ResponseInitChain{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Response: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Value = &Response_InitChain{v} + iNdEx = postIndex + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exception", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5797,15 +4974,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.ResponseException{} + v := &types.ResponseQuery{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_Exception{v} + m.Value = &Response_Query{v} iNdEx = postIndex - case 2: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Echo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BeginBlock", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5832,15 +5009,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.ResponseEcho{} + v := &types.ResponseBeginBlock{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_Echo{v} + m.Value = &Response_BeginBlock{v} iNdEx = postIndex - case 3: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Flush", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5867,15 +5044,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.ResponseFlush{} + v := &ResponseCheckTx{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_Flush{v} + m.Value = &Response_CheckTx{v} iNdEx = postIndex - case 4: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5902,15 +5079,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.ResponseInfo{} + v := &types.ResponseDeliverTx{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_Info{v} + m.Value = &Response_DeliverTx{v} iNdEx = postIndex - case 5: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SetOption", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5937,15 +5114,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.ResponseSetOption{} + v := &types.ResponseEndBlock{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_SetOption{v} + m.Value = &Response_EndBlock{v} iNdEx = postIndex - case 6: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitChain", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5972,15 +5149,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseInitChain{} + v := &types.ResponseCommit{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_InitChain{v} + m.Value = &Response_Commit{v} iNdEx = postIndex - case 7: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6007,15 +5184,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.ResponseQuery{} + v := &types.ResponseListSnapshots{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_Query{v} + m.Value = &Response_ListSnapshots{v} iNdEx = postIndex - case 8: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginBlock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6042,15 +5219,15 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.ResponseBeginBlock{} + v := &types.ResponseOfferSnapshot{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_BeginBlock{v} + m.Value = &Response_OfferSnapshot{v} iNdEx = postIndex - case 9: + case 15: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6077,221 +5254,11 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseCheckTx{} + v := &types.ResponseLoadSnapshotChunk{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &Response_CheckTx{v} - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ResponseDeliverTx{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_DeliverTx{v} - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ResponseEndBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_EndBlock{v} - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ResponseCommit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_Commit{v} - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListSnapshots", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ResponseListSnapshots{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_ListSnapshots{v} - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferSnapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ResponseOfferSnapshot{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_OfferSnapshot{v} - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LoadSnapshotChunk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ResponseLoadSnapshotChunk{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &Response_LoadSnapshotChunk{v} + m.Value = &Response_LoadSnapshotChunk{v} iNdEx = postIndex case 16: if wireType != 2 { @@ -6513,7 +5480,7 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, ValidatorUpdate{}) + m.Validators = append(m.Validators, types.ValidatorUpdate{}) if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -6927,7 +5894,7 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { +func (m *ResponseBeginRecheckTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6950,17 +5917,17 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseEndBlock: wiretype end group for non-group") + return fmt.Errorf("proto: ResponseBeginRecheckTx: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseEndBlock: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponseBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdates", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var msglen int + m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6970,198 +5937,44 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Code |= uint32(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTypes + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.ValidatorUpdates = append(m.ValidatorUpdates, ValidatorUpdate{}) - if err := m.ValidatorUpdates[len(m.ValidatorUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseEndRecheckTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParamUpdates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusParamUpdates == nil { - m.ConsensusParamUpdates = &types.ConsensusParams{} - } - if err := m.ConsensusParamUpdates.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, types.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseBeginRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseBeginRecheckTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseBeginRecheckTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseEndRecheckTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if iNdEx >= l { + return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ @@ -7219,417 +6032,6 @@ func (m *ResponseEndRecheckTx) Unmarshal(dAtA []byte) error { } return nil } -func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LastCommitInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LastCommitInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Votes = append(m.Votes, VoteInfo{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Validator) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Validator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) - } - m.Power = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Power |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorUpdate) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorUpdate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorUpdate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) - } - m.Power = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Power |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VoteInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VoteInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SignedLastBlock", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SignedLastBlock = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Evidence) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/abci/types/util.go b/abci/types/util.go index 8205fef7e..d60fded24 100644 --- a/abci/types/util.go +++ b/abci/types/util.go @@ -1,31 +1,33 @@ package types -import ( - "sort" -) - -//------------------------------------------------------------------------------ - -// ValidatorUpdates is a list of validators that implements the Sort interface -type ValidatorUpdates []ValidatorUpdate - -var _ sort.Interface = (ValidatorUpdates)(nil) - -// All these methods for ValidatorUpdates: -// Len, Less and Swap -// are for ValidatorUpdates to implement sort.Interface -// which will be used by the sort package. -// See Issue https://github.com/tendermint/abci/issues/212 - -func (v ValidatorUpdates) Len() int { - return len(v) -} - -// XXX: doesn't distinguish same validator with different power -func (v ValidatorUpdates) Less(i, j int) bool { - return v[i].PubKey.Compare(v[j].PubKey) <= 0 -} - -func (v ValidatorUpdates) Swap(i, j int) { - v[i], v[j] = v[j], v[i] -} +//import ( +// "sort" +// +// abci "github.com/tendermint/tendermint/abci/types" +//) +// +////------------------------------------------------------------------------------ +// +//// ValidatorUpdates is a list of validators that implements the Sort interface +//type ValidatorUpdates []abci.ValidatorUpdate +// +//var _ sort.Interface = (ValidatorUpdates)(nil) +// +//// All these methods for ValidatorUpdates: +//// Len, Less and Swap +//// are for ValidatorUpdates to implement sort.Interface +//// which will be used by the sort package. +//// See Issue https://github.com/tendermint/abci/issues/212 +// +//func (v ValidatorUpdates) Len() int { +// return len(v) +//} +// +//// XXX: doesn't distinguish same validator with different power +//func (v ValidatorUpdates) Less(i, j int) bool { +// return v[i].PubKey.Compare(v[j].PubKey) <= 0 +//} +// +//func (v ValidatorUpdates) Swap(i, j int) { +// v[i], v[j] = v[j], v[i] +//} diff --git a/blockchain/v0/reactor_test.go b/blockchain/v0/reactor_test.go index 87d49513e..5e1fc0426 100644 --- a/blockchain/v0/reactor_test.go +++ b/blockchain/v0/reactor_test.go @@ -326,8 +326,8 @@ func (app *testApp) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginB return abci.ResponseBeginBlock{} } -func (app *testApp) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { - return ocabci.ResponseEndBlock{} +func (app *testApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { + return abci.ResponseEndBlock{} } func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index 9be442f31..79f9cb41c 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -12,13 +12,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" config2 "github.com/line/ostracon/config" abcicli "github.com/line/ostracon/abci/client" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/evidence" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/service" @@ -55,7 +55,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) { ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() vals := types.OC2PB.ValidatorUpdates(state.Validators) - app.InitChain(ocabci.RequestInitChain{Validators: vals}) + app.InitChain(abci.RequestInitChain{Validators: vals}) blockDB := dbm.NewMemDB() blockStore := store.NewBlockStore(blockDB) diff --git a/consensus/common_test.go b/consensus/common_test.go index b67254a01..9b8cea9e1 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -17,6 +17,7 @@ import ( "github.com/go-kit/log/term" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -813,7 +814,7 @@ func randConsensusNet(nValidators int, testName string, tickerFunc func() Timeou ensureDir(filepath.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() vals := types.OC2PB.ValidatorUpdates(state.Validators) - app.InitChain(ocabci.RequestInitChain{Validators: vals}) + app.InitChain(abci.RequestInitChain{Validators: vals}) css[i] = newStateWithConfigAndBlockStore(thisConfig, state, privVals[i], app, stateDB) css[i].SetTimeoutTicker(tickerFunc()) @@ -884,7 +885,7 @@ func createPeersAndValidators(nValidators, nPeers int, testName string, // simulate handshake, receive app version. If don't do this, replay test will fail state.Version.Consensus.App = kvstore.ProtocolVersion } - app.InitChain(ocabci.RequestInitChain{Validators: vals}) + app.InitChain(abci.RequestInitChain{Validators: vals}) // sm.SaveState(stateDB,state) //height 1's validatorsInfo already saved in LoadStateFromDBOrGenesisDoc above css[i] = newStateWithConfig(thisConfig, state, privVal, app) @@ -904,7 +905,7 @@ func getSwitchIndex(switches []*p2p.Switch, peer p2p.Peer) int { panic("didnt find peer in switches") } -//------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------- // genesis func randGenesisDoc(numValidators int, randPower bool, minPower int64) (*types.GenesisDoc, []types.PrivValidator) { validators := make([]types.GenesisValidator, numValidators) diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index ae882f1c1..6ac1c96b5 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -15,12 +15,12 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" - ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" cstypes "github.com/line/ostracon/consensus/types" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -143,7 +143,7 @@ func TestReactorWithEvidence(t *testing.T) { ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() vals := types.OC2PB.ValidatorUpdates(state.Validators) - app.InitChain(ocabci.RequestInitChain{Validators: vals}) + app.InitChain(abci.RequestInitChain{Validators: vals}) pv := privVals[i] // duplicate code from: diff --git a/consensus/replay.go b/consensus/replay.go index 8904682a1..bab2dc794 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -8,7 +8,8 @@ import ( "reflect" "time" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/proxy" @@ -309,7 +310,7 @@ func (h *Handshaker) ReplayBlocks( validatorSet := types.NewValidatorSet(validators) nextVals := types.OC2PB.ValidatorUpdates(validatorSet) csParams := types.OC2PB.ConsensusParams(h.genDoc.ConsensusParams) - req := ocabci.RequestInitChain{ + req := abci.RequestInitChain{ Time: h.genDoc.GenesisTime, ChainId: h.genDoc.ChainID, InitialHeight: h.genDoc.InitialHeight, diff --git a/consensus/replay_stubs.go b/consensus/replay_stubs.go index ef7390ca1..70cb59d96 100644 --- a/consensus/replay_stubs.go +++ b/consensus/replay_stubs.go @@ -84,7 +84,7 @@ func (mock *mockProxyApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeli return *r } -func (mock *mockProxyApp) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { +func (mock *mockProxyApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { mock.txCount = 0 return *mock.abciResponses.EndBlock } diff --git a/consensus/replay_test.go b/consensus/replay_test.go index feb9ebfed..b703f3fbd 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -327,7 +327,7 @@ func (w *crashingWAL) Start() error { return w.next.Start() } func (w *crashingWAL) Stop() error { return w.next.Stop() } func (w *crashingWAL) Wait() { w.next.Wait() } -//------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------ type testSim struct { GenesisState sm.State Config *cfg.Config @@ -831,7 +831,7 @@ func buildAppStateFromChain(proxyApp proxy.AppConns, stateStore sm.Store, state.ConsensusParams.Version.AppVersion = kvstore.ProtocolVersion // simulate handshake, receive app version state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version validators := types.OC2PB.ValidatorUpdates(state.Validators) - if _, err := proxyApp.Consensus().InitChainSync(ocabci.RequestInitChain{ + if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ Validators: validators, }); err != nil { panic(err) @@ -882,7 +882,7 @@ func buildOCStateFromChain( state.ConsensusParams.Version.AppVersion = kvstore.ProtocolVersion // simulate handshake, receive app version state.Version.Consensus.App = kvstore.ProtocolVersion // simulate handshake, receive app version validators := types.OC2PB.ValidatorUpdates(state.Validators) - if _, err := proxyApp.Consensus().InitChainSync(ocabci.RequestInitChain{ + if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ Validators: validators, }); err != nil { panic(err) @@ -1295,10 +1295,10 @@ func TestHandshakeUpdatesValidators(t *testing.T) { // returns the vals on InitChain type initChainApp struct { ocabci.BaseApplication - vals []ocabci.ValidatorUpdate + vals []abci.ValidatorUpdate } -func (ica *initChainApp) InitChain(req ocabci.RequestInitChain) ocabci.ResponseInitChain { +func (ica *initChainApp) InitChain(req abci.RequestInitChain) ocabci.ResponseInitChain { return ocabci.ResponseInitChain{ Validators: ica.vals, } diff --git a/consensus/state_test.go b/consensus/state_test.go index 0969dec0c..93e9f67a0 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -2099,7 +2099,7 @@ func TestPruneBlocks(t *testing.T) { // Based behaviour is counter.Application mockApp := &mocks.Application{} mockApp.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{}) - mockApp.On("EndBlock", mock.Anything).Return(ocabci.ResponseEndBlock{}) + mockApp.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{}) mockApp.On("BeginRecheckTx", mock.Anything).Return(ocabci.ResponseBeginRecheckTx{Code: ocabci.CodeTypeOK}) mockApp.On("EndRecheckTx", mock.Anything).Return(ocabci.ResponseEndRecheckTx{Code: ocabci.CodeTypeOK}) // Mocking behaviour to response `RetainHeight` for pruneBlocks diff --git a/light/rpc/client.go b/light/rpc/client.go index a92fff2c2..e79766520 100644 --- a/light/rpc/client.go +++ b/light/rpc/client.go @@ -12,7 +12,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/merkle" tmbytes "github.com/line/ostracon/libs/bytes" tmmath "github.com/line/ostracon/libs/math" @@ -29,6 +28,7 @@ var errNegOrZeroHeight = errors.New("negative or zero height") type KeyPathFunc func(path string, key []byte) (merkle.KeyPath, error) // LightClient is an interface that contains functionality needed by Client from the light client. +// //go:generate mockery --case underscore --name LightClient type LightClient interface { ChainID() string @@ -423,7 +423,7 @@ func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.Resul results := types.NewResults(res.TxsResults) // proto-encode EndBlock events. - ebeBytes, err := proto.Marshal(&ocabci.ResponseEndBlock{ + ebeBytes, err := proto.Marshal(&abci.ResponseEndBlock{ Events: res.EndBlockEvents, }) if err != nil { diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index 452946736..a9f3e61d5 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -26,7 +26,7 @@ message Request { tendermint.abci.RequestFlush flush = 2; tendermint.abci.RequestInfo info = 3; tendermint.abci.RequestSetOption set_option = 4; - RequestInitChain init_chain = 5; + tendermint.abci.RequestInitChain init_chain = 5; tendermint.abci.RequestQuery query = 6; RequestBeginBlock begin_block = 7; tendermint.abci.RequestCheckTx check_tx = 8; @@ -60,15 +60,15 @@ message Request { // string value = 2; //} -message RequestInitChain { - google.protobuf.Timestamp time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - string chain_id = 2; - tendermint.abci.ConsensusParams consensus_params = 3; - repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; - bytes app_state_bytes = 5; - int64 initial_height = 6; -} +//message RequestInitChain { +// google.protobuf.Timestamp time = 1 +// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +// string chain_id = 2; +// tendermint.abci.ConsensusParams consensus_params = 3; +// repeated tendermint.abci.ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; +// bytes app_state_bytes = 5; +// int64 initial_height = 6; +//} //message RequestQuery { // bytes data = 1; @@ -80,7 +80,7 @@ message RequestInitChain { message RequestBeginBlock { bytes hash = 1; ostracon.types.Header header = 2 [(gogoproto.nullable) = false]; - LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + tendermint.abci.LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; } @@ -151,7 +151,7 @@ message Response { tendermint.abci.ResponseBeginBlock begin_block = 8; ResponseCheckTx check_tx = 9; tendermint.abci.ResponseDeliverTx deliver_tx = 10; - ResponseEndBlock end_block = 11; + tendermint.abci.ResponseEndBlock end_block = 11; tendermint.abci.ResponseCommit commit = 12; tendermint.abci.ResponseListSnapshots list_snapshots = 13; tendermint.abci.ResponseOfferSnapshot offer_snapshot = 14; @@ -193,7 +193,7 @@ message Response { message ResponseInitChain { tendermint.abci.ConsensusParams consensus_params = 1; - repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + repeated tendermint.abci.ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; bytes app_hash = 3; } @@ -245,13 +245,13 @@ message ResponseCheckTx { // string codespace = 8; //} -message ResponseEndBlock { - repeated ValidatorUpdate validator_updates = 1 - [(gogoproto.nullable) = false]; - tendermint.abci.ConsensusParams consensus_param_updates = 2; - repeated tendermint.abci.Event events = 3 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; -} +//message ResponseEndBlock { +// repeated tendermint.abci.ValidatorUpdate validator_updates = 1 +// [(gogoproto.nullable) = false]; +// tendermint.abci.ConsensusParams consensus_param_updates = 2; +// repeated tendermint.abci.Event events = 3 +// [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +//} //message ResponseCommit { // // reserve 1 @@ -323,10 +323,10 @@ message ResponseEndRecheckTx { // int64 max_gas = 2; //} -message LastCommitInfo { - int32 round = 1; - repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; -} +//message LastCommitInfo { +// int32 round = 1; +// repeated tendermint.abci.VoteInfo votes = 2 [(gogoproto.nullable) = false]; +//} // Event allows application developers to attach additional information to // ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. @@ -359,24 +359,24 @@ message LastCommitInfo { //---------------------------------------- // Blockchain Types -// Validator -message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) - // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power -} +//// Validator +//message Validator { +// bytes address = 1; // The first 20 bytes of SHA256(public key) +// // PubKey pub_key = 2 [(gogoproto.nullable)=false]; +// int64 power = 3; // The voting power +//} -// ValidatorUpdate -message ValidatorUpdate { - tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; - int64 power = 2; // The voting power -} +//// ValidatorUpdate +//message ValidatorUpdate { +// tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; +// int64 power = 2; // The voting power +//} // VoteInfo -message VoteInfo { - Validator validator = 1 [(gogoproto.nullable) = false]; - bool signed_last_block = 2; -} +//message VoteInfo { +// tendermint.abci.Validator validator = 1 [(gogoproto.nullable) = false]; +// bool signed_last_block = 2; +//} //enum EvidenceType { // UNKNOWN = 0; @@ -387,7 +387,7 @@ message VoteInfo { message Evidence { tendermint.abci.EvidenceType type = 1; // The offending validator - Validator validator = 2 [(gogoproto.nullable) = false]; + tendermint.abci.Validator validator = 2 [(gogoproto.nullable) = false]; // The height when the offense occurred int64 height = 3; // The corresponding time where the offense occurred @@ -424,9 +424,9 @@ service ABCIApplication { rpc CheckTx(tendermint.abci.RequestCheckTx) returns (ResponseCheckTx); rpc Query(tendermint.abci.RequestQuery) returns (tendermint.abci.ResponseQuery); rpc Commit(tendermint.abci.RequestCommit) returns (tendermint.abci.ResponseCommit); - rpc InitChain(RequestInitChain) returns (ResponseInitChain); + rpc InitChain(tendermint.abci.RequestInitChain) returns (ResponseInitChain); rpc BeginBlock(RequestBeginBlock) returns (tendermint.abci.ResponseBeginBlock); - rpc EndBlock(tendermint.abci.RequestEndBlock) returns (ResponseEndBlock); + rpc EndBlock(tendermint.abci.RequestEndBlock) returns (tendermint.abci.ResponseEndBlock); rpc ListSnapshots(tendermint.abci.RequestListSnapshots) returns (tendermint.abci.ResponseListSnapshots); rpc OfferSnapshot(tendermint.abci.RequestOfferSnapshot) returns (tendermint.abci.ResponseOfferSnapshot); rpc LoadSnapshotChunk(tendermint.abci.RequestLoadSnapshotChunk) returns (tendermint.abci.ResponseLoadSnapshotChunk); diff --git a/proto/ostracon/state/types.pb.go b/proto/ostracon/state/types.pb.go index 2e7bbb9ac..710c11509 100644 --- a/proto/ostracon/state/types.pb.go +++ b/proto/ostracon/state/types.pb.go @@ -9,11 +9,11 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - types1 "github.com/line/ostracon/abci/types" + _ "github.com/line/ostracon/abci/types" _ "github.com/line/ostracon/proto/ostracon/types" types "github.com/tendermint/tendermint/abci/types" state "github.com/tendermint/tendermint/proto/tendermint/state" - types2 "github.com/tendermint/tendermint/proto/tendermint/types" + types1 "github.com/tendermint/tendermint/proto/tendermint/types" _ "github.com/tendermint/tendermint/proto/tendermint/version" io "io" math "math" @@ -38,7 +38,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // It is persisted to disk for each height before calling Commit. type ABCIResponses struct { DeliverTxs []*types.ResponseDeliverTx `protobuf:"bytes,1,rep,name=deliver_txs,json=deliverTxs,proto3" json:"deliver_txs,omitempty"` - EndBlock *types1.ResponseEndBlock `protobuf:"bytes,2,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` + EndBlock *types.ResponseEndBlock `protobuf:"bytes,2,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` BeginBlock *types.ResponseBeginBlock `protobuf:"bytes,3,opt,name=begin_block,json=beginBlock,proto3" json:"begin_block,omitempty"` } @@ -82,7 +82,7 @@ func (m *ABCIResponses) GetDeliverTxs() []*types.ResponseDeliverTx { return nil } -func (m *ABCIResponses) GetEndBlock() *types1.ResponseEndBlock { +func (m *ABCIResponses) GetEndBlock() *types.ResponseEndBlock { if m != nil { return m.EndBlock } @@ -96,59 +96,6 @@ func (m *ABCIResponses) GetBeginBlock() *types.ResponseBeginBlock { return nil } -// ValidatorsInfo represents the latest validator set, or the last height it changed -type ValidatorsInfo struct { - ValidatorSet *types2.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` - LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"` -} - -func (m *ValidatorsInfo) Reset() { *m = ValidatorsInfo{} } -func (m *ValidatorsInfo) String() string { return proto.CompactTextString(m) } -func (*ValidatorsInfo) ProtoMessage() {} -func (*ValidatorsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_898987a4421067cd, []int{1} -} -func (m *ValidatorsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorsInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorsInfo.Merge(m, src) -} -func (m *ValidatorsInfo) XXX_Size() int { - return m.Size() -} -func (m *ValidatorsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorsInfo proto.InternalMessageInfo - -func (m *ValidatorsInfo) GetValidatorSet() *types2.ValidatorSet { - if m != nil { - return m.ValidatorSet - } - return nil -} - -func (m *ValidatorsInfo) GetLastHeightChanged() int64 { - if m != nil { - return m.LastHeightChanged - } - return 0 -} - type State struct { Version state.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` // immutable @@ -156,7 +103,7 @@ type State struct { InitialHeight int64 `protobuf:"varint,14,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockID types2.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` + LastBlockID types1.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` // LastValidators is used to validate block.LastCommit. // Validators are persisted to the database separately every time they change, @@ -164,13 +111,13 @@ type State struct { // Note that if s.LastBlockHeight causes a valset change, // we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1 // Extra +1 due to nextValSet delay. - NextValidators *types2.ValidatorSet `protobuf:"bytes,6,opt,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"` - Validators *types2.ValidatorSet `protobuf:"bytes,7,opt,name=validators,proto3" json:"validators,omitempty"` - LastValidators *types2.ValidatorSet `protobuf:"bytes,8,opt,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"` + NextValidators *types1.ValidatorSet `protobuf:"bytes,6,opt,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"` + Validators *types1.ValidatorSet `protobuf:"bytes,7,opt,name=validators,proto3" json:"validators,omitempty"` + LastValidators *types1.ValidatorSet `protobuf:"bytes,8,opt,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"` LastHeightValidatorsChanged int64 `protobuf:"varint,9,opt,name=last_height_validators_changed,json=lastHeightValidatorsChanged,proto3" json:"last_height_validators_changed,omitempty"` // Consensus parameters used for validating blocks. // Changes returned by EndBlock and updated after Commit. - ConsensusParams types2.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` + ConsensusParams types1.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` LastHeightConsensusParamsChanged int64 `protobuf:"varint,11,opt,name=last_height_consensus_params_changed,json=lastHeightConsensusParamsChanged,proto3" json:"last_height_consensus_params_changed,omitempty"` // Merkle root of the results from executing prev block LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` @@ -184,7 +131,7 @@ func (m *State) Reset() { *m = State{} } func (m *State) String() string { return proto.CompactTextString(m) } func (*State) ProtoMessage() {} func (*State) Descriptor() ([]byte, []int) { - return fileDescriptor_898987a4421067cd, []int{2} + return fileDescriptor_898987a4421067cd, []int{1} } func (m *State) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,11 +188,11 @@ func (m *State) GetLastBlockHeight() int64 { return 0 } -func (m *State) GetLastBlockID() types2.BlockID { +func (m *State) GetLastBlockID() types1.BlockID { if m != nil { return m.LastBlockID } - return types2.BlockID{} + return types1.BlockID{} } func (m *State) GetLastBlockTime() time.Time { @@ -255,21 +202,21 @@ func (m *State) GetLastBlockTime() time.Time { return time.Time{} } -func (m *State) GetNextValidators() *types2.ValidatorSet { +func (m *State) GetNextValidators() *types1.ValidatorSet { if m != nil { return m.NextValidators } return nil } -func (m *State) GetValidators() *types2.ValidatorSet { +func (m *State) GetValidators() *types1.ValidatorSet { if m != nil { return m.Validators } return nil } -func (m *State) GetLastValidators() *types2.ValidatorSet { +func (m *State) GetLastValidators() *types1.ValidatorSet { if m != nil { return m.LastValidators } @@ -283,11 +230,11 @@ func (m *State) GetLastHeightValidatorsChanged() int64 { return 0 } -func (m *State) GetConsensusParams() types2.ConsensusParams { +func (m *State) GetConsensusParams() types1.ConsensusParams { if m != nil { return m.ConsensusParams } - return types2.ConsensusParams{} + return types1.ConsensusParams{} } func (m *State) GetLastHeightConsensusParamsChanged() int64 { @@ -320,62 +267,58 @@ func (m *State) GetLastProofHash() []byte { func init() { proto.RegisterType((*ABCIResponses)(nil), "ostracon.state.ABCIResponses") - proto.RegisterType((*ValidatorsInfo)(nil), "ostracon.state.ValidatorsInfo") proto.RegisterType((*State)(nil), "ostracon.state.State") } func init() { proto.RegisterFile("ostracon/state/types.proto", fileDescriptor_898987a4421067cd) } var fileDescriptor_898987a4421067cd = []byte{ - // 754 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x4f, 0xdb, 0x4a, - 0x14, 0x8d, 0x5f, 0x80, 0x84, 0x31, 0x49, 0xde, 0x1b, 0xde, 0xc2, 0x84, 0xf7, 0x9c, 0x34, 0xfd, - 0x42, 0x95, 0xea, 0x48, 0x74, 0x55, 0xa9, 0xaa, 0x54, 0x27, 0x15, 0x44, 0x42, 0x15, 0x32, 0x88, - 0x45, 0x37, 0xd6, 0xc4, 0x1e, 0xec, 0x51, 0x1d, 0xdb, 0xf2, 0x4c, 0x22, 0xfa, 0x03, 0xba, 0xe9, - 0x8a, 0x9f, 0xc5, 0x92, 0x25, 0x2b, 0x5a, 0x85, 0x4d, 0x7f, 0x46, 0x35, 0x33, 0xb6, 0x33, 0x21, - 0xaa, 0x94, 0xdd, 0xe4, 0x9e, 0x73, 0x8f, 0x8f, 0xef, 0x3d, 0x13, 0x83, 0x76, 0x42, 0x59, 0x86, - 0xbc, 0x24, 0xee, 0x53, 0x86, 0x18, 0xee, 0xb3, 0xaf, 0x29, 0xa6, 0x56, 0x9a, 0x25, 0x2c, 0x81, - 0xcd, 0x02, 0xb3, 0x04, 0xd6, 0xfe, 0x37, 0x48, 0x82, 0x44, 0x40, 0x7d, 0x7e, 0x92, 0xac, 0xf6, - 0x5e, 0xa9, 0x80, 0xc6, 0x1e, 0x51, 0x05, 0xda, 0x0b, 0x71, 0x51, 0x5d, 0xc2, 0xba, 0x0c, 0xc7, - 0x3e, 0xce, 0x26, 0x24, 0x66, 0x39, 0x3a, 0x43, 0x11, 0xf1, 0x11, 0x4b, 0xb2, 0x9c, 0xf1, 0xff, - 0x0a, 0x23, 0x45, 0x19, 0x9a, 0x14, 0x02, 0xff, 0xad, 0xc0, 0xaa, 0xbc, 0xa9, 0xa0, 0x33, 0x9c, - 0x51, 0x52, 0x98, 0xc8, 0xf1, 0x4e, 0x90, 0x24, 0x41, 0x84, 0xfb, 0xe2, 0xd7, 0x78, 0x7a, 0xd9, - 0x67, 0x64, 0x82, 0x29, 0x43, 0x93, 0x74, 0x2d, 0x79, 0x15, 0x5d, 0x19, 0x5c, 0x7b, 0x5f, 0x41, - 0x1f, 0x0f, 0xa5, 0x77, 0xa7, 0x81, 0xc6, 0x07, 0x7b, 0x30, 0x72, 0x30, 0x4d, 0x93, 0x98, 0x62, - 0x0a, 0x07, 0x40, 0xf7, 0x71, 0x44, 0x66, 0x38, 0x73, 0xd9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x5b, 0x19, 0x40, 0xd8, 0x79, 0xb2, 0x6a, 0x67, 0x50, 0x30, - 0x4f, 0x05, 0x31, 0xcf, 0x5f, 0xcb, 0x5b, 0x2e, 0xc3, 0x4f, 0xe0, 0xd9, 0x52, 0xf8, 0x1f, 0xe9, - 0x97, 0xf6, 0x74, 0x61, 0xaf, 0xab, 0xdc, 0x86, 0x65, 0xa1, 0xc2, 0x63, 0x11, 0xc4, 0x0c, 0xd3, - 0x69, 0xc4, 0xa8, 0x1b, 0x22, 0x1a, 0x1a, 0x3b, 0x5d, 0xed, 0x60, 0x47, 0x06, 0xd1, 0x91, 0xf5, - 0x63, 0x44, 0x43, 0xb8, 0x07, 0xea, 0x28, 0x4d, 0x25, 0xa5, 0x21, 0x28, 0x35, 0x94, 0xa6, 0x02, - 0x7a, 0x99, 0x0f, 0x3e, 0xcd, 0x92, 0xe4, 0x52, 0x32, 0x7e, 0xd5, 0x04, 0x45, 0x44, 0xe5, 0x94, - 0x97, 0x39, 0xd1, 0x3e, 0xba, 0x99, 0x9b, 0xda, 0xed, 0xdc, 0xd4, 0x7e, 0xce, 0x4d, 0xed, 0xfa, - 0xc1, 0xac, 0xdc, 0x3e, 0x98, 0x95, 0xbb, 0x07, 0xb3, 0xf2, 0xf9, 0x75, 0x40, 0x58, 0x38, 0x1d, - 0x5b, 0x5e, 0x32, 0xe9, 0x47, 0x24, 0xc6, 0xfd, 0xf2, 0x73, 0x21, 0x3f, 0x32, 0xcb, 0x9f, 0xa6, - 0xf1, 0x96, 0xa8, 0xbe, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x58, 0x80, 0x9e, 0xad, 0xb3, 0x06, - 0x00, 0x00, + // 708 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0xcf, 0x4e, 0xdb, 0x4a, + 0x14, 0xc6, 0xe3, 0x1b, 0x20, 0x61, 0x4c, 0x92, 0x7b, 0x7d, 0xef, 0xc2, 0x84, 0x5b, 0x27, 0xa5, + 0xff, 0xa2, 0x4a, 0x75, 0x24, 0xba, 0xea, 0xa6, 0x52, 0x9d, 0x54, 0x10, 0x09, 0x55, 0xc8, 0x20, + 0x16, 0xdd, 0x58, 0x13, 0x7b, 0xb0, 0x47, 0x75, 0x3c, 0x96, 0x67, 0x82, 0xe8, 0x2b, 0x74, 0xc5, + 0x63, 0xb1, 0x64, 0x59, 0x75, 0x41, 0xab, 0xb0, 0xe9, 0x63, 0x54, 0x33, 0xe3, 0x71, 0x06, 0x22, + 0x24, 0x76, 0x93, 0xf3, 0x7d, 0xe7, 0xa7, 0xcf, 0x67, 0x8e, 0x1d, 0xd0, 0x25, 0x94, 0x15, 0x30, + 0x24, 0xd9, 0x90, 0x32, 0xc8, 0xd0, 0x90, 0x7d, 0xcd, 0x11, 0x75, 0xf3, 0x82, 0x30, 0x62, 0xb5, + 0x95, 0xe6, 0x0a, 0xad, 0xfb, 0x5f, 0x4c, 0x62, 0x22, 0xa4, 0x21, 0x3f, 0x49, 0x57, 0x77, 0xbb, + 0x22, 0xc0, 0x69, 0x88, 0x75, 0x40, 0x77, 0x09, 0x17, 0xd5, 0x3b, 0x5a, 0x9f, 0xa1, 0x2c, 0x42, + 0xc5, 0x0c, 0x67, 0xac, 0x54, 0xcf, 0x61, 0x8a, 0x23, 0xc8, 0x48, 0x51, 0x3a, 0x9e, 0xac, 0x38, + 0x72, 0x58, 0xc0, 0x99, 0x02, 0xfc, 0xbf, 0x22, 0xeb, 0x78, 0x47, 0x53, 0xcf, 0x51, 0x41, 0xb1, + 0x0a, 0x51, 0xea, 0xbd, 0x98, 0x90, 0x38, 0x45, 0x43, 0xf1, 0x6b, 0x3a, 0x3f, 0x1b, 0x32, 0x3c, + 0x43, 0x94, 0xc1, 0x59, 0xfe, 0x28, 0xbc, 0xae, 0xae, 0x0c, 0xae, 0xbb, 0xa3, 0xa9, 0xf7, 0x87, + 0xb2, 0xfb, 0xc3, 0x00, 0xad, 0x0f, 0xde, 0x68, 0xe2, 0x23, 0x9a, 0x93, 0x8c, 0x22, 0x6a, 0x8d, + 0x80, 0x19, 0xa1, 0x14, 0x9f, 0xa3, 0x22, 0x60, 0x17, 0xd4, 0x36, 0xfa, 0xf5, 0x81, 0xb9, 0xb7, + 0xeb, 0x2e, 0x21, 0x2e, 0x87, 0xb8, 0xaa, 0x61, 0x2c, 0xbd, 0x27, 0x17, 0x3e, 0x88, 0xd4, 0x91, + 0x5a, 0xef, 0xc1, 0x26, 0xca, 0xa2, 0x60, 0x9a, 0x92, 0xf0, 0x8b, 0xfd, 0x57, 0xdf, 0x18, 0x98, + 0x7b, 0x4f, 0x1f, 0x44, 0x7c, 0xcc, 0x22, 0x8f, 0x1b, 0xfd, 0x26, 0x2a, 0x4f, 0xd6, 0x18, 0x98, + 0x53, 0x14, 0xe3, 0xac, 0x24, 0xd4, 0x05, 0xe1, 0xd9, 0x83, 0x04, 0x8f, 0x7b, 0x25, 0x03, 0x4c, + 0xab, 0xf3, 0xee, 0xb7, 0x06, 0x58, 0x3f, 0xe6, 0xf3, 0xb0, 0xde, 0x81, 0x46, 0x39, 0x77, 0xdb, + 0x10, 0xac, 0x6d, 0x9d, 0x25, 0x66, 0xe6, 0x9e, 0x4a, 0x83, 0xb7, 0x76, 0x75, 0xd3, 0xab, 0xf9, + 0xca, 0x6f, 0xbd, 0x04, 0xcd, 0x30, 0x81, 0x38, 0x0b, 0x70, 0x24, 0x9e, 0x64, 0xd3, 0x33, 0x17, + 0x37, 0xbd, 0xc6, 0x88, 0xd7, 0x26, 0x63, 0xbf, 0x21, 0xc4, 0x49, 0x64, 0xbd, 0x00, 0x6d, 0x9c, + 0x61, 0x86, 0x61, 0x1a, 0x24, 0x08, 0xc7, 0x09, 0xb3, 0xdb, 0x7d, 0x63, 0x50, 0xf7, 0x5b, 0x65, + 0xf5, 0x40, 0x14, 0xad, 0xd7, 0xe0, 0x9f, 0x14, 0x52, 0x26, 0x1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, + 0xdd, 0xe7, 0x57, 0xf1, 0x4c, 0x11, 0xaf, 0xbf, 0x8c, 0x77, 0x8f, 0xaf, 0x32, 0xaa, 0x45, 0x2c, + 0x10, 0x9d, 0xa7, 0x8c, 0x06, 0x09, 0xa4, 0x89, 0xbd, 0xd5, 0x37, 0x06, 0x5b, 0x72, 0x11, 0x7d, + 0x59, 0x3f, 0x80, 0x34, 0xb1, 0xb6, 0x41, 0x13, 0xe6, 0xb9, 0xb4, 0xb4, 0x84, 0xa5, 0x01, 0xf3, + 0x5c, 0x48, 0xaf, 0xca, 0xc1, 0xe7, 0x05, 0x21, 0x67, 0xd2, 0xf1, 0xbb, 0x21, 0x2c, 0x62, 0x55, + 0x8e, 0x78, 0x99, 0x1b, 0xbd, 0xfd, 0xab, 0x85, 0x63, 0x5c, 0x2f, 0x1c, 0xe3, 0xd7, 0xc2, 0x31, + 0x2e, 0x6f, 0x9d, 0xda, 0xf5, 0xad, 0x53, 0xfb, 0x7e, 0xeb, 0xd4, 0x3e, 0xbf, 0x89, 0x31, 0x4b, + 0xe6, 0x53, 0x37, 0x24, 0xb3, 0x61, 0x8a, 0x33, 0x34, 0xac, 0x3e, 0xd4, 0xf2, 0xf3, 0x7e, 0xf7, + 0x4f, 0x61, 0xba, 0x21, 0xaa, 0x6f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x58, 0x15, 0x8f, 0x75, + 0x2d, 0x06, 0x00, 0x00, } func (m *ABCIResponses) Marshal() (dAtA []byte, err error) { @@ -439,46 +382,6 @@ func (m *ABCIResponses) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ValidatorsInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastHeightChanged != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastHeightChanged)) - i-- - dAtA[i] = 0x10 - } - if m.ValidatorSet != nil { - { - size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *State) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -583,12 +486,12 @@ func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):]) - if err8 != nil { - return 0, err8 + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):]) + if err7 != nil { + return 0, err7 } - i -= n8 - i = encodeVarintTypes(dAtA, i, uint64(n8)) + i -= n7 + i = encodeVarintTypes(dAtA, i, uint64(n7)) i-- dAtA[i] = 0x2a { @@ -660,22 +563,6 @@ func (m *ABCIResponses) Size() (n int) { return n } -func (m *ValidatorsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ValidatorSet != nil { - l = m.ValidatorSet.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.LastHeightChanged != 0 { - n += 1 + sovTypes(uint64(m.LastHeightChanged)) - } - return n -} - func (m *State) Size() (n int) { if m == nil { return 0 @@ -832,7 +719,7 @@ func (m *ABCIResponses) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.EndBlock == nil { - m.EndBlock = &types1.ResponseEndBlock{} + m.EndBlock = &types.ResponseEndBlock{} } if err := m.EndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -895,111 +782,6 @@ func (m *ABCIResponses) Unmarshal(dAtA []byte) error { } return nil } -func (m *ValidatorsInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ValidatorSet == nil { - m.ValidatorSet = &types2.ValidatorSet{} - } - if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastHeightChanged", wireType) - } - m.LastHeightChanged = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastHeightChanged |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *State) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1209,7 +991,7 @@ func (m *State) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.NextValidators == nil { - m.NextValidators = &types2.ValidatorSet{} + m.NextValidators = &types1.ValidatorSet{} } if err := m.NextValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1245,7 +1027,7 @@ func (m *State) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Validators == nil { - m.Validators = &types2.ValidatorSet{} + m.Validators = &types1.ValidatorSet{} } if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1281,7 +1063,7 @@ func (m *State) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.LastValidators == nil { - m.LastValidators = &types2.ValidatorSet{} + m.LastValidators = &types1.ValidatorSet{} } if err := m.LastValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index fce3ad884..3fe0a31be 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -20,15 +20,15 @@ import "tendermint/abci/types.proto"; // It is persisted to disk for each height before calling Commit. message ABCIResponses { repeated tendermint.abci.ResponseDeliverTx deliver_txs = 1; - ostracon.abci.ResponseEndBlock end_block = 2; + tendermint.abci.ResponseEndBlock end_block = 2; tendermint.abci.ResponseBeginBlock begin_block = 3; } // ValidatorsInfo represents the latest validator set, or the last height it changed -message ValidatorsInfo { - tendermint.types.ValidatorSet validator_set = 1; - int64 last_height_changed = 2; -} +//message ValidatorsInfo { +// tendermint.types.ValidatorSet validator_set = 1; +// int64 last_height_changed = 2; +//} // ConsensusParamsInfo represents the latest consensus params, or the last height it changed //message ConsensusParamsInfo { diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 8113ccd9e..bd690937b 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -17,11 +17,11 @@ type AppConnConsensus interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - InitChainSync(ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) + InitChainSync(abci.RequestInitChain) (*ocabci.ResponseInitChain, error) BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) DeliverTxAsync(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes - EndBlockSync(abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) + EndBlockSync(abci.RequestEndBlock) (*abci.ResponseEndBlock, error) CommitSync() (*abci.ResponseCommit, error) } @@ -79,7 +79,7 @@ func (app *appConnConsensus) Error() error { return app.appConn.Error() } -func (app *appConnConsensus) InitChainSync(req ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (app *appConnConsensus) InitChainSync(req abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { return app.appConn.InitChainSync(req) } @@ -91,7 +91,7 @@ func (app *appConnConsensus) DeliverTxAsync(req abci.RequestDeliverTx, cb abcicl return app.appConn.DeliverTxAsync(req, cb) } -func (app *appConnConsensus) EndBlockSync(req abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { +func (app *appConnConsensus) EndBlockSync(req abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { return app.appConn.EndBlockSync(req) } diff --git a/proxy/mocks/app_conn_consensus.go b/proxy/mocks/app_conn_consensus.go index 37a42c906..08858b919 100644 --- a/proxy/mocks/app_conn_consensus.go +++ b/proxy/mocks/app_conn_consensus.go @@ -78,15 +78,15 @@ func (_m *AppConnConsensus) DeliverTxAsync(_a0 abci.RequestDeliverTx, _a1 abcicl } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) EndBlockSync(_a0 abci.RequestEndBlock) (*ocabci.ResponseEndBlock, error) { +func (_m *AppConnConsensus) EndBlockSync(_a0 abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *ocabci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *ocabci.ResponseEndBlock); ok { + var r0 *abci.ResponseEndBlock + if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *abci.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ocabci.ResponseEndBlock) + r0 = ret.Get(0).(*abci.ResponseEndBlock) } } @@ -115,11 +115,11 @@ func (_m *AppConnConsensus) Error() error { } // InitChainSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) InitChainSync(_a0 ocabci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (_m *AppConnConsensus) InitChainSync(_a0 abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { ret := _m.Called(_a0) var r0 *ocabci.ResponseInitChain - if rf, ok := ret.Get(0).(func(ocabci.RequestInitChain) *ocabci.ResponseInitChain); ok { + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *ocabci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { @@ -128,7 +128,7 @@ func (_m *AppConnConsensus) InitChainSync(_a0 ocabci.RequestInitChain) (*ocabci. } var r1 error - if rf, ok := ret.Get(1).(func(ocabci.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/rpc/client/evidence_test.go b/rpc/client/evidence_test.go index 005f279fb..1617bbb68 100644 --- a/rpc/client/evidence_test.go +++ b/rpc/client/evidence_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ocabci "github.com/line/ostracon/abci/types" @@ -151,7 +152,7 @@ func TestBroadcastEvidence_DuplicateVoteEvidence(t *testing.T) { qres := result2.Response require.True(t, qres.IsOK()) - var v ocabci.ValidatorUpdate + var v abci.ValidatorUpdate err = ocabci.ReadMessage(bytes.NewReader(qres.Value), &v) require.NoError(t, err, "Error reading query result, value %v", qres.Value) diff --git a/rpc/core/blocks_test.go b/rpc/core/blocks_test.go index 49efd12b8..61653f2de 100644 --- a/rpc/core/blocks_test.go +++ b/rpc/core/blocks_test.go @@ -22,7 +22,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - ocabci "github.com/line/ostracon/abci/types" ocstate "github.com/line/ostracon/proto/ostracon/state" ctypes "github.com/line/ostracon/rpc/core/types" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" @@ -89,7 +88,7 @@ func TestBlockResults(t *testing.T) { {Code: 0, Data: []byte{0x02}, Log: "ok"}, {Code: 1, Log: "not ok"}, }, - EndBlock: &ocabci.ResponseEndBlock{}, + EndBlock: &abci.ResponseEndBlock{}, BeginBlock: &abci.ResponseBeginBlock{}, } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 4b50460c6..b54ea8d3f 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -53,7 +53,7 @@ type ResultBlockResults struct { TxsResults []*abci.ResponseDeliverTx `json:"txs_results"` BeginBlockEvents []abci.Event `json:"begin_block_events"` EndBlockEvents []abci.Event `json:"end_block_events"` - ValidatorUpdates []ocabci.ValidatorUpdate `json:"validator_updates"` + ValidatorUpdates []abci.ValidatorUpdate `json:"validator_updates"` ConsensusParamUpdates *abci.ConsensusParams `json:"consensus_param_updates"` } diff --git a/state/execution.go b/state/execution.go index 1c7a8d3ba..2d8fe6731 100644 --- a/state/execution.go +++ b/state/execution.go @@ -425,8 +425,8 @@ func execBlockOnProxyApp( } func getBeginBlockValidatorInfo(block *types.Block, store Store, - initialHeight int64) ocabci.LastCommitInfo { - voteInfos := make([]ocabci.VoteInfo, block.LastCommit.Size()) + initialHeight int64) abci.LastCommitInfo { + voteInfos := make([]abci.VoteInfo, block.LastCommit.Size()) // Initial block -> LastCommitInfo.Votes are empty. // Remember that the first LastCommit is intentionally empty, so it makes // sense for LastCommitInfo.Votes to also be empty. @@ -451,20 +451,20 @@ func getBeginBlockValidatorInfo(block *types.Block, store Store, for i, val := range lastValSet.Validators { commitSig := block.LastCommit.Signatures[i] - voteInfos[i] = ocabci.VoteInfo{ + voteInfos[i] = abci.VoteInfo{ Validator: types.OC2PB.Validator(val), SignedLastBlock: !commitSig.Absent(), } } } - return ocabci.LastCommitInfo{ + return abci.LastCommitInfo{ Round: block.LastCommit.Round, Votes: voteInfos, } } -func validateValidatorUpdates(abciUpdates []ocabci.ValidatorUpdate, +func validateValidatorUpdates(abciUpdates []abci.ValidatorUpdate, params tmproto.ValidatorParams) error { for _, valUpdate := range abciUpdates { if valUpdate.GetPower() < 0 { diff --git a/state/execution_test.go b/state/execution_test.go index 404251d39..ff411473c 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -293,32 +293,32 @@ func TestValidateValidatorUpdates(t *testing.T) { testCases := []struct { name string - abciUpdates []ocabci.ValidatorUpdate + abciUpdates []abci.ValidatorUpdate validatorParams tmproto.ValidatorParams shouldErr bool }{ { "adding a validator is OK", - []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, + []abci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, defaultValidatorParams, false, }, { "updating a validator is OK", - []ocabci.ValidatorUpdate{{PubKey: pk1, Power: 20}}, + []abci.ValidatorUpdate{{PubKey: pk1, Power: 20}}, defaultValidatorParams, false, }, { "removing a validator is OK", - []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, + []abci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, defaultValidatorParams, false, }, { "adding a validator with negative power results in error", - []ocabci.ValidatorUpdate{{PubKey: pk2, Power: -100}}, + []abci.ValidatorUpdate{{PubKey: pk2, Power: -100}}, defaultValidatorParams, true, }, @@ -352,7 +352,7 @@ func TestUpdateValidators(t *testing.T) { name string currentSet *types.ValidatorSet - abciUpdates []ocabci.ValidatorUpdate + abciUpdates []abci.ValidatorUpdate resultingSet *types.ValidatorSet shouldErr bool @@ -360,28 +360,28 @@ func TestUpdateValidators(t *testing.T) { { "adding a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, + []abci.ValidatorUpdate{{PubKey: pk2, Power: 20}}, types.NewValidatorSet([]*types.Validator{val1, val2}), false, }, { "updating a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []ocabci.ValidatorUpdate{{PubKey: pk, Power: 20}}, + []abci.ValidatorUpdate{{PubKey: pk, Power: 20}}, types.NewValidatorSet([]*types.Validator{types.NewValidator(pubkey1, 20)}), false, }, { "removing a validator is OK", types.NewValidatorSet([]*types.Validator{val1, val2}), - []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, + []abci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), false, }, { "removing a non-existing validator results in error", types.NewValidatorSet([]*types.Validator{val1}), - []ocabci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, + []abci.ValidatorUpdate{{PubKey: pk2, Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), true, }, @@ -450,7 +450,7 @@ func TestEndBlockValidatorUpdates(t *testing.T) { pubkey := ed25519.GenPrivKey().PubKey() pk, err := cryptoenc.PubKeyToProto(pubkey) require.NoError(t, err) - app.ValidatorUpdates = []ocabci.ValidatorUpdate{ + app.ValidatorUpdates = []abci.ValidatorUpdate{ {PubKey: pk, Power: 10}, } @@ -506,7 +506,7 @@ func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { vp, err := cryptoenc.PubKeyToProto(state.Validators.Validators[0].PubKey) require.NoError(t, err) // Remove the only validator - app.ValidatorUpdates = []ocabci.ValidatorUpdate{ + app.ValidatorUpdates = []abci.ValidatorUpdate{ {PubKey: vp, Power: 0}, } diff --git a/state/export_test.go b/state/export_test.go index 0b9206621..cfb9c5a33 100644 --- a/state/export_test.go +++ b/state/export_test.go @@ -1,10 +1,10 @@ package state import ( + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - ocabci "github.com/line/ostracon/abci/types" ocstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/types" ) @@ -36,7 +36,7 @@ func UpdateState( // ValidateValidatorUpdates is an alias for validateValidatorUpdates exported // from execution.go, exclusively and explicitly for testing. -func ValidateValidatorUpdates(abciUpdates []ocabci.ValidatorUpdate, params tmproto.ValidatorParams) error { +func ValidateValidatorUpdates(abciUpdates []abci.ValidatorUpdate, params tmproto.ValidatorParams) error { return validateValidatorUpdates(abciUpdates, params) } diff --git a/state/helpers_test.go b/state/helpers_test.go index b90b997b7..4656d8753 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -177,13 +177,13 @@ func makeHeaderPartsResponsesValPubKeyChange( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } // If the pubkey is new, remove the old and add the new. _, val := state.NextValidators.GetByIndex(0) if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) { - abciResponses.EndBlock = &ocabci.ResponseEndBlock{ - ValidatorUpdates: []ocabci.ValidatorUpdate{ + abciResponses.EndBlock = &abci.ResponseEndBlock{ + ValidatorUpdates: []abci.ValidatorUpdate{ types.OC2PB.NewValidatorUpdate(val.PubKey, 0), types.OC2PB.NewValidatorUpdate(pubkey, 10), }, @@ -201,14 +201,14 @@ func makeHeaderPartsResponsesValPowerChange( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } // If the pubkey is new, remove the old and add the new. _, val := state.NextValidators.GetByIndex(0) if val.VotingPower != power { - abciResponses.EndBlock = &ocabci.ResponseEndBlock{ - ValidatorUpdates: []ocabci.ValidatorUpdate{ + abciResponses.EndBlock = &abci.ResponseEndBlock{ + ValidatorUpdates: []abci.ValidatorUpdate{ types.OC2PB.NewValidatorUpdate(val.PubKey, power), }, } @@ -225,7 +225,7 @@ func makeHeaderPartsResponsesParams( block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ConsensusParamUpdates: types.OC2PB.ConsensusParams(¶ms)}, + EndBlock: &abci.ResponseEndBlock{ConsensusParamUpdates: types.OC2PB.ConsensusParams(¶ms)}, } return block.Header, types.BlockID{Hash: block.Hash(), PartSetHeader: types.PartSetHeader{}}, abciResponses } @@ -252,9 +252,9 @@ func randomGenesisDoc() *types.GenesisDoc { type testApp struct { ocabci.BaseApplication - CommitVotes []ocabci.VoteInfo + CommitVotes []abci.VoteInfo ByzantineValidators []ocabci.Evidence - ValidatorUpdates []ocabci.ValidatorUpdate + ValidatorUpdates []abci.ValidatorUpdate } var _ ocabci.Application = (*testApp)(nil) @@ -270,8 +270,8 @@ func (app *testApp) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginB return abci.ResponseBeginBlock{} } -func (app *testApp) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { - return ocabci.ResponseEndBlock{ +func (app *testApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { + return abci.ResponseEndBlock{ ValidatorUpdates: app.ValidatorUpdates, ConsensusParamUpdates: &abci.ConsensusParams{ Version: &tmproto.VersionParams{ diff --git a/state/indexer/block/kv/kv_test.go b/state/indexer/block/kv/kv_test.go index 4fec2cf8a..5ce5634b4 100644 --- a/state/indexer/block/kv/kv_test.go +++ b/state/indexer/block/kv/kv_test.go @@ -9,7 +9,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/pubsub/query" blockidxkv "github.com/line/ostracon/state/indexer/block/kv" "github.com/line/ostracon/types" @@ -34,7 +33,7 @@ func TestBlockIndexer(t *testing.T) { }, }, }, - ResultEndBlock: ocabci.ResponseEndBlock{ + ResultEndBlock: abci.ResponseEndBlock{ Events: []abci.Event{ { Type: "end_event", @@ -72,7 +71,7 @@ func TestBlockIndexer(t *testing.T) { }, }, }, - ResultEndBlock: ocabci.ResponseEndBlock{ + ResultEndBlock: abci.ResponseEndBlock{ Events: []abci.Event{ { Type: "end_event", diff --git a/state/indexer/sink/psql/psql_test.go b/state/indexer/sink/psql/psql_test.go index 90d63c2e1..03792620f 100644 --- a/state/indexer/sink/psql/psql_test.go +++ b/state/indexer/sink/psql/psql_test.go @@ -214,7 +214,7 @@ func newTestBlockHeader() types.EventDataNewBlockHeader { makeIndexedEvent("thingy.whatzit", "O.O"), }, }, - ResultEndBlock: ocabci.ResponseEndBlock{ + ResultEndBlock: abci.ResponseEndBlock{ Events: []abci.Event{ makeIndexedEvent("end_event.foo", "100"), makeIndexedEvent("thingy.whatzit", "-.O"), diff --git a/state/state_test.go b/state/state_test.go index 46f7b0e25..9ffb71765 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -17,7 +17,6 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -113,7 +112,7 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { abciResponses.DeliverTxs[0] = &abci.ResponseDeliverTx{Data: []byte("foo"), Events: nil} abciResponses.DeliverTxs[1] = &abci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Events: nil} - abciResponses.EndBlock = &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{ + abciResponses.EndBlock = &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{ types.OC2PB.NewValidatorUpdate(ed25519.GenPrivKey().PubKey(), 10), }} @@ -192,7 +191,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { responses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.added, - EndBlock: &ocabci.ResponseEndBlock{}, + EndBlock: &abci.ResponseEndBlock{}, } err := stateStore.SaveABCIResponses(h, responses) require.NoError(t, err) @@ -207,7 +206,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { responses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.expected, - EndBlock: &ocabci.ResponseEndBlock{}, + EndBlock: &abci.ResponseEndBlock{}, } assert.Equal(sm.ABCIResponsesResultsHash(responses), sm.ABCIResponsesResultsHash(res), "%d", i) } @@ -493,7 +492,7 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -509,8 +508,8 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { fvp, err := cryptoenc.PubKeyToProto(val2PubKey) require.NoError(t, err) - updateAddVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: val2VotingPower} - validatorUpdates, err = types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{updateAddVal}) + updateAddVal := abci.ValidatorUpdate{PubKey: fvp, Power: val2VotingPower} + validatorUpdates, err = types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{updateAddVal}) assert.NoError(t, err) updatedState2, err := sm.UpdateState(updatedState, blockID, &block.Header, abciResponses, validatorUpdates) assert.NoError(t, err) @@ -545,8 +544,8 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { // Updating a validator does not reset the ProposerPriority to zero: // 1. Add - Val2 VotingPower change to 1 => updatedVotingPowVal2 := int64(1) - updateVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: updatedVotingPowVal2} - validatorUpdates, err = types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{updateVal}) + updateVal := abci.ValidatorUpdate{PubKey: fvp, Power: updatedVotingPowVal2} + validatorUpdates, err = types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{updateVal}) assert.NoError(t, err) // this will cause the diff of priorities (77) @@ -610,7 +609,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { // no updates: abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -628,8 +627,8 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { val2PubKey := ed25519.GenPrivKey().PubKey() fvp, err := cryptoenc.PubKeyToProto(val2PubKey) require.NoError(t, err) - updateAddVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: val1VotingPower} - validatorUpdates, err = types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{updateAddVal}) + updateAddVal := abci.ValidatorUpdate{PubKey: fvp, Power: val1VotingPower} + validatorUpdates, err = types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{updateAddVal}) assert.NoError(t, err) updatedState2, err := sm.UpdateState(updatedState, blockID, &block.Header, abciResponses, validatorUpdates) @@ -713,7 +712,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { oldState := updatedState3 abciResponses = &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -729,7 +728,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { // no validator updates: abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -788,7 +787,7 @@ func TestLargeGenesisValidator(t *testing.T) { // no updates: abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -816,12 +815,12 @@ func TestLargeGenesisValidator(t *testing.T) { firstAddedValVotingPower := int64(10) fvp, err := cryptoenc.PubKeyToProto(firstAddedValPubKey) require.NoError(t, err) - firstAddedVal := ocabci.ValidatorUpdate{PubKey: fvp, Power: firstAddedValVotingPower} - validatorUpdates, err := types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{firstAddedVal}) + firstAddedVal := abci.ValidatorUpdate{PubKey: fvp, Power: firstAddedValVotingPower} + validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{firstAddedVal}) assert.NoError(t, err) abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{firstAddedVal}}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{firstAddedVal}}, } block := makeBlock(oldState, oldState.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} @@ -833,7 +832,7 @@ func TestLargeGenesisValidator(t *testing.T) { // no updates: abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -863,13 +862,13 @@ func TestLargeGenesisValidator(t *testing.T) { addedPubKey := ed25519.GenPrivKey().PubKey() ap, err := cryptoenc.PubKeyToProto(addedPubKey) require.NoError(t, err) - addedVal := ocabci.ValidatorUpdate{PubKey: ap, Power: firstAddedValVotingPower} - validatorUpdates, err := types.PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{addedVal}) + addedVal := abci.ValidatorUpdate{PubKey: ap, Power: firstAddedValVotingPower} + validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{addedVal}) assert.NoError(t, err) abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{addedVal}}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{addedVal}}, } block := makeBlock(oldState, oldState.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} @@ -881,10 +880,10 @@ func TestLargeGenesisValidator(t *testing.T) { // remove genesis validator: gp, err := cryptoenc.PubKeyToProto(genesisPubKey) require.NoError(t, err) - removeGenesisVal := ocabci.ValidatorUpdate{PubKey: gp, Power: 0} + removeGenesisVal := abci.ValidatorUpdate{PubKey: gp, Power: 0} abciResponses = &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: []ocabci.ValidatorUpdate{removeGenesisVal}}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{removeGenesisVal}}, } block = makeBlock(oldState, oldState.LastBlockHeight+1) blockID = types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} @@ -903,7 +902,7 @@ func TestLargeGenesisValidator(t *testing.T) { for isProposerUnchanged { abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err = types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) @@ -928,7 +927,7 @@ func TestLargeGenesisValidator(t *testing.T) { // no updates: abciResponses := &ocstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, - EndBlock: &ocabci.ResponseEndBlock{ValidatorUpdates: nil}, + EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } validatorUpdates, err := types.PB2OC.ValidatorUpdates(abciResponses.EndBlock.ValidatorUpdates) require.NoError(t, err) diff --git a/state/store.go b/state/store.go index 3d907ac3c..1a8f9ae64 100644 --- a/state/store.go +++ b/state/store.go @@ -493,7 +493,7 @@ func lastStoredHeightFor(height, lastHeightChanged int64) int64 { } // CONTRACT: Returned ValidatorsInfo can be mutated. -func loadValidatorsInfo(db dbm.DB, height int64) (*ocstate.ValidatorsInfo, error) { +func loadValidatorsInfo(db dbm.DB, height int64) (*tmstate.ValidatorsInfo, error) { buf, err := db.Get(calcValidatorsKey(height)) if err != nil { return nil, err @@ -503,7 +503,7 @@ func loadValidatorsInfo(db dbm.DB, height int64) (*ocstate.ValidatorsInfo, error return nil, errors.New("loadValidatorsInfo: value retrieved from db is empty") } - v := new(ocstate.ValidatorsInfo) + v := new(tmstate.ValidatorsInfo) err = v.Unmarshal(buf) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED @@ -524,7 +524,7 @@ func (store dbStore) saveValidatorsInfo(height, lastHeightChanged int64, valSet if lastHeightChanged > height { return errors.New("lastHeightChanged cannot be greater than ValidatorsInfo height") } - valInfo := &ocstate.ValidatorsInfo{ + valInfo := &tmstate.ValidatorsInfo{ LastHeightChanged: lastHeightChanged, } // Only persist validator set if it was updated or checkpoint height (see diff --git a/state/store_test.go b/state/store_test.go index 3e19e2868..49b6d571e 100644 --- a/state/store_test.go +++ b/state/store_test.go @@ -14,7 +14,6 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - ocabci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -294,7 +293,7 @@ func TestABCIResponsesResultsHash(t *testing.T) { DeliverTxs: []*abci.ResponseDeliverTx{ {Code: 32, Data: []byte("Hello"), Log: "Huh?"}, }, - EndBlock: &ocabci.ResponseEndBlock{}, + EndBlock: &abci.ResponseEndBlock{}, } root := sm.ABCIResponsesResultsHash(responses) @@ -319,7 +318,7 @@ func sliceToMap(s []int64) map[int64]bool { } func validatorsInfoToByte(height, lastHeightChanged int64, valSet *types.ValidatorSet) ([]byte, error) { - valInfo := &ocstate.ValidatorsInfo{ + valInfo := &tmstate.ValidatorsInfo{ LastHeightChanged: lastHeightChanged, } if height == lastHeightChanged || height%valSetCheckpointInterval == 0 { diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index b3cb81aa8..7222c4201 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -121,7 +121,7 @@ func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo { } // Info implements ABCI. -func (app *Application) InitChain(req ocabci.RequestInitChain) ocabci.ResponseInitChain { +func (app *Application) InitChain(req abci.RequestInitChain) ocabci.ResponseInitChain { var err error app.state.initialHeight = uint64(req.InitialHeight) if len(req.AppStateBytes) > 0 { @@ -167,13 +167,13 @@ func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDelive } // EndBlock implements ABCI. -func (app *Application) EndBlock(req abci.RequestEndBlock) ocabci.ResponseEndBlock { +func (app *Application) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { valUpdates, err := app.validatorUpdates(uint64(req.Height)) if err != nil { panic(err) } - return ocabci.ResponseEndBlock{ + return abci.ResponseEndBlock{ ValidatorUpdates: valUpdates, Events: []abci.Event{ { @@ -279,13 +279,13 @@ func (app *Application) Rollback() error { } // validatorUpdates generates a validator set update. -func (app *Application) validatorUpdates(height uint64) (ocabci.ValidatorUpdates, error) { +func (app *Application) validatorUpdates(height uint64) (abci.ValidatorUpdates, error) { updates := app.cfg.ValidatorUpdates[fmt.Sprintf("%v", height)] if len(updates) == 0 { return nil, nil } - valUpdates := ocabci.ValidatorUpdates{} + valUpdates := abci.ValidatorUpdates{} for keyString, power := range updates { keyBytes, err := base64.StdEncoding.DecodeString(keyString) diff --git a/types/event_bus_test.go b/types/event_bus_test.go index da3b69203..baa257a23 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -12,7 +12,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" - ocabci "github.com/line/ostracon/abci/types" tmpubsub "github.com/line/ostracon/libs/pubsub" tmquery "github.com/line/ostracon/libs/pubsub/query" tmrand "github.com/line/ostracon/libs/rand" @@ -83,7 +82,7 @@ func TestEventBusPublishEventNewBlock(t *testing.T) { {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } - resultEndBlock := ocabci.ResponseEndBlock{ + resultEndBlock := abci.ResponseEndBlock{ Events: []abci.Event{ {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, }, @@ -242,7 +241,7 @@ func TestEventBusPublishEventNewBlockHeader(t *testing.T) { {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}}, }, } - resultEndBlock := ocabci.ResponseEndBlock{ + resultEndBlock := abci.ResponseEndBlock{ Events: []abci.Event{ {Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}}, }, diff --git a/types/events.go b/types/events.go index d99e9e96b..6cf1885af 100644 --- a/types/events.go +++ b/types/events.go @@ -5,7 +5,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" - ocabci "github.com/line/ostracon/abci/types" tmjson "github.com/line/ostracon/libs/json" tmpubsub "github.com/line/ostracon/libs/pubsub" tmquery "github.com/line/ostracon/libs/pubsub/query" @@ -67,7 +66,7 @@ type EventDataNewBlock struct { Block *Block `json:"block"` ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` - ResultEndBlock ocabci.ResponseEndBlock `json:"result_end_block"` + ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` } type EventDataNewBlockHeader struct { @@ -75,7 +74,7 @@ type EventDataNewBlockHeader struct { NumTxs int64 `json:"num_txs"` // Number of txs in a block ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` - ResultEndBlock ocabci.ResponseEndBlock `json:"result_end_block"` + ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` } type EventDataNewEvidence struct { diff --git a/types/evidence.go b/types/evidence.go index 00b706596..aa965dfea 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -95,7 +95,7 @@ func NewDuplicateVoteEvidence(vote1, vote2 *Vote, blockTime time.Time, valSet *V func (dve *DuplicateVoteEvidence) ABCI() []ocabci.Evidence { return []ocabci.Evidence{{ Type: abci.EvidenceType_DUPLICATE_VOTE, - Validator: ocabci.Validator{ + Validator: abci.Validator{ Address: dve.VoteA.ValidatorAddress, Power: dve.ValidatorPower, }, diff --git a/types/protobuf.go b/types/protobuf.go index 41dc562eb..8ab4b371b 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -4,7 +4,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -62,8 +61,8 @@ func (oc2pb) Header(header *Header) ocproto.Header { } } -func (oc2pb) Validator(val *Validator) ocabci.Validator { - return ocabci.Validator{ +func (oc2pb) Validator(val *Validator) abci.Validator { + return abci.Validator{ Address: val.PubKey.Address(), Power: val.VotingPower, } @@ -84,20 +83,20 @@ func (oc2pb) PartSetHeader(header PartSetHeader) tmproto.PartSetHeader { } // XXX: panics on unknown pubkey type -func (oc2pb) ValidatorUpdate(val *Validator) ocabci.ValidatorUpdate { +func (oc2pb) ValidatorUpdate(val *Validator) abci.ValidatorUpdate { pk, err := cryptoenc.PubKeyToProto(val.PubKey) if err != nil { panic(err) } - return ocabci.ValidatorUpdate{ + return abci.ValidatorUpdate{ PubKey: pk, Power: val.VotingPower, } } // XXX: panics on nil or unknown pubkey type -func (oc2pb) ValidatorUpdates(vals *ValidatorSet) []ocabci.ValidatorUpdate { - validators := make([]ocabci.ValidatorUpdate, vals.Size()) +func (oc2pb) ValidatorUpdates(vals *ValidatorSet) []abci.ValidatorUpdate { + validators := make([]abci.ValidatorUpdate, vals.Size()) for i, val := range vals.Validators { validators[i] = OC2PB.ValidatorUpdate(val) } @@ -116,12 +115,12 @@ func (oc2pb) ConsensusParams(params *tmproto.ConsensusParams) *abci.ConsensusPar } // XXX: panics on nil or unknown pubkey type -func (oc2pb) NewValidatorUpdate(pubkey crypto.PubKey, power int64) ocabci.ValidatorUpdate { +func (oc2pb) NewValidatorUpdate(pubkey crypto.PubKey, power int64) abci.ValidatorUpdate { pubkeyABCI, err := cryptoenc.PubKeyToProto(pubkey) if err != nil { panic(err) } - return ocabci.ValidatorUpdate{ + return abci.ValidatorUpdate{ PubKey: pubkeyABCI, Power: power, } @@ -135,7 +134,7 @@ var PB2OC = pb2tm{} type pb2tm struct{} -func (pb2tm) ValidatorUpdates(vals []ocabci.ValidatorUpdate) ([]*Validator, error) { +func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error) { tmVals := make([]*Validator, len(vals)) for i, v := range vals { pub, err := cryptoenc.PubKeyFromProto(&v.PubKey) diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 395d4e7be..6fd798c72 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tendermint/go-amino" + abci "github.com/tendermint/tendermint/abci/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -44,18 +44,18 @@ func TestABCIValidators(t *testing.T) { tmVal := NewValidator(pkEd, 10) abciVal := OC2PB.ValidatorUpdate(tmVal) - tmVals, err := PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{abciVal}) + tmVals, err := PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) abciVals := OC2PB.ValidatorUpdates(NewValidatorSet(tmVals)) - assert.Equal(t, []ocabci.ValidatorUpdate{abciVal}, abciVals) + assert.Equal(t, []abci.ValidatorUpdate{abciVal}, abciVals) // val with address tmVal.Address = pkEd.Address() abciVal = OC2PB.ValidatorUpdate(tmVal) - tmVals, err = PB2OC.ValidatorUpdates([]ocabci.ValidatorUpdate{abciVal}) + tmVals, err = PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) } @@ -169,7 +169,7 @@ func TestABCIValidatorWithoutPubKey(t *testing.T) { abciVal := OC2PB.Validator(NewValidator(pkEd, 10)) // pubkey must be nil - tmValExpected := ocabci.Validator{ + tmValExpected := abci.Validator{ Address: pkEd.Address(), Power: 10, } From faf381161a953d49cb00073d9b1522f511a43c73 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 25 Jan 2023 17:18:39 +0900 Subject: [PATCH 16/25] feat!: replace `privval/types.proto` and `types/types.proto` to Tendermint proto. - privval.PubKeyResponse - types.Commit --- privval/msgs.go | 2 +- privval/msgs_test.go | 5 +- privval/signer_client_test.go | 6 +- privval/signer_requestHandler.go | 6 +- proto/ostracon/abci/types.proto | 10 +- proto/ostracon/privval/types.pb.go | 320 +++------------------- proto/ostracon/privval/types.proto | 10 +- proto/ostracon/types/block.pb.go | 30 +-- proto/ostracon/types/block.proto | 2 +- proto/ostracon/types/types.pb.go | 416 ++++------------------------- proto/ostracon/types/types.proto | 14 +- store/store.go | 17 +- types/block.go | 6 +- 13 files changed, 150 insertions(+), 694 deletions(-) diff --git a/privval/msgs.go b/privval/msgs.go index 3e2a0024a..d124d0153 100644 --- a/privval/msgs.go +++ b/privval/msgs.go @@ -20,7 +20,7 @@ func mustWrapMsg(pb proto.Message) privvalproto.Message { msg = *pb case *tmprivvalproto.PubKeyRequest: msg.Sum = &privvalproto.Message_PubKeyRequest{PubKeyRequest: pb} - case *privvalproto.PubKeyResponse: + case *tmprivvalproto.PubKeyResponse: msg.Sum = &privvalproto.Message_PubKeyResponse{PubKeyResponse: pb} case *tmprivvalproto.SignVoteRequest: msg.Sum = &privvalproto.Message_SignVoteRequest{SignVoteRequest: pb} diff --git a/privval/msgs_test.go b/privval/msgs_test.go index 75794c7b4..240843ada 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -16,7 +16,6 @@ import ( "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/tmhash" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) @@ -84,8 +83,8 @@ func TestPrivvalVectors(t *testing.T) { {"ping request", &tmprivvalproto.PingRequest{}, "3a00"}, {"ping response", &tmprivvalproto.PingResponse{}, "4200"}, {"pubKey request", &tmprivvalproto.PubKeyRequest{}, "0a00"}, - {"pubKey response", &privvalproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, - {"pubKey response with error", &privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, + {"pubKey response", &tmprivvalproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, + {"pubKey response with error", &tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, {"Vote Request", &tmprivvalproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, {"Vote Response", &tmprivvalproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, {"Vote Response with error", &tmprivvalproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, diff --git a/privval/signer_client_test.go b/privval/signer_client_test.go index 9a155db1e..cdc4edc19 100644 --- a/privval/signer_client_test.go +++ b/privval/signer_client_test.go @@ -417,11 +417,11 @@ func brokenHandler(privVal types.PrivValidator, request privvalproto.Message, switch r := request.Sum.(type) { // This is broken and will answer most requests with a pubkey response case *privvalproto.Message_PubKeyRequest: - res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) + res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) case *privvalproto.Message_SignVoteRequest: - res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) + res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) case *privvalproto.Message_SignProposalRequest: - res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) + res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) case *privvalproto.Message_PingRequest: err, res = nil, mustWrapMsg(&tmprivvalproto.PingResponse{}) default: diff --git a/privval/signer_requestHandler.go b/privval/signer_requestHandler.go index dcb55219f..d65b5bf6f 100644 --- a/privval/signer_requestHandler.go +++ b/privval/signer_requestHandler.go @@ -26,7 +26,7 @@ func DefaultValidationRequestHandler( switch r := req.Sum.(type) { case *privvalproto.Message_PubKeyRequest: if r.PubKeyRequest.GetChainId() != chainID { - res = mustWrapMsg(&privvalproto.PubKeyResponse{ + res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{ PubKey: cryptoproto.PublicKey{}, Error: &tmprivvalproto.RemoteSignerError{ Code: 0, Description: "unable to provide pubkey"}}) return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.PubKeyRequest.GetChainId(), chainID) @@ -43,10 +43,10 @@ func DefaultValidationRequestHandler( } if err != nil { - res = mustWrapMsg(&privvalproto.PubKeyResponse{ + res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{ PubKey: cryptoproto.PublicKey{}, Error: &tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) } else { - res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: pk, Error: nil}) + res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: pk, Error: nil}) } case *privvalproto.Message_SignVoteRequest: diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index a9f3e61d5..bfa83303e 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -191,11 +191,11 @@ message Response { // string info = 4; //} -message ResponseInitChain { - tendermint.abci.ConsensusParams consensus_params = 1; - repeated tendermint.abci.ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; - bytes app_hash = 3; -} +//message ResponseInitChain { +// tendermint.abci.ConsensusParams consensus_params = 1; +// repeated tendermint.abci.ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; +// bytes app_hash = 3; +//} //message ResponseQuery { // uint32 code = 1; diff --git a/proto/ostracon/privval/types.pb.go b/proto/ostracon/privval/types.pb.go index 8a136e4d0..15a20e776 100644 --- a/proto/ostracon/privval/types.pb.go +++ b/proto/ostracon/privval/types.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + _ "github.com/tendermint/tendermint/proto/tendermint/crypto" privval "github.com/tendermint/tendermint/proto/tendermint/privval" _ "github.com/tendermint/tendermint/proto/tendermint/types" io "io" @@ -26,59 +26,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// PubKeyResponse is a response message containing the public key. -type PubKeyResponse struct { - PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Error *privval.RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *PubKeyResponse) Reset() { *m = PubKeyResponse{} } -func (m *PubKeyResponse) String() string { return proto.CompactTextString(m) } -func (*PubKeyResponse) ProtoMessage() {} -func (*PubKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{0} -} -func (m *PubKeyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKeyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PubKeyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKeyResponse.Merge(m, src) -} -func (m *PubKeyResponse) XXX_Size() int { - return m.Size() -} -func (m *PubKeyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PubKeyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKeyResponse proto.InternalMessageInfo - -func (m *PubKeyResponse) GetPubKey() crypto.PublicKey { - if m != nil { - return m.PubKey - } - return crypto.PublicKey{} -} - -func (m *PubKeyResponse) GetError() *privval.RemoteSignerError { - if m != nil { - return m.Error - } - return nil -} - // VRFProofRequest is a PrivValidatorSocket message containing a message to generate proof. type VRFProofRequest struct { Message []byte `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` @@ -88,7 +35,7 @@ func (m *VRFProofRequest) Reset() { *m = VRFProofRequest{} } func (m *VRFProofRequest) String() string { return proto.CompactTextString(m) } func (*VRFProofRequest) ProtoMessage() {} func (*VRFProofRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{1} + return fileDescriptor_abbbbe5131a55005, []int{0} } func (m *VRFProofRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,7 +81,7 @@ func (m *VRFProofResponse) Reset() { *m = VRFProofResponse{} } func (m *VRFProofResponse) String() string { return proto.CompactTextString(m) } func (*VRFProofResponse) ProtoMessage() {} func (*VRFProofResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{2} + return fileDescriptor_abbbbe5131a55005, []int{1} } func (m *VRFProofResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -196,7 +143,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_abbbbe5131a55005, []int{3} + return fileDescriptor_abbbbe5131a55005, []int{2} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -235,7 +182,7 @@ type Message_PubKeyRequest struct { PubKeyRequest *privval.PubKeyRequest `protobuf:"bytes,1,opt,name=pub_key_request,json=pubKeyRequest,proto3,oneof" json:"pub_key_request,omitempty"` } type Message_PubKeyResponse struct { - PubKeyResponse *PubKeyResponse `protobuf:"bytes,2,opt,name=pub_key_response,json=pubKeyResponse,proto3,oneof" json:"pub_key_response,omitempty"` + PubKeyResponse *privval.PubKeyResponse `protobuf:"bytes,2,opt,name=pub_key_response,json=pubKeyResponse,proto3,oneof" json:"pub_key_response,omitempty"` } type Message_SignVoteRequest struct { SignVoteRequest *privval.SignVoteRequest `protobuf:"bytes,3,opt,name=sign_vote_request,json=signVoteRequest,proto3,oneof" json:"sign_vote_request,omitempty"` @@ -287,7 +234,7 @@ func (m *Message) GetPubKeyRequest() *privval.PubKeyRequest { return nil } -func (m *Message) GetPubKeyResponse() *PubKeyResponse { +func (m *Message) GetPubKeyResponse() *privval.PubKeyResponse { if x, ok := m.GetSum().(*Message_PubKeyResponse); ok { return x.PubKeyResponse } @@ -367,7 +314,6 @@ func (*Message) XXX_OneofWrappers() []interface{} { } func init() { - proto.RegisterType((*PubKeyResponse)(nil), "ostracon.privval.PubKeyResponse") proto.RegisterType((*VRFProofRequest)(nil), "ostracon.privval.VRFProofRequest") proto.RegisterType((*VRFProofResponse)(nil), "ostracon.privval.VRFProofResponse") proto.RegisterType((*Message)(nil), "ostracon.privval.Message") @@ -376,89 +322,41 @@ func init() { func init() { proto.RegisterFile("ostracon/privval/types.proto", fileDescriptor_abbbbe5131a55005) } var fileDescriptor_abbbbe5131a55005 = []byte{ - // 578 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0xc7, 0xed, 0xaf, 0x4d, 0xf2, 0xe9, 0x34, 0x6d, 0xd2, 0x21, 0xa0, 0x28, 0x8a, 0xdc, 0x12, - 0xc4, 0x45, 0x20, 0xd9, 0x12, 0x2c, 0xbb, 0x8b, 0xb8, 0x14, 0x05, 0xa4, 0xe0, 0x4a, 0x5d, 0x54, - 0x42, 0x51, 0x2e, 0x27, 0xc6, 0x6a, 0xe2, 0x19, 0x66, 0xc6, 0x91, 0xfc, 0x0a, 0xac, 0x78, 0xac, - 0x2e, 0xbb, 0x83, 0x15, 0x42, 0xc9, 0x06, 0xde, 0x02, 0x79, 0x3c, 0xb1, 0x9d, 0x1b, 0x1b, 0x76, - 0x9e, 0xff, 0x9c, 0xf9, 0xcd, 0xcf, 0xe3, 0xe3, 0x81, 0x26, 0x15, 0x92, 0xf7, 0x87, 0x34, 0x70, - 0x18, 0xf7, 0x67, 0xb3, 0xfe, 0xc4, 0x91, 0x11, 0x43, 0x61, 0x33, 0x4e, 0x25, 0x25, 0xd5, 0xe5, - 0xac, 0xad, 0x67, 0x1b, 0x4d, 0x89, 0xc1, 0x08,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xb5, 0x7f, 0x2d, 0xee, 0x81, 0x19, 0x1f, 0xaf, 0xfc, 0x7e, 0x17, 0x40, 0xf2, - 0x44, 0xed, 0xf7, 0x3b, 0x41, 0xb6, 0xfe, 0x86, 0x4c, 0x15, 0xab, 0x19, 0x33, 0xc9, 0xda, 0x05, - 0xd8, 0x13, 0xe1, 0xb4, 0xfd, 0xf6, 0x66, 0x6e, 0x99, 0xb7, 0x73, 0xcb, 0xfc, 0x39, 0xb7, 0xcc, - 0xaf, 0x0b, 0xcb, 0xb8, 0x5d, 0x58, 0xc6, 0xf7, 0x85, 0x65, 0x5c, 0x39, 0x9e, 0x2f, 0x3f, 0x85, - 0x03, 0x7b, 0x48, 0xa7, 0xce, 0xc4, 0x0f, 0xd0, 0xc9, 0x5d, 0xa3, 0xf1, 0xed, 0xb7, 0x7e, 0xab, - 0x0e, 0x8a, 0x2a, 0x7f, 0xf1, 0x27, 0x00, 0x00, 0xff, 0xff, 0x40, 0x6c, 0x4e, 0xf2, 0x70, 0x05, - 0x00, 0x00, -} - -func (m *PubKeyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + // 534 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0x4d, 0x6f, 0xd3, 0x30, + 0x18, 0xc7, 0x13, 0x46, 0x1b, 0xe4, 0x76, 0xb4, 0x33, 0x05, 0x55, 0xd5, 0x14, 0x4a, 0x11, 0x30, + 0x81, 0x94, 0x48, 0xe3, 0xc8, 0x6d, 0xe2, 0x65, 0x68, 0x02, 0x95, 0x4c, 0xda, 0x61, 0x12, 0xaa, + 0xfa, 0xf2, 0x34, 0x44, 0x6b, 0x62, 0x63, 0x3b, 0x91, 0xf2, 0x2d, 0xf8, 0x58, 0x1c, 0x77, 0x84, + 0x1b, 0x6a, 0x2f, 0xf0, 0x2d, 0x50, 0x1c, 0x37, 0x4e, 0xbb, 0x74, 0xb7, 0xf8, 0xef, 0xc7, 0xbf, + 0xe7, 0x67, 0xc5, 0x36, 0x3a, 0x24, 0x5c, 0xb0, 0xf1, 0x94, 0x44, 0x2e, 0x65, 0x41, 0x92, 0x8c, + 0x17, 0xae, 0x48, 0x29, 0x70, 0x87, 0x32, 0x22, 0x08, 0x6e, 0xaf, 0x67, 0x1d, 0x35, 0xdb, 0x3b, + 0x14, 0x10, 0xcd, 0x80, 0x85, 0x41, 0x24, 0xdc, 0x29, 0x4b, 0xa9, 0x20, 0xee, 0x15, 0xa4, 0xaa, + 0xbe, 0xd7, 0xf1, 0x89, 0x4f, 0xe4, 0xa7, 0x9b, 0x7d, 0xa9, 0xb4, 0xbc, 0x46, 0xd2, 0xcb, 0x3d, + 0x7a, 0x76, 0x69, 0xb6, 0xc2, 0x61, 0xf0, 0x0a, 0xb5, 0x2e, 0xbc, 0xf7, 0x43, 0x46, 0xc8, 0xdc, + 0x83, 0xef, 0x31, 0x70, 0x81, 0xbb, 0xc8, 0x0a, 0x81, 0xf3, 0xb1, 0x0f, 0x5d, 0xb3, 0x6f, 0x1e, + 0x35, 0xbd, 0xf5, 0x70, 0x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x73, 0xd4, 0x55, 0xea, 0xa5, 0x06, + 0x4a, 0xbf, 0x2e, 0x3b, 0xbc, 0xdc, 0xad, 0xaf, 0x61, 0xc5, 0x16, 0x1e, 0xf1, 0xca, 0x19, 0xfc, + 0x16, 0x35, 0x69, 0x10, 0xf9, 0x85, 0xbd, 0x25, 0xd9, 0x8f, 0x2b, 0xff, 0x60, 0x10, 0xf9, 0xda, + 0xba, 0x41, 0xf5, 0x10, 0x7f, 0x40, 0xfb, 0x8a, 0xa2, 0x14, 0xef, 0x49, 0x4c, 0x7f, 0x37, 0xa6, + 0x10, 0x6b, 0xd2, 0xd2, 0x18, 0x0f, 0xd1, 0x41, 0xc2, 0xe6, 0x23, 0x79, 0xee, 0x0b, 0xa7, 0xbf, + 0x96, 0x3a, 0xa4, 0xdb, 0x57, 0xdc, 0xd9, 0xba, 0x6d, 0xd9, 0x19, 0x48, 0xd8, 0x7c, 0xe3, 0x02, + 0x9e, 0x23, 0x5c, 0x26, 0x2a, 0xbf, 0x7f, 0x96, 0x3a, 0xa9, 0xb7, 0x20, 0x0b, 0xc5, 0xb6, 0x66, + 0xe6, 0xd9, 0x49, 0x0d, 0xed, 0xf1, 0x38, 0x3c, 0xf9, 0xf8, 0x73, 0x69, 0x9b, 0xd7, 0x4b, 0xdb, + 0xfc, 0xb3, 0xb4, 0xcd, 0x1f, 0x2b, 0xdb, 0xb8, 0x5e, 0xd9, 0xc6, 0xaf, 0x95, 0x6d, 0x5c, 0xba, + 0x7e, 0x20, 0xbe, 0xc5, 0x13, 0x67, 0x4a, 0x42, 0x77, 0x11, 0x44, 0xe0, 0x96, 0xde, 0xae, 0xec, + 0xc9, 0xd9, 0x7e, 0xca, 0x26, 0x75, 0x99, 0xbf, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x56, + 0xe1, 0x85, 0xe5, 0x04, 0x00, 0x00, } func (m *VRFProofRequest) Marshal() (dAtA []byte, err error) { @@ -790,21 +688,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *PubKeyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PubKey.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func (m *VRFProofRequest) Size() (n int) { if m == nil { return 0 @@ -974,125 +857,6 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *PubKeyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PubKeyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &privval.RemoteSignerError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *VRFProofRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1390,7 +1154,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &PubKeyResponse{} + v := &privval.PubKeyResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ostracon/privval/types.proto b/proto/ostracon/privval/types.proto index 5279faae2..7543be558 100644 --- a/proto/ostracon/privval/types.proto +++ b/proto/ostracon/privval/types.proto @@ -28,10 +28,10 @@ option go_package = "github.com/line/ostracon/proto/ostracon/privval"; //} // PubKeyResponse is a response message containing the public key. -message PubKeyResponse { - tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; - tendermint.privval.RemoteSignerError error = 2; -} +//message PubKeyResponse { +// tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; +// tendermint.privval.RemoteSignerError error = 2; +//} // SignVoteRequest is a request to sign a vote //message SignVoteRequest { @@ -77,7 +77,7 @@ message VRFProofResponse { message Message { oneof sum { tendermint.privval.PubKeyRequest pub_key_request = 1; - PubKeyResponse pub_key_response = 2; + tendermint.privval.PubKeyResponse pub_key_response = 2; tendermint.privval.SignVoteRequest sign_vote_request = 3; tendermint.privval.SignedVoteResponse signed_vote_response = 4; tendermint.privval.SignProposalRequest sign_proposal_request = 5; diff --git a/proto/ostracon/types/block.pb.go b/proto/ostracon/types/block.pb.go index 83a7ee556..5e95ab7f5 100644 --- a/proto/ostracon/types/block.pb.go +++ b/proto/ostracon/types/block.pb.go @@ -25,10 +25,10 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Block struct { - Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` - Data types.Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` - Evidence EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` - LastCommit *Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` + Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` + Data types.Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` + Evidence EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` + LastCommit *types.Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` } func (m *Block) Reset() { *m = Block{} } @@ -85,7 +85,7 @@ func (m *Block) GetEvidence() EvidenceList { return EvidenceList{} } -func (m *Block) GetLastCommit() *Commit { +func (m *Block) GetLastCommit() *types.Commit { if m != nil { return m.LastCommit } @@ -99,25 +99,25 @@ func init() { func init() { proto.RegisterFile("ostracon/types/block.proto", fileDescriptor_69510200dee501a6) } var fileDescriptor_69510200dee501a6 = []byte{ - // 281 bytes of a gzipped FileDescriptorProto + // 284 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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b, 0xd5, 0x87, 0x87, 0x29, 0x24, 0x2a, 0x50, 0x83, 0x38, 0x89, 0x0d, 0x2c, 0x6a, 0x0c, 0x08, + 0x00, 0x00, 0xff, 0xff, 0x8f, 0xa6, 0x62, 0x99, 0xd9, 0x01, 0x00, 0x00, } func (m *Block) Marshal() (dAtA []byte, err error) { @@ -379,7 +379,7 @@ func (m *Block) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.LastCommit == nil { - m.LastCommit = &Commit{} + m.LastCommit = &types.Commit{} } if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/proto/ostracon/types/block.proto b/proto/ostracon/types/block.proto index 107c3213c..c60f0488c 100644 --- a/proto/ostracon/types/block.proto +++ b/proto/ostracon/types/block.proto @@ -12,5 +12,5 @@ message Block { Header header = 1 [(gogoproto.nullable) = false]; tendermint.types.Data data = 2 [(gogoproto.nullable) = false]; ostracon.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; - Commit last_commit = 4; + tendermint.types.Commit last_commit = 4; } diff --git a/proto/ostracon/types/types.pb.go b/proto/ostracon/types/types.pb.go index 8988738e8..b2a51890c 100644 --- a/proto/ostracon/types/types.pb.go +++ b/proto/ostracon/types/types.pb.go @@ -201,85 +201,16 @@ func (m *Header) GetProof() []byte { return nil } -// Commit contains the evidence that a block was committed by a set of validators. -type Commit struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - BlockID types1.BlockID `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Signatures []types1.CommitSig `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures"` -} - -func (m *Commit) Reset() { *m = Commit{} } -func (m *Commit) String() string { return proto.CompactTextString(m) } -func (*Commit) ProtoMessage() {} -func (*Commit) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{1} -} -func (m *Commit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Commit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Commit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Commit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Commit.Merge(m, src) -} -func (m *Commit) XXX_Size() int { - return m.Size() -} -func (m *Commit) XXX_DiscardUnknown() { - xxx_messageInfo_Commit.DiscardUnknown(m) -} - -var xxx_messageInfo_Commit proto.InternalMessageInfo - -func (m *Commit) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Commit) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *Commit) GetBlockID() types1.BlockID { - if m != nil { - return m.BlockID - } - return types1.BlockID{} -} - -func (m *Commit) GetSignatures() []types1.CommitSig { - if m != nil { - return m.Signatures - } - return nil -} - type SignedHeader struct { - Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Commit *types1.Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` } func (m *SignedHeader) Reset() { *m = SignedHeader{} } func (m *SignedHeader) String() string { return proto.CompactTextString(m) } func (*SignedHeader) ProtoMessage() {} func (*SignedHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{2} + return fileDescriptor_0e52e849a4baef8c, []int{1} } func (m *SignedHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -315,7 +246,7 @@ func (m *SignedHeader) GetHeader() *Header { return nil } -func (m *SignedHeader) GetCommit() *Commit { +func (m *SignedHeader) GetCommit() *types1.Commit { if m != nil { return m.Commit } @@ -331,7 +262,7 @@ func (m *LightBlock) Reset() { *m = LightBlock{} } func (m *LightBlock) String() string { return proto.CompactTextString(m) } func (*LightBlock) ProtoMessage() {} func (*LightBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{3} + return fileDescriptor_0e52e849a4baef8c, []int{2} } func (m *LightBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -385,7 +316,7 @@ func (m *BlockMeta) Reset() { *m = BlockMeta{} } func (m *BlockMeta) String() string { return proto.CompactTextString(m) } func (*BlockMeta) ProtoMessage() {} func (*BlockMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_0e52e849a4baef8c, []int{4} + return fileDescriptor_0e52e849a4baef8c, []int{3} } func (m *BlockMeta) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -444,7 +375,6 @@ func (m *BlockMeta) GetNumTxs() int64 { func init() { proto.RegisterType((*Header)(nil), "ostracon.types.Header") - proto.RegisterType((*Commit)(nil), "ostracon.types.Commit") proto.RegisterType((*SignedHeader)(nil), "ostracon.types.SignedHeader") proto.RegisterType((*LightBlock)(nil), "ostracon.types.LightBlock") proto.RegisterType((*BlockMeta)(nil), "ostracon.types.BlockMeta") @@ -453,56 +383,53 @@ func init() { func init() { proto.RegisterFile("ostracon/types/types.proto", fileDescriptor_0e52e849a4baef8c) } var fileDescriptor_0e52e849a4baef8c = []byte{ - // 777 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0xc7, 0xe3, 0xe6, 0x7b, 0xf2, 0xd1, 0x5e, 0xab, 0xb7, 0xd7, 0x4d, 0x5b, 0x27, 0xca, 0xd5, - 0xbd, 0x04, 0x24, 0x1c, 0x54, 0x58, 0xb0, 0x61, 0xd1, 0xa4, 0x88, 0x56, 0x82, 0x8d, 0x53, 0xb1, - 0x60, 0x63, 0x4d, 0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x80, 0x3f, 0xe1, 0x65, 0x71, 0x5b, 0x51, 0xdd, 0x2b, - 0x0d, 0x80, 0xb7, 0xdc, 0x19, 0x71, 0x18, 0xfd, 0x00, 0x34, 0xa8, 0x28, 0xef, 0x2c, 0x55, 0xdd, - 0x7d, 0x98, 0x25, 0xdb, 0xa3, 0x5d, 0xa7, 0xd9, 0x8e, 0x87, 0xa0, 0xb1, 0x98, 0x4e, 0x87, 0xa2, - 0xb4, 0x11, 0x73, 0xd5, 0x87, 0xc5, 0xa4, 0x8e, 0x10, 0xb3, 0xeb, 0xb3, 0xcc, 0x8a, 0xdf, 0x64, - 0x55, 0x74, 0xf4, 0x0e, 0x31, 0xb8, 0x74, 0x3d, 0xda, 0x9f, 0x5f, 0xcf, 0x1e, 0x00, 0x32, 0x0d, - 0xc5, 0x17, 0x48, 0xb4, 0x95, 0xb7, 0xab, 0x42, 0x19, 0xe1, 0x0b, 0xa4, 0xbf, 0x58, 0x58, 0x9d, - 0xff, 0x95, 0xd5, 0xea, 0xd2, 0x52, 0xc3, 0xff, 0x01, 0xe5, 0x30, 0x09, 0x1c, 0x76, 0x46, 0xc5, - 0x3b, 0x28, 0x6f, 0x97, 0xc2, 0x24, 0x38, 0x39, 0xa3, 0x83, 0x37, 0xd7, 0x73, 0x53, 0xbb, 0x99, - 0x9b, 0xda, 0xd7, 0xb9, 0xa9, 0x5d, 0xde, 0x99, 0xb9, 0x9b, 0x3b, 0x33, 0xf7, 0xf9, 0xce, 0xcc, - 0x7d, 0x78, 0xea, 0x63, 0x36, 0x49, 0xc6, 0x96, 0x4b, 0x82, 0xfe, 0x14, 0x87, 0xa8, 0xbf, 0xf8, - 0x5e, 0xc8, 0x0f, 0xc1, 0xf2, 0xe7, 0x63, 0x5c, 0x12, 0xea, 0xf3, 0x1f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xd3, 0x75, 0x80, 0x28, 0x57, 0x06, 0x00, 0x00, + // 729 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8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, } func (m *Header) Marshal() (dAtA []byte, err error) { @@ -647,63 +574,6 @@ func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Commit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Commit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *SignedHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -927,29 +797,6 @@ func (m *Header) Size() (n int) { return n } -func (m *Commit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - if len(m.Signatures) > 0 { - for _, e := range m.Signatures { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - func (m *SignedHeader) Size() (n int) { if m == nil { return 0 @@ -1568,161 +1415,6 @@ func (m *Header) Unmarshal(dAtA []byte) error { } return nil } -func (m *Commit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Commit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Commit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, types1.CommitSig{}) - if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *SignedHeader) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1818,7 +1510,7 @@ func (m *SignedHeader) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Commit == nil { - m.Commit = &Commit{} + m.Commit = &types1.Commit{} } if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/proto/ostracon/types/types.proto b/proto/ostracon/types/types.proto index ba98c44f5..ee4cdf42d 100644 --- a/proto/ostracon/types/types.proto +++ b/proto/ostracon/types/types.proto @@ -113,12 +113,12 @@ message Header { //} // Commit contains the evidence that a block was committed by a set of validators. -message Commit { - int64 height = 1; - int32 round = 2; - tendermint.types.BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; - repeated tendermint.types.CommitSig signatures = 4 [(gogoproto.nullable) = false]; -} +//message Commit { +// int64 height = 1; +// int32 round = 2; +// tendermint.types.BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; +// repeated tendermint.types.CommitSig signatures = 4 [(gogoproto.nullable) = false]; +//} // CommitSig is a part of the Vote included in a Commit. //message CommitSig { @@ -142,7 +142,7 @@ message Commit { message SignedHeader { Header header = 1; - Commit commit = 2; + tendermint.types.Commit commit = 2; } message LightBlock { diff --git a/store/store.go b/store/store.go index 3227ea7fe..7d2376525 100644 --- a/store/store.go +++ b/store/store.go @@ -19,9 +19,9 @@ import ( BlockStore is a simple low level store for blocks. There are three types of information stored: - - BlockMeta: Meta information about each block - - Block part: Parts of each block, aggregated w/ PartSet - - Commit: The commit part of each block, for gossiping precommit votes + - BlockMeta: Meta information about each block + - Block part: Parts of each block, aggregated w/ PartSet + - Commit: The commit part of each block, for gossiping precommit votes Currently the precommit signatures are duplicated in the Block parts as well as the Commit. In the future this may change, perhaps by moving @@ -203,7 +203,7 @@ func (bs *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { // and it comes from the block.LastCommit for `height+1`. // If no commit is found for the given height, it returns nil. func (bs *BlockStore) LoadBlockCommit(height int64) *types.Commit { - var pbc = new(ocproto.Commit) + var pbc = new(tmproto.Commit) bz, err := bs.db.Get(calcBlockCommitKey(height)) if err != nil { panic(err) @@ -226,7 +226,7 @@ func (bs *BlockStore) LoadBlockCommit(height int64) *types.Commit { // This is useful when we've seen a commit, but there has not yet been // a new block at `height + 1` that includes this commit in its block.LastCommit. func (bs *BlockStore) LoadSeenCommit(height int64) *types.Commit { - var pbc = new(ocproto.Commit) + var pbc = new(tmproto.Commit) bz, err := bs.db.Get(calcSeenCommitKey(height)) if err != nil { panic(err) @@ -327,9 +327,10 @@ func (bs *BlockStore) PruneBlocks(height int64) (uint64, error) { // SaveBlock persists the given block, blockParts, and seenCommit to the underlying db. // blockParts: Must be parts of the block // seenCommit: The +2/3 precommits that were seen which committed at height. -// If all the nodes restart after committing a block, -// we need this to reload the precommits to catch-up nodes to the -// most recent height. Otherwise they'd stall at H-1. +// +// If all the nodes restart after committing a block, +// we need this to reload the precommits to catch-up nodes to the +// most recent height. Otherwise they'd stall at H-1. func (bs *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit) { if block == nil { panic("BlockStore can only save a non-nil block") diff --git a/types/block.go b/types/block.go index b5d42acd8..176a2d59c 100644 --- a/types/block.go +++ b/types/block.go @@ -1000,12 +1000,12 @@ func (commit *Commit) StringIndented(indent string) string { } // ToProto converts Commit to protobuf -func (commit *Commit) ToProto() *ocproto.Commit { +func (commit *Commit) ToProto() *tmproto.Commit { if commit == nil { return nil } - c := new(ocproto.Commit) + c := new(tmproto.Commit) sigs := make([]tmproto.CommitSig, len(commit.Signatures)) for i := range commit.Signatures { sigs[i] = *commit.Signatures[i].ToProto() @@ -1021,7 +1021,7 @@ func (commit *Commit) ToProto() *ocproto.Commit { // FromProto sets a protobuf Commit to the given pointer. // It returns an error if the commit is invalid. -func CommitFromProto(cp *ocproto.Commit) (*Commit, error) { +func CommitFromProto(cp *tmproto.Commit) (*Commit, error) { if cp == nil { return nil, errors.New("nil Commit") } From 27e06e6d4baae86638f1e8ec70af49218533df1f Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 25 Jan 2023 17:56:00 +0900 Subject: [PATCH 17/25] feat!: replace `abci/types.proto` to Tendermint proto. - abci.Evidence --- abci/client/client.go | 2 +- abci/client/grpc_client.go | 2 +- abci/client/local_client.go | 2 +- abci/client/mocks/client.go | 8 +- abci/client/socket_client.go | 2 +- abci/example/kvstore/persistent_kvstore.go | 4 +- abci/types/application.go | 8 +- abci/types/messages.go | 2 +- abci/types/mocks/application.go | 8 +- abci/types/types.pb.go | 853 +++------------------ consensus/replay_test.go | 4 +- proto/ostracon/abci/types.proto | 38 +- proxy/app_conn.go | 4 +- proxy/mocks/app_conn_consensus.go | 8 +- state/execution.go | 2 +- state/execution_test.go | 7 +- state/helpers_test.go | 2 +- state/validation_test.go | 4 +- test/e2e/app/app.go | 4 +- types/evidence.go | 25 +- 20 files changed, 172 insertions(+), 817 deletions(-) diff --git a/abci/client/client.go b/abci/client/client.go index deadb0344..7b37e5b15 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -55,7 +55,7 @@ type Client interface { CheckTxSync(abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) QuerySync(abci.RequestQuery) (*abci.ResponseQuery, error) CommitSync() (*abci.ResponseCommit, error) - InitChainSync(abci.RequestInitChain) (*ocabci.ResponseInitChain, error) + InitChainSync(abci.RequestInitChain) (*abci.ResponseInitChain, error) BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) EndBlockSync(abci.RequestEndBlock) (*abci.ResponseEndBlock, error) BeginRecheckTxSync(ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index 0e7d49db4..a951219f1 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -359,7 +359,7 @@ func (cli *grpcClient) CommitSync() (*abci.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *grpcClient) InitChainSync(params abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (cli *grpcClient) InitChainSync(params abci.RequestInitChain) (*abci.ResponseInitChain, error) { reqres := cli.InitChainAsync(params, nil) reqres.Wait() return reqres.Response.GetInitChain(), cli.Error() diff --git a/abci/client/local_client.go b/abci/client/local_client.go index dc42241df..1fe7ed455 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -282,7 +282,7 @@ func (app *localClient) CommitSync() (*abci.ResponseCommit, error) { return &res, nil } -func (app *localClient) InitChainSync(req abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (app *localClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { app.mtx.Lock() defer app.mtx.Unlock() diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 9694d6ac9..5541254f8 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -493,15 +493,15 @@ func (_m *Client) InitChainAsync(_a0 abci.RequestInitChain, _a1 abcicli.Response } // InitChainSync provides a mock function with given fields: _a0 -func (_m *Client) InitChainSync(_a0 abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (_m *Client) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *ocabci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *ocabci.ResponseInitChain); ok { + var r0 *abci.ResponseInitChain + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ocabci.ResponseInitChain) + r0 = ret.Get(0).(*abci.ResponseInitChain) } } diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index df80cb740..d82ade6fe 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -368,7 +368,7 @@ func (cli *socketClient) CommitSync() (*abci.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { reqres := cli.queueRequest(ocabci.ToRequestInitChain(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index 0ed35ac90..daef40882 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -122,14 +122,14 @@ func (app *PersistentKVStoreApplication) Query(reqQuery abci.RequestQuery) (resQ } // Save the validators in the merkle tree -func (app *PersistentKVStoreApplication) InitChain(req abci.RequestInitChain) ocabci.ResponseInitChain { +func (app *PersistentKVStoreApplication) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { for _, v := range req.Validators { r := app.updateValidator(v) if r.IsErr() { app.logger.Error("Error updating validators", "r", r) } } - return ocabci.ResponseInitChain{} + return abci.ResponseInitChain{} } // Track the block hash and header information diff --git a/abci/types/application.go b/abci/types/application.go index f8b518aca..e513d8311 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -27,7 +27,7 @@ type Application interface { EndRecheckTx(RequestEndRecheckTx) ResponseEndRecheckTx // Signals the end of rechecking // Consensus Connection - InitChain(abci.RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore + InitChain(abci.RequestInitChain) abci.ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore BeginBlock(RequestBeginBlock) abci.ResponseBeginBlock // Signals the beginning of a block DeliverTx(abci.RequestDeliverTx) abci.ResponseDeliverTx // Deliver a tx for full processing EndBlock(abci.RequestEndBlock) abci.ResponseEndBlock // Signals the end of a block, returns changes to the validator set @@ -88,8 +88,8 @@ func (BaseApplication) Query(req abci.RequestQuery) abci.ResponseQuery { return abci.ResponseQuery{Code: CodeTypeOK} } -func (BaseApplication) InitChain(req abci.RequestInitChain) ResponseInitChain { - return ResponseInitChain{} +func (BaseApplication) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { + return abci.ResponseInitChain{} } func (BaseApplication) BeginBlock(req RequestBeginBlock) abci.ResponseBeginBlock { @@ -176,7 +176,7 @@ func (app *GRPCApplication) Commit(ctx context.Context, req *abci.RequestCommit) return &res, nil } -func (app *GRPCApplication) InitChain(ctx context.Context, req *abci.RequestInitChain) (*ResponseInitChain, error) { +func (app *GRPCApplication) InitChain(ctx context.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { res := app.app.InitChain(*req) return &res, nil } diff --git a/abci/types/messages.go b/abci/types/messages.go index 40da47676..1e3e374f1 100644 --- a/abci/types/messages.go +++ b/abci/types/messages.go @@ -229,7 +229,7 @@ func ToResponseQuery(res abci.ResponseQuery) *Response { } } -func ToResponseInitChain(res ResponseInitChain) *Response { +func ToResponseInitChain(res abci.ResponseInitChain) *Response { return &Response{ Value: &Response_InitChain{&res}, } diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 3cbba579b..960ded0b1 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -146,14 +146,14 @@ func (_m *Application) Info(_a0 abci.RequestInfo) abci.ResponseInfo { } // InitChain provides a mock function with given fields: _a0 -func (_m *Application) InitChain(_a0 abci.RequestInitChain) ocabci.ResponseInitChain { +func (_m *Application) InitChain(_a0 abci.RequestInitChain) abci.ResponseInitChain { ret := _m.Called(_a0) - var r0 ocabci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) ocabci.ResponseInitChain); ok { + var r0 abci.ResponseInitChain + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) abci.ResponseInitChain); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(ocabci.ResponseInitChain) + r0 = ret.Get(0).(abci.ResponseInitChain) } return r0 diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 2da35b46d..bd1e869f1 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types1 "github.com/line/ostracon/proto/ostracon/types" types "github.com/tendermint/tendermint/abci/types" _ "github.com/tendermint/tendermint/proto/tendermint/crypto" @@ -20,14 +19,12 @@ import ( io "io" math "math" math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf -var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -319,7 +316,7 @@ type RequestBeginBlock struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Header types1.Header `protobuf:"bytes,2,opt,name=header,proto3" json:"header"` LastCommitInfo types.LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo,proto3" json:"last_commit_info"` - ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators"` + ByzantineValidators []types.Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators"` } func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } @@ -376,7 +373,7 @@ func (m *RequestBeginBlock) GetLastCommitInfo() types.LastCommitInfo { return types.LastCommitInfo{} } -func (m *RequestBeginBlock) GetByzantineValidators() []Evidence { +func (m *RequestBeginBlock) GetByzantineValidators() []types.Evidence { if m != nil { return m.ByzantineValidators } @@ -549,7 +546,7 @@ type Response_SetOption struct { SetOption *types.ResponseSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,proto3,oneof" json:"set_option,omitempty"` } type Response_InitChain struct { - InitChain *ResponseInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` + InitChain *types.ResponseInitChain `protobuf:"bytes,6,opt,name=init_chain,json=initChain,proto3,oneof" json:"init_chain,omitempty"` } type Response_Query struct { Query *types.ResponseQuery `protobuf:"bytes,7,opt,name=query,proto3,oneof" json:"query,omitempty"` @@ -649,7 +646,7 @@ func (m *Response) GetSetOption() *types.ResponseSetOption { return nil } -func (m *Response) GetInitChain() *ResponseInitChain { +func (m *Response) GetInitChain() *types.ResponseInitChain { if x, ok := m.GetValue().(*Response_InitChain); ok { return x.InitChain } @@ -764,66 +761,6 @@ func (*Response) XXX_OneofWrappers() []interface{} { } } -type ResponseInitChain struct { - ConsensusParams *types.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params,omitempty"` - Validators []types.ValidatorUpdate `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"` - AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` -} - -func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } -func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } -func (*ResponseInitChain) ProtoMessage() {} -func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{5} -} -func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseInitChain.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResponseInitChain) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseInitChain.Merge(m, src) -} -func (m *ResponseInitChain) XXX_Size() int { - return m.Size() -} -func (m *ResponseInitChain) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseInitChain.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseInitChain proto.InternalMessageInfo - -func (m *ResponseInitChain) GetConsensusParams() *types.ConsensusParams { - if m != nil { - return m.ConsensusParams - } - return nil -} - -func (m *ResponseInitChain) GetValidators() []types.ValidatorUpdate { - if m != nil { - return m.Validators - } - return nil -} - -func (m *ResponseInitChain) GetAppHash() []byte { - if m != nil { - return m.AppHash - } - return nil -} - type ResponseCheckTx struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` @@ -844,7 +781,7 @@ func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{6} + return fileDescriptor_addf585b2317eb36, []int{5} } func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -958,7 +895,7 @@ func (m *ResponseBeginRecheckTx) Reset() { *m = ResponseBeginRecheckTx{} func (m *ResponseBeginRecheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseBeginRecheckTx) ProtoMessage() {} func (*ResponseBeginRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{7} + return fileDescriptor_addf585b2317eb36, []int{6} } func (m *ResponseBeginRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1002,7 +939,7 @@ func (m *ResponseEndRecheckTx) Reset() { *m = ResponseEndRecheckTx{} } func (m *ResponseEndRecheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseEndRecheckTx) ProtoMessage() {} func (*ResponseEndRecheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{8} + return fileDescriptor_addf585b2317eb36, []int{7} } func (m *ResponseEndRecheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1038,207 +975,111 @@ func (m *ResponseEndRecheckTx) GetCode() uint32 { return 0 } -type Evidence struct { - Type types.EvidenceType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.abci.EvidenceType" json:"type,omitempty"` - // The offending validator - Validator types.Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator"` - // The height when the offense occurred - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - // The corresponding time where the offense occurred - Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` - // Total voting power of the validator set in case the ABCI application does - // not store historical validators. - // https://github.com/tendermint/tendermint/issues/4581 - TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` -} - -func (m *Evidence) Reset() { *m = Evidence{} } -func (m *Evidence) String() string { return proto.CompactTextString(m) } -func (*Evidence) ProtoMessage() {} -func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_addf585b2317eb36, []int{9} -} -func (m *Evidence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Evidence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Evidence) XXX_Merge(src proto.Message) { - xxx_messageInfo_Evidence.Merge(m, src) -} -func (m *Evidence) XXX_Size() int { - return m.Size() -} -func (m *Evidence) XXX_DiscardUnknown() { - xxx_messageInfo_Evidence.DiscardUnknown(m) -} - -var xxx_messageInfo_Evidence proto.InternalMessageInfo - -func (m *Evidence) GetType() types.EvidenceType { - if m != nil { - return m.Type - } - return types.EvidenceType_UNKNOWN -} - -func (m *Evidence) GetValidator() types.Validator { - if m != nil { - return m.Validator - } - return types.Validator{} -} - -func (m *Evidence) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Evidence) GetTime() time.Time { - if m != nil { - return m.Time - } - return time.Time{} -} - -func (m *Evidence) GetTotalVotingPower() int64 { - if m != nil { - return m.TotalVotingPower - } - return 0 -} - func init() { proto.RegisterType((*Request)(nil), "ostracon.abci.Request") proto.RegisterType((*RequestBeginBlock)(nil), "ostracon.abci.RequestBeginBlock") proto.RegisterType((*RequestBeginRecheckTx)(nil), "ostracon.abci.RequestBeginRecheckTx") proto.RegisterType((*RequestEndRecheckTx)(nil), "ostracon.abci.RequestEndRecheckTx") proto.RegisterType((*Response)(nil), "ostracon.abci.Response") - proto.RegisterType((*ResponseInitChain)(nil), "ostracon.abci.ResponseInitChain") proto.RegisterType((*ResponseCheckTx)(nil), "ostracon.abci.ResponseCheckTx") proto.RegisterType((*ResponseBeginRecheckTx)(nil), "ostracon.abci.ResponseBeginRecheckTx") proto.RegisterType((*ResponseEndRecheckTx)(nil), "ostracon.abci.ResponseEndRecheckTx") - proto.RegisterType((*Evidence)(nil), "ostracon.abci.Evidence") } func init() { proto.RegisterFile("ostracon/abci/types.proto", fileDescriptor_addf585b2317eb36) } var fileDescriptor_addf585b2317eb36 = []byte{ - // 1620 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0xdd, 0x6e, 0xdb, 0xc6, - 0x12, 0x96, 0x2c, 0xd9, 0x12, 0xc7, 0xb6, 0xec, 0x4c, 0x7c, 0x7c, 0x14, 0x9e, 0x44, 0xce, 0x91, - 0x4f, 0x0e, 0xd2, 0x34, 0x95, 0x50, 0xa7, 0x0d, 0x52, 0xf4, 0x37, 0x52, 0x6d, 0xc8, 0x4d, 0x5a, - 0x3b, 0x4c, 0x9a, 0x02, 0xfd, 0x09, 0x41, 0x91, 0x6b, 0x89, 0x35, 0xc5, 0x65, 0xc8, 0x95, 0x13, - 0xf5, 0xaa, 0x40, 0x5f, 0x20, 0x6f, 0xd2, 0xab, 0x3e, 0x41, 0x6f, 0x72, 0x99, 0xcb, 0x5e, 0x14, - 0x69, 0x91, 0xdc, 0xb4, 0x7d, 0x87, 0x02, 0xc5, 0x2e, 0x7f, 0x4c, 0xfd, 0x50, 0x64, 0xee, 0x76, - 0x67, 0x67, 0xbe, 0xe5, 0x88, 0xc3, 0xf9, 0xbe, 0x11, 0x9c, 0xa3, 0x1e, 0x73, 0x35, 0x9d, 0xda, - 0x4d, 0xad, 0xab, 0x9b, 0x4d, 0x36, 0x72, 0x88, 0xd7, 0x70, 0x5c, 0xca, 0x28, 0xae, 0x86, 0x47, - 0x0d, 0x7e, 0x24, 0x5f, 0x60, 0xc4, 0x36, 0x88, 0x3b, 0x30, 0x6d, 0xd6,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0x25, 0x41, 0x24, 0xd7, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x30, 0xde, 0xf2, - 0xad, 0x15, 0x00, 0x00, + // 1427 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x5b, 0x8f, 0xdb, 0x44, + 0x14, 0xc7, 0x93, 0x26, 0x9b, 0xac, 0xcf, 0x66, 0xd3, 0xed, 0xe9, 0xb2, 0x72, 0x4d, 0x9b, 0x2d, + 0x59, 0x8a, 0x4a, 0x29, 0x1b, 0x69, 0x0b, 0x15, 0x08, 0x10, 0x34, 0x61, 0xab, 0x2c, 0x14, 0x56, + 0x9d, 0x22, 0x90, 0xb8, 0x34, 0x72, 0xec, 0x49, 0x62, 0xd6, 0xf1, 0xb8, 0xf6, 0x64, 0x69, 0x78, + 0x44, 0xe2, 0x9d, 0x6f, 0xc2, 0x23, 0x5f, 0xa1, 0x8f, 0x7d, 0xe4, 0x01, 0x55, 0xa8, 0x7d, 0x01, + 0x3e, 0x05, 0x9a, 0xf1, 0xa5, 0xce, 0xc5, 0xb1, 0xf7, 0x6d, 0x2e, 0xe7, 0xfc, 0xc7, 0x27, 0x3e, + 0x73, 0x7e, 0x3e, 0x81, 0x4b, 0xcc, 0xe7, 0x9e, 0x6e, 0x30, 0xa7, 0xa5, 0xf7, 0x0d, 0xab, 0xc5, + 0xa7, 0x2e, 0xf5, 0xf7, 0x5d, 0x8f, 0x71, 0x86, 0x9b, 0xd1, 0xd6, 0xbe, 0xd8, 0xd2, 0xae, 0x70, + 0xea, 0x98, 0xd4, 0x1b, 0x5b, 0x0e, 0x6f, 0x19, 0xde, 0xd4, 0xe5, 0xac, 0xe5, 0x7a, 0x8c, 0x0d, + 0x02, 0xeb, 0x99, 0x6d, 0xa9, 0xd2, 0x72, 0x75, 0x4f, 0x1f, 0x87, 0x62, 0xda, 0xab, 0x89, 0xed, + 0xf9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0x6d, 0xa4, 0x52, 0x2c, 0x4c, 0x99, + 0x65, 0x0c, 0x7a, 0x3f, 0x66, 0x50, 0x2d, 0x15, 0xa2, 0x61, 0x0c, 0xf3, 0x10, 0x3a, 0x5e, 0x80, + 0x50, 0x00, 0x8d, 0x37, 0x52, 0x25, 0x32, 0x28, 0x74, 0xbc, 0x40, 0xa1, 0x7a, 0x86, 0x60, 0x06, + 0x86, 0xbe, 0x5f, 0x8e, 0xa1, 0x74, 0x50, 0x84, 0x8f, 0x99, 0x8f, 0x43, 0xbd, 0x14, 0x0e, 0x6d, + 0x49, 0xf9, 0xb7, 0x52, 0xe5, 0x73, 0x83, 0x88, 0xa4, 0x83, 0xe8, 0x5a, 0x4a, 0xa2, 0x65, 0x92, + 0xe8, 0x5e, 0x1a, 0x89, 0xf6, 0x52, 0x14, 0xf3, 0xa1, 0xe8, 0xaf, 0x73, 0x70, 0x7e, 0x2e, 0xd9, + 0x05, 0x88, 0x0c, 0x66, 0x52, 0x59, 0x09, 0x37, 0x89, 0x1c, 0x8b, 0x35, 0x53, 0xe7, 0xba, 0x2c, + 0x6f, 0x35, 0x22, 0xc7, 0xb8, 0x05, 0x25, 0x9b, 0x0d, 0x65, 0xed, 0x52, 0x88, 0x18, 0x0a, 0xab, + 0xb8, 0x2e, 0x29, 0x61, 0xd9, 0x69, 0x00, 0x0c, 0x75, 0xbf, 0xf7, 0x93, 0xee, 0x70, 0x6a, 0xca, + 0xb2, 0x53, 0x22, 0x89, 0x15, 0xd4, 0x60, 0x5d, 0xcc, 0x26, 0x3e, 0x35, 0x65, 0x3d, 0x29, 0x91, + 0x78, 0x8e, 0x5d, 0xa8, 0xd0, 0x53, 0xea, 0x70, 0x5f, 0xad, 0x4a, 0xd2, 0xec, 0x2c, 0x21, 0x0d, + 0x75, 0x78, 0x5b, 0x15, 0x28, 0xf8, 0xef, 0xd9, 0xee, 0x56, 0x60, 0x7d, 0x93, 0x8d, 0x2d, 0x4e, + 0xc7, 0x2e, 0x9f,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c, 0x64, 0x31, 0xca, 0x31, 0xbb, 0xd9, + 0xd4, 0x72, 0x7c, 0x11, 0xe0, 0x03, 0x80, 0xc4, 0xc7, 0x6f, 0x66, 0x17, 0xa9, 0xe5, 0xe1, 0x3c, + 0x1e, 0xc3, 0x7a, 0x44, 0x4b, 0xcc, 0xec, 0xe9, 0xb4, 0x6c, 0xe4, 0xe2, 0x43, 0xd8, 0x9c, 0x81, + 0x1f, 0xe6, 0xeb, 0xd4, 0xb4, 0x9c, 0x2c, 0x15, 0xfa, 0x33, 0x2c, 0xc4, 0x7c, 0x9d, 0x9b, 0x96, + 0x13, 0xad, 0xf8, 0x23, 0x5c, 0x58, 0xa0, 0x22, 0xe6, 0x6f, 0xe4, 0xb4, 0x33, 0xc0, 0x16, 0xc7, + 0x80, 0x8b, 0x88, 0xc4, 0x33, 0xf4, 0x75, 0xda, 0x59, 0xd8, 0x8b, 0x3f, 0x40, 0x7d, 0xae, 0xa6, + 0xe6, 0xea, 0xf2, 0xb4, 0x7c, 0x08, 0xc6, 0x6f, 0xa0, 0x36, 0x53, 0x84, 0x73, 0x74, 0x7c, 0x5a, + 0x1e, 0x16, 0xb7, 0x3f, 0x7a, 0xf2, 0xbc, 0x51, 0x7c, 0xfa, 0xbc, 0x51, 0xfc, 0xfb, 0x79, 0xa3, + 0xf8, 0xdb, 0x8b, 0x46, 0xe1, 0xe9, 0x8b, 0x46, 0xe1, 0xcf, 0x17, 0x8d, 0xc2, 0xb7, 0x7b, 0x43, + 0x8b, 0x8f, 0x26, 0xfd, 0x7d, 0x83, 0x8d, 0x5b, 0xb6, 0xe5, 0xd0, 0xd6, 0x92, 0xff, 0xf3, 0xfa, + 0x15, 0xf9, 0xaf, 0xd7, 0xad, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x98, 0xcb, 0x00, 0xed, + 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1261,7 +1102,7 @@ type ABCIApplicationClient interface { CheckTx(ctx context.Context, in *types.RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) Query(ctx context.Context, in *types.RequestQuery, opts ...grpc.CallOption) (*types.ResponseQuery, error) Commit(ctx context.Context, in *types.RequestCommit, opts ...grpc.CallOption) (*types.ResponseCommit, error) - InitChain(ctx context.Context, in *types.RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) + InitChain(ctx context.Context, in *types.RequestInitChain, opts ...grpc.CallOption) (*types.ResponseInitChain, error) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*types.ResponseBeginBlock, error) EndBlock(ctx context.Context, in *types.RequestEndBlock, opts ...grpc.CallOption) (*types.ResponseEndBlock, error) ListSnapshots(ctx context.Context, in *types.RequestListSnapshots, opts ...grpc.CallOption) (*types.ResponseListSnapshots, error) @@ -1352,8 +1193,8 @@ func (c *aBCIApplicationClient) Commit(ctx context.Context, in *types.RequestCom return out, nil } -func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *types.RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { - out := new(ResponseInitChain) +func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *types.RequestInitChain, opts ...grpc.CallOption) (*types.ResponseInitChain, error) { + out := new(types.ResponseInitChain) err := c.cc.Invoke(ctx, "/ostracon.abci.ABCIApplication/InitChain", in, out, opts...) if err != nil { return nil, err @@ -1443,7 +1284,7 @@ type ABCIApplicationServer interface { CheckTx(context.Context, *types.RequestCheckTx) (*ResponseCheckTx, error) Query(context.Context, *types.RequestQuery) (*types.ResponseQuery, error) Commit(context.Context, *types.RequestCommit) (*types.ResponseCommit, error) - InitChain(context.Context, *types.RequestInitChain) (*ResponseInitChain, error) + InitChain(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error) BeginBlock(context.Context, *RequestBeginBlock) (*types.ResponseBeginBlock, error) EndBlock(context.Context, *types.RequestEndBlock) (*types.ResponseEndBlock, error) ListSnapshots(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) @@ -1482,7 +1323,7 @@ func (*UnimplementedABCIApplicationServer) Query(ctx context.Context, req *types func (*UnimplementedABCIApplicationServer) Commit(ctx context.Context, req *types.RequestCommit) (*types.ResponseCommit, error) { return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") } -func (*UnimplementedABCIApplicationServer) InitChain(ctx context.Context, req *types.RequestInitChain) (*ResponseInitChain, error) { +func (*UnimplementedABCIApplicationServer) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { return nil, status.Errorf(codes.Unimplemented, "method InitChain not implemented") } func (*UnimplementedABCIApplicationServer) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*types.ResponseBeginBlock, error) { @@ -2831,62 +2672,6 @@ func (m *Response_EndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } -func (m *ResponseInitChain) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseInitChain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseInitChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AppHash) > 0 { - i -= len(m.AppHash) - copy(dAtA[i:], m.AppHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.ConsensusParams != nil { - { - size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *ResponseCheckTx) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3042,62 +2827,6 @@ func (m *ResponseEndRecheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Evidence) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TotalVotingPower != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.TotalVotingPower)) - i-- - dAtA[i] = 0x28 - } - n40, err40 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err40 != nil { - return 0, err40 - } - i -= n40 - i = encodeVarintTypes(dAtA, i, uint64(n40)) - i-- - dAtA[i] = 0x22 - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x18 - } - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -3599,29 +3328,6 @@ func (m *Response_EndRecheckTx) Size() (n int) { } return n } -func (m *ResponseInitChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ConsensusParams != nil { - l = m.ConsensusParams.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.AppHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func (m *ResponseCheckTx) Size() (n int) { if m == nil { return 0 @@ -3697,28 +3403,6 @@ func (m *ResponseEndRecheckTx) Size() (n int) { return n } -func (m *Evidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = m.Validator.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - if m.TotalVotingPower != 0 { - n += 1 + sovTypes(uint64(m.TotalVotingPower)) - } - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4528,7 +4212,7 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ByzantineValidators = append(m.ByzantineValidators, Evidence{}) + m.ByzantineValidators = append(m.ByzantineValidators, types.Evidence{}) if err := m.ByzantineValidators[len(m.ByzantineValidators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4939,7 +4623,7 @@ func (m *Response) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ResponseInitChain{} + v := &types.ResponseInitChain{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5386,160 +5070,6 @@ func (m *Response) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseInitChain: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseInitChain: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusParams == nil { - m.ConsensusParams = &types.ConsensusParams{} - } - if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Validators = append(m.Validators, types.ValidatorUpdate{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6032,179 +5562,6 @@ func (m *ResponseEndRecheckTx) Unmarshal(dAtA []byte) error { } return nil } -func (m *Evidence) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Evidence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Evidence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= types.EvidenceType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVotingPower", wireType) - } - m.TotalVotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalVotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/consensus/replay_test.go b/consensus/replay_test.go index b703f3fbd..d6fb88ace 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -1298,8 +1298,8 @@ type initChainApp struct { vals []abci.ValidatorUpdate } -func (ica *initChainApp) InitChain(req abci.RequestInitChain) ocabci.ResponseInitChain { - return ocabci.ResponseInitChain{ +func (ica *initChainApp) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { + return abci.ResponseInitChain{ Validators: ica.vals, } } diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index bfa83303e..86a0f28e5 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -81,7 +81,7 @@ message RequestBeginBlock { bytes hash = 1; ostracon.types.Header header = 2 [(gogoproto.nullable) = false]; tendermint.abci.LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; - repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; + repeated tendermint.abci.Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; } //enum CheckTxType { @@ -146,7 +146,7 @@ message Response { tendermint.abci.ResponseFlush flush = 3; tendermint.abci.ResponseInfo info = 4; tendermint.abci.ResponseSetOption set_option = 5; - ResponseInitChain init_chain = 6; + tendermint.abci.ResponseInitChain init_chain = 6; tendermint.abci.ResponseQuery query = 7; tendermint.abci.ResponseBeginBlock begin_block = 8; ResponseCheckTx check_tx = 9; @@ -384,22 +384,22 @@ message ResponseEndRecheckTx { // LIGHT_CLIENT_ATTACK = 2; //} -message Evidence { - tendermint.abci.EvidenceType type = 1; - // The offending validator - tendermint.abci.Validator validator = 2 [(gogoproto.nullable) = false]; - // The height when the offense occurred - int64 height = 3; - // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdtime) = true - ]; - // Total voting power of the validator set in case the ABCI application does - // not store historical validators. - // https://github.com/tendermint/tendermint/issues/4581 - int64 total_voting_power = 5; // total voting power -} +//message Evidence { +// tendermint.abci.EvidenceType type = 1; +// // The offending validator +// tendermint.abci.Validator validator = 2 [(gogoproto.nullable) = false]; +// // The height when the offense occurred +// int64 height = 3; +// // The corresponding time where the offense occurred +// google.protobuf.Timestamp time = 4 [ +// (gogoproto.nullable) = false, +// (gogoproto.stdtime) = true +// ]; +// // Total voting power of the validator set in case the ABCI application does +// // not store historical validators. +// // https://github.com/tendermint/tendermint/issues/4581 +// int64 total_voting_power = 5; // total voting power +//} //---------------------------------------- // State Sync Types @@ -424,7 +424,7 @@ service ABCIApplication { rpc CheckTx(tendermint.abci.RequestCheckTx) returns (ResponseCheckTx); rpc Query(tendermint.abci.RequestQuery) returns (tendermint.abci.ResponseQuery); rpc Commit(tendermint.abci.RequestCommit) returns (tendermint.abci.ResponseCommit); - rpc InitChain(tendermint.abci.RequestInitChain) returns (ResponseInitChain); + rpc InitChain(tendermint.abci.RequestInitChain) returns (tendermint.abci.ResponseInitChain); rpc BeginBlock(RequestBeginBlock) returns (tendermint.abci.ResponseBeginBlock); rpc EndBlock(tendermint.abci.RequestEndBlock) returns (tendermint.abci.ResponseEndBlock); rpc ListSnapshots(tendermint.abci.RequestListSnapshots) returns (tendermint.abci.ResponseListSnapshots); diff --git a/proxy/app_conn.go b/proxy/app_conn.go index bd690937b..36792a2da 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -17,7 +17,7 @@ type AppConnConsensus interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - InitChainSync(abci.RequestInitChain) (*ocabci.ResponseInitChain, error) + InitChainSync(abci.RequestInitChain) (*abci.ResponseInitChain, error) BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) DeliverTxAsync(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes @@ -79,7 +79,7 @@ func (app *appConnConsensus) Error() error { return app.appConn.Error() } -func (app *appConnConsensus) InitChainSync(req abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (app *appConnConsensus) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { return app.appConn.InitChainSync(req) } diff --git a/proxy/mocks/app_conn_consensus.go b/proxy/mocks/app_conn_consensus.go index 08858b919..801bda651 100644 --- a/proxy/mocks/app_conn_consensus.go +++ b/proxy/mocks/app_conn_consensus.go @@ -115,15 +115,15 @@ func (_m *AppConnConsensus) Error() error { } // InitChainSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) InitChainSync(_a0 abci.RequestInitChain) (*ocabci.ResponseInitChain, error) { +func (_m *AppConnConsensus) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *ocabci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *ocabci.ResponseInitChain); ok { + var r0 *abci.ResponseInitChain + if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ocabci.ResponseInitChain) + r0 = ret.Get(0).(*abci.ResponseInitChain) } } diff --git a/state/execution.go b/state/execution.go index 2d8fe6731..5f9280382 100644 --- a/state/execution.go +++ b/state/execution.go @@ -374,7 +374,7 @@ func execBlockOnProxyApp( commitInfo := getBeginBlockValidatorInfo(block, store, initialHeight) - byzVals := make([]ocabci.Evidence, 0) + byzVals := make([]abci.Evidence, 0) for _, evidence := range block.Evidence.Evidence { byzVals = append(byzVals, evidence.ABCI()...) } diff --git a/state/execution_test.go b/state/execution_test.go index ff411473c..b72597724 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -13,7 +13,6 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" @@ -183,7 +182,7 @@ func TestBeginBlockByzantineValidators(t *testing.T) { ev := []types.Evidence{dve, lcae} - abciEv := []ocabci.Evidence{ + abciEv := []abci.Evidence{ { Type: abci.EvidenceType_DUPLICATE_VOTE, Height: 3, @@ -228,9 +227,9 @@ func TestBeginBlockByzantineValidators(t *testing.T) { testCases := []struct { desc string evidence []types.Evidence - expectedByzantineValidators []ocabci.Evidence + expectedByzantineValidators []abci.Evidence }{ - {"none byzantine", []types.Evidence{}, []ocabci.Evidence{}}, + {"none byzantine", []types.Evidence{}, []abci.Evidence{}}, {"one byzantine", []types.Evidence{&ev1}, ev1.ABCI()}, {"multiple byzantine", []types.Evidence{&ev1, &ev2}, append(ev1.ABCI(), ev2.ABCI()...)}, } diff --git a/state/helpers_test.go b/state/helpers_test.go index 4656d8753..b2f7dc484 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -253,7 +253,7 @@ type testApp struct { ocabci.BaseApplication CommitVotes []abci.VoteInfo - ByzantineValidators []ocabci.Evidence + ByzantineValidators []abci.Evidence ValidatorUpdates []abci.ValidatorUpdate } diff --git a/state/validation_test.go b/state/validation_test.go index 89813824d..0e307c792 100644 --- a/state/validation_test.go +++ b/state/validation_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/libs/log" @@ -225,7 +225,7 @@ func TestValidateBlockEvidence(t *testing.T) { evpool.On("CheckEvidence", mock.AnythingOfType("types.EvidenceList")).Return(nil) evpool.On("Update", mock.AnythingOfType("state.State"), mock.AnythingOfType("types.EvidenceList")).Return() evpool.On("ABCIEvidence", mock.AnythingOfType("int64"), mock.AnythingOfType("[]types.Evidence")).Return( - []ocabci.Evidence{}) + []abci.Evidence{}) state.ConsensusParams.Evidence.MaxBytes = 1000 blockExec := sm.NewBlockExecutor( diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index 7222c4201..dee9aab27 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -121,7 +121,7 @@ func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo { } // Info implements ABCI. -func (app *Application) InitChain(req abci.RequestInitChain) ocabci.ResponseInitChain { +func (app *Application) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { var err error app.state.initialHeight = uint64(req.InitialHeight) if len(req.AppStateBytes) > 0 { @@ -130,7 +130,7 @@ func (app *Application) InitChain(req abci.RequestInitChain) ocabci.ResponseInit panic(err) } } - resp := ocabci.ResponseInitChain{ + resp := abci.ResponseInitChain{ AppHash: app.state.Hash, } if resp.Validators, err = app.validatorUpdates(0); err != nil { diff --git a/types/evidence.go b/types/evidence.go index aa965dfea..cb00a9468 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -12,7 +12,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/merkle" "github.com/line/ostracon/crypto/tmhash" tmjson "github.com/line/ostracon/libs/json" @@ -39,13 +38,13 @@ func MaxEvidenceBytes(ev Evidence) int64 { // Evidence represents any provable malicious activity by a validator. // Verification logic for each evidence is part of the evidence module. type Evidence interface { - ABCI() []ocabci.Evidence // forms individual evidence to be sent to the application - Bytes() []byte // bytes which comprise the evidence - Hash() []byte // hash of the evidence - Height() int64 // height of the infraction - String() string // string format of the evidence - Time() time.Time // time of the infraction - ValidateBasic() error // basic consistency check + ABCI() []abci.Evidence // forms individual evidence to be sent to the application + Bytes() []byte // bytes which comprise the evidence + Hash() []byte // hash of the evidence + Height() int64 // height of the infraction + String() string // string format of the evidence + Time() time.Time // time of the infraction + ValidateBasic() error // basic consistency check } //-------------------------------------------------------------------------------------- @@ -92,8 +91,8 @@ func NewDuplicateVoteEvidence(vote1, vote2 *Vote, blockTime time.Time, valSet *V } // ABCI returns the application relevant representation of the evidence -func (dve *DuplicateVoteEvidence) ABCI() []ocabci.Evidence { - return []ocabci.Evidence{{ +func (dve *DuplicateVoteEvidence) ABCI() []abci.Evidence { + return []abci.Evidence{{ Type: abci.EvidenceType_DUPLICATE_VOTE, Validator: abci.Validator{ Address: dve.VoteA.ValidatorAddress, @@ -219,10 +218,10 @@ type LightClientAttackEvidence struct { var _ Evidence = &LightClientAttackEvidence{} // ABCI forms an array of abci evidence for each byzantine validator -func (l *LightClientAttackEvidence) ABCI() []ocabci.Evidence { - abciEv := make([]ocabci.Evidence, len(l.ByzantineValidators)) +func (l *LightClientAttackEvidence) ABCI() []abci.Evidence { + abciEv := make([]abci.Evidence, len(l.ByzantineValidators)) for idx, val := range l.ByzantineValidators { - abciEv[idx] = ocabci.Evidence{ + abciEv[idx] = abci.Evidence{ Type: abci.EvidenceType_LIGHT_CLIENT_ATTACK, Validator: OC2PB.Validator(val), Height: l.Height(), From 0477a75ca41b15850e9fa24832c5222d94945366 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 25 Jan 2023 18:13:12 +0900 Subject: [PATCH 18/25] chore: remove commented out proto message --- abci/example/kvstore/kvstore_test.go | 4 +- abci/types/util.go | 62 +++--- proto/ostracon/abci/types.proto | 303 -------------------------- proto/ostracon/blockchain/types.proto | 20 -- proto/ostracon/privval/types.proto | 55 ----- proto/ostracon/state/types.proto | 17 -- proto/ostracon/types/types.proto | 101 --------- test/e2e/app/app.go | 4 +- 8 files changed, 35 insertions(+), 531 deletions(-) diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 2cf836438..887501a76 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -241,8 +241,8 @@ func valsEqual(t *testing.T, vals1, vals2 []abci.ValidatorUpdate) { if len(vals1) != len(vals2) { t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1)) } - sort.Sort(abci.ValidatorUpdates(vals1)) - sort.Sort(abci.ValidatorUpdates(vals2)) + sort.Sort(ocabci.ValidatorUpdates(vals1)) + sort.Sort(ocabci.ValidatorUpdates(vals2)) for i, v1 := range vals1 { v2 := vals2[i] if !v1.PubKey.Equal(v2.PubKey) || diff --git a/abci/types/util.go b/abci/types/util.go index d60fded24..96af04a21 100644 --- a/abci/types/util.go +++ b/abci/types/util.go @@ -1,33 +1,33 @@ package types -//import ( -// "sort" -// -// abci "github.com/tendermint/tendermint/abci/types" -//) -// -////------------------------------------------------------------------------------ -// -//// ValidatorUpdates is a list of validators that implements the Sort interface -//type ValidatorUpdates []abci.ValidatorUpdate -// -//var _ sort.Interface = (ValidatorUpdates)(nil) -// -//// All these methods for ValidatorUpdates: -//// Len, Less and Swap -//// are for ValidatorUpdates to implement sort.Interface -//// which will be used by the sort package. -//// See Issue https://github.com/tendermint/abci/issues/212 -// -//func (v ValidatorUpdates) Len() int { -// return len(v) -//} -// -//// XXX: doesn't distinguish same validator with different power -//func (v ValidatorUpdates) Less(i, j int) bool { -// return v[i].PubKey.Compare(v[j].PubKey) <= 0 -//} -// -//func (v ValidatorUpdates) Swap(i, j int) { -// v[i], v[j] = v[j], v[i] -//} +import ( + "sort" + + abci "github.com/tendermint/tendermint/abci/types" +) + +//------------------------------------------------------------------------------ + +// ValidatorUpdates is a list of validators that implements the Sort interface +type ValidatorUpdates []abci.ValidatorUpdate + +var _ sort.Interface = (ValidatorUpdates)(nil) + +// All these methods for ValidatorUpdates: +// Len, Less and Swap +// are for ValidatorUpdates to implement sort.Interface +// which will be used by the sort package. +// See Issue https://github.com/tendermint/abci/issues/212 + +func (v ValidatorUpdates) Len() int { + return len(v) +} + +// XXX: doesn't distinguish same validator with different power +func (v ValidatorUpdates) Less(i, j int) bool { + return v[i].PubKey.Compare(v[j].PubKey) <= 0 +} + +func (v ValidatorUpdates) Swap(i, j int) { + v[i], v[j] = v[j], v[i] +} diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index 86a0f28e5..6b974bd23 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -42,41 +42,6 @@ message Request { } } -//message RequestEcho { -// string message = 1; -//} - -//message RequestFlush {} - -//message RequestInfo { -// string version = 1; -// uint64 block_version = 2; -// uint64 p2p_version = 3; -//} - -// nondeterministic -//message RequestSetOption { -// string key = 1; -// string value = 2; -//} - -//message RequestInitChain { -// google.protobuf.Timestamp time = 1 -// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -// string chain_id = 2; -// tendermint.abci.ConsensusParams consensus_params = 3; -// repeated tendermint.abci.ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; -// bytes app_state_bytes = 5; -// int64 initial_height = 6; -//} - -//message RequestQuery { -// bytes data = 1; -// string path = 2; -// int64 height = 3; -// bool prove = 4; -//} - message RequestBeginBlock { bytes hash = 1; ostracon.types.Header header = 2 [(gogoproto.nullable) = false]; @@ -84,50 +49,6 @@ message RequestBeginBlock { repeated tendermint.abci.Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; } -//enum CheckTxType { -// NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; -// RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; -//} - -//message RequestCheckTx { -// bytes tx = 1; -// CheckTxType type = 2; -//} - -//message RequestDeliverTx { -// bytes tx = 1; -//} - -//message RequestEndBlock { -// int64 height = 1; -//} - -//message RequestCommit {} - -// lists available snapshots -//message RequestListSnapshots { -//} - -// offers a snapshot to the application -//message RequestOfferSnapshot { -// Snapshot snapshot = 1; // snapshot offered by peers -// bytes app_hash = 2; // light client-verified app hash for snapshot height -//} - -// loads a snapshot chunk -//message RequestLoadSnapshotChunk { -// uint64 height = 1; -// uint32 format = 2; -// uint32 chunk = 3; -//} - -// Applies a snapshot chunk -//message RequestApplySnapshotChunk { -// uint32 index = 1; -// bytes chunk = 2; -// string sender = 3; -//} - message RequestBeginRecheckTx { ostracon.types.Header header = 1 [(gogoproto.nullable) = false]; } @@ -162,59 +83,6 @@ message Response { } } -// nondeterministic -//message ResponseException { -// string error = 1; -//} - -//message ResponseEcho { -// string message = 1; -//} - -//message ResponseFlush {} - -//message ResponseInfo { -// string data = 1; -// -// string version = 2; -// uint64 app_version = 3; -// -// int64 last_block_height = 4; -// bytes last_block_app_hash = 5; -//} - -// nondeterministic -//message ResponseSetOption { -// uint32 code = 1; -// // bytes data = 2; -// string log = 3; -// string info = 4; -//} - -//message ResponseInitChain { -// tendermint.abci.ConsensusParams consensus_params = 1; -// repeated tendermint.abci.ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; -// bytes app_hash = 3; -//} - -//message ResponseQuery { -// uint32 code = 1; -// // bytes data = 2; // use "value" instead. -// string log = 3; // nondeterministic -// string info = 4; // nondeterministic -// int64 index = 5; -// bytes key = 6; -// bytes value = 7; -// tendermint.crypto.ProofOps proof_ops = 8; -// int64 height = 9; -// string codespace = 10; -//} - -//message ResponseBeginBlock { -// repeated Event events = 1 -// [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; -//} - message ResponseCheckTx { uint32 code = 1; bytes data = 2; @@ -233,68 +101,6 @@ message ResponseCheckTx { string mempool_error = 11; } -//message ResponseDeliverTx { -// uint32 code = 1; -// bytes data = 2; -// string log = 3; // nondeterministic -// string info = 4; // nondeterministic -// int64 gas_wanted = 5 [json_name = "gas_wanted"]; -// int64 gas_used = 6 [json_name = "gas_used"]; -// repeated Event events = 7 -// [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic -// string codespace = 8; -//} - -//message ResponseEndBlock { -// repeated tendermint.abci.ValidatorUpdate validator_updates = 1 -// [(gogoproto.nullable) = false]; -// tendermint.abci.ConsensusParams consensus_param_updates = 2; -// repeated tendermint.abci.Event events = 3 -// [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; -//} - -//message ResponseCommit { -// // reserve 1 -// bytes data = 2; -// int64 retain_height = 3; -//} - -//message ResponseListSnapshots { -// repeated Snapshot snapshots = 1; -//} - -//message ResponseOfferSnapshot { -// Result result = 1; -// -// enum Result { -// UNKNOWN = 0; // Unknown result, abort all snapshot restoration -// ACCEPT = 1; // Snapshot accepted, apply chunks -// ABORT = 2; // Abort all snapshot restoration -// REJECT = 3; // Reject this specific snapshot, try others -// REJECT_FORMAT = 4; // Reject all snapshots of this format, try others -// REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others -// } -//} - -//message ResponseLoadSnapshotChunk { -// bytes chunk = 1; -//} - -//message ResponseApplySnapshotChunk { -// Result result = 1; -// repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply -// repeated string reject_senders = 3; // Chunk senders to reject and ban -// -// enum Result { -// UNKNOWN = 0; // Unknown result, abort all snapshot restoration -// ACCEPT = 1; // Chunk successfully accepted -// ABORT = 2; // Abort all snapshot restoration -// RETRY = 3; // Retry chunk (combine with refetch and reject) -// RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) -// REJECT_SNAPSHOT = 5; // Reject this snapshot, try others -// } -//} - message ResponseBeginRecheckTx { uint32 code = 1; } @@ -303,115 +109,6 @@ message ResponseEndRecheckTx { uint32 code = 1; } -//---------------------------------------- -// Misc. - -// ConsensusParams contains all consensus-relevant parameters -// that can be adjusted by the abci app -//message ConsensusParams { -// BlockParams block = 1; -// tendermint.types.EvidenceParams evidence = 2; -// tendermint.types.ValidatorParams validator = 3; -// tendermint.types.VersionParams version = 4; -//} - -// BlockParams contains limits on the block size. -//message BlockParams { -// // Note: must be greater than 0 -// int64 max_bytes = 1; -// // Note: must be greater or equal to -1 -// int64 max_gas = 2; -//} - -//message LastCommitInfo { -// int32 round = 1; -// repeated tendermint.abci.VoteInfo votes = 2 [(gogoproto.nullable) = false]; -//} - -// Event allows application developers to attach additional information to -// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. -// Later, transactions may be queried using these events. -//message Event { -// string type = 1; -// repeated EventAttribute attributes = 2 [ -// (gogoproto.nullable) = false, -// (gogoproto.jsontag) = "attributes,omitempty" -// ]; -//} - -// EventAttribute is a single key-value pair, associated with an event. -//message EventAttribute { -// bytes key = 1; -// bytes value = 2; -// bool index = 3; // nondeterministic -//} - -// TxResult contains results of executing the transaction. -// -// One usage is indexing transaction results. -//message TxResult { -// int64 height = 1; -// uint32 index = 2; -// bytes tx = 3; -// ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; -//} - -//---------------------------------------- -// Blockchain Types - -//// Validator -//message Validator { -// bytes address = 1; // The first 20 bytes of SHA256(public key) -// // PubKey pub_key = 2 [(gogoproto.nullable)=false]; -// int64 power = 3; // The voting power -//} - -//// ValidatorUpdate -//message ValidatorUpdate { -// tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; -// int64 power = 2; // The voting power -//} - -// VoteInfo -//message VoteInfo { -// tendermint.abci.Validator validator = 1 [(gogoproto.nullable) = false]; -// bool signed_last_block = 2; -//} - -//enum EvidenceType { -// UNKNOWN = 0; -// DUPLICATE_VOTE = 1; -// LIGHT_CLIENT_ATTACK = 2; -//} - -//message Evidence { -// tendermint.abci.EvidenceType type = 1; -// // The offending validator -// tendermint.abci.Validator validator = 2 [(gogoproto.nullable) = false]; -// // The height when the offense occurred -// int64 height = 3; -// // The corresponding time where the offense occurred -// google.protobuf.Timestamp time = 4 [ -// (gogoproto.nullable) = false, -// (gogoproto.stdtime) = true -// ]; -// // Total voting power of the validator set in case the ABCI application does -// // not store historical validators. -// // https://github.com/tendermint/tendermint/issues/4581 -// int64 total_voting_power = 5; // total voting power -//} - -//---------------------------------------- -// State Sync Types - -//message Snapshot { -// uint64 height = 1; // The height at which the snapshot was taken -// uint32 format = 2; // The application-specific snapshot format -// uint32 chunks = 3; // Number of chunks in the snapshot -// bytes hash = 4; // Arbitrary snapshot hash, equal only if identical -// bytes metadata = 5; // Arbitrary application metadata -//} - //---------------------------------------- // Service Definition diff --git a/proto/ostracon/blockchain/types.proto b/proto/ostracon/blockchain/types.proto index 6acd4c52b..250b5917a 100644 --- a/proto/ostracon/blockchain/types.proto +++ b/proto/ostracon/blockchain/types.proto @@ -6,31 +6,11 @@ option go_package = "github.com/line/ostracon/proto/ostracon/blockchain"; import "ostracon/types/block.proto"; import "tendermint/blockchain/types.proto"; -// BlockRequest requests a block for a specific height -//message BlockRequest { -// int64 height = 1; -//} - -// NoBlockResponse informs the node that the peer does not have block at the requested height -//message NoBlockResponse { -// int64 height = 1; -//} - // BlockResponse returns block to the requested message BlockResponse { ostracon.types.Block block = 1; } -// StatusRequest requests the status of a peer. -//message StatusRequest { -//} - -// StatusResponse is a peer response to inform their status. -//message StatusResponse { -// int64 height = 1; -// int64 base = 2; -//} - message Message { oneof sum { tendermint.blockchain.BlockRequest block_request = 1; diff --git a/proto/ostracon/privval/types.proto b/proto/ostracon/privval/types.proto index 7543be558..8b0b13033 100644 --- a/proto/ostracon/privval/types.proto +++ b/proto/ostracon/privval/types.proto @@ -8,55 +8,6 @@ import "tendermint/privval/types.proto"; option go_package = "github.com/line/ostracon/proto/ostracon/privval"; -//enum Errors { -// ERRORS_UNKNOWN = 0; -// ERRORS_UNEXPECTED_RESPONSE = 1; -// ERRORS_NO_CONNECTION = 2; -// ERRORS_CONNECTION_TIMEOUT = 3; -// ERRORS_READ_TIMEOUT = 4; -// ERRORS_WRITE_TIMEOUT = 5; -//} - -//message RemoteSignerError { -// int32 code = 1; -// string description = 2; -//} - -// PubKeyRequest requests the consensus public key from the remote signer. -//message PubKeyRequest { -// string chain_id = 1; -//} - -// PubKeyResponse is a response message containing the public key. -//message PubKeyResponse { -// tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; -// tendermint.privval.RemoteSignerError error = 2; -//} - -// SignVoteRequest is a request to sign a vote -//message SignVoteRequest { -// tendermint.types.Vote vote = 1; -// string chain_id = 2; -//} - -// SignedVoteResponse is a response containing a signed vote or an error -//message SignedVoteResponse { -// tendermint.types.Vote vote = 1 [(gogoproto.nullable) = false]; -// RemoteSignerError error = 2; -//} - -// SignProposalRequest is a request to sign a proposal -//message SignProposalRequest { -// tendermint.types.Proposal proposal = 1; -// string chain_id = 2; -//} - -// SignedProposalResponse is response containing a signed proposal or an error -//message SignedProposalResponse { -// tendermint.types.Proposal proposal = 1 [(gogoproto.nullable) = false]; -// RemoteSignerError error = 2; -//} - // VRFProofRequest is a PrivValidatorSocket message containing a message to generate proof. message VRFProofRequest { bytes message = 1; @@ -68,12 +19,6 @@ message VRFProofResponse { tendermint.privval.RemoteSignerError error = 2; } -// PingRequest is a request to confirm that the connection is alive. -//message PingRequest {} - -// PingResponse is a response to confirm that the connection is alive. -//message PingResponse {} - message Message { oneof sum { tendermint.privval.PubKeyRequest pub_key_request = 1; diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index 3fe0a31be..1bcb6f1a1 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -24,23 +24,6 @@ message ABCIResponses { tendermint.abci.ResponseBeginBlock begin_block = 3; } -// ValidatorsInfo represents the latest validator set, or the last height it changed -//message ValidatorsInfo { -// tendermint.types.ValidatorSet validator_set = 1; -// int64 last_height_changed = 2; -//} - -// ConsensusParamsInfo represents the latest consensus params, or the last height it changed -//message ConsensusParamsInfo { -// tendermint.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false]; -// int64 last_height_changed = 2; -//} - -//message Version { -// tendermint.version.Consensus consensus = 1 [(gogoproto.nullable) = false]; -// string software = 2; -//} - message State { tendermint.state.Version version = 1 [(gogoproto.nullable) = false]; diff --git a/proto/ostracon/types/types.proto b/proto/ostracon/types/types.proto index ee4cdf42d..f483e7fb7 100644 --- a/proto/ostracon/types/types.proto +++ b/proto/ostracon/types/types.proto @@ -10,49 +10,6 @@ import "tendermint/version/types.proto"; import "tendermint/types/types.proto"; import "tendermint/types/validator.proto"; -// BlockIdFlag indicates which BlcokID the signature is for -//enum BlockIDFlag { -// option (gogoproto.goproto_enum_stringer) = true; -// option (gogoproto.goproto_enum_prefix) = false; -// -// BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; -// BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; -// BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; -// BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; -//} - -// SignedMsgType is a type of signed message in the consensus. -//enum SignedMsgType { -// option (gogoproto.goproto_enum_stringer) = true; -// option (gogoproto.goproto_enum_prefix) = false; -// -// SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; -// // Votes -// SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; -// SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; -// -// // Proposals -// SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; -//} - -// PartsetHeader -//message PartSetHeader { -// uint32 total = 1; -// bytes hash = 2; -//} - -//message Part { -// uint32 index = 1; -// bytes bytes = 2; -// tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; -//} - -// BlockID -//message BlockID { -// bytes hash = 1; -// PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; -//} - // -------------------------------- // Header defines the structure of an Ostracon block header. @@ -89,57 +46,6 @@ message Header { bytes proof = 1001; } -// Data contains the set of transactions included in the block -//message Data { -// // Txs that will be applied by state @ block.Height+1. -// // NOTE: not all txs here are valid. We're just agreeing on the order first. -// // This means that block.AppHash does not include these txs. -// repeated bytes txs = 1; -//} - -// Vote represents a prevote, precommit, or commit vote from validators for -// consensus. -//message Vote { -// SignedMsgType type = 1; -// int64 height = 2; -// int32 round = 3; -// BlockID block_id = 4 -// [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. -// google.protobuf.Timestamp timestamp = 5 -// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -// bytes validator_address = 6; -// int32 validator_index = 7; -// bytes signature = 8; -//} - -// Commit contains the evidence that a block was committed by a set of validators. -//message Commit { -// int64 height = 1; -// int32 round = 2; -// tendermint.types.BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; -// repeated tendermint.types.CommitSig signatures = 4 [(gogoproto.nullable) = false]; -//} - -// CommitSig is a part of the Vote included in a Commit. -//message CommitSig { -// BlockIDFlag block_id_flag = 1; -// bytes validator_address = 2; -// google.protobuf.Timestamp timestamp = 3 -// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -// bytes signature = 4; -//} - -//message Proposal { -// SignedMsgType type = 1; -// int64 height = 2; -// int32 round = 3; -// int32 pol_round = 4; -// BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; -// google.protobuf.Timestamp timestamp = 6 -// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -// bytes signature = 7; -//} - message SignedHeader { Header header = 1; tendermint.types.Commit commit = 2; @@ -156,10 +62,3 @@ message BlockMeta { Header header = 3 [(gogoproto.nullable) = false]; int64 num_txs = 4; } - -// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. -//message TxProof { -// bytes root_hash = 1; -// bytes data = 2; -// tendermint.crypto.Proof proof = 3; -//} diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index dee9aab27..474bd1bf7 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -279,13 +279,13 @@ func (app *Application) Rollback() error { } // validatorUpdates generates a validator set update. -func (app *Application) validatorUpdates(height uint64) (abci.ValidatorUpdates, error) { +func (app *Application) validatorUpdates(height uint64) (ocabci.ValidatorUpdates, error) { updates := app.cfg.ValidatorUpdates[fmt.Sprintf("%v", height)] if len(updates) == 0 { return nil, nil } - valUpdates := abci.ValidatorUpdates{} + valUpdates := ocabci.ValidatorUpdates{} for keyString, power := range updates { keyBytes, err := base64.StdEncoding.DecodeString(keyString) From 93d0293d5a3f8e3feab8c3a7d45af56deb1999d7 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 25 Jan 2023 18:16:35 +0900 Subject: [PATCH 19/25] chore: fix proto lint error. --- proto/ostracon/state/types.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index 1bcb6f1a1..13820cea8 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -11,7 +11,6 @@ import "tendermint/types/params.proto"; import "tendermint/types/types.proto"; import "tendermint/version/types.proto"; import "google/protobuf/timestamp.proto"; -import "tendermint/types/types.proto"; import "tendermint/state/types.proto"; import "tendermint/abci/types.proto"; From c545fd0e92add1c6b5be6abf4af1f8876e9de000 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 25 Jan 2023 18:19:54 +0900 Subject: [PATCH 20/25] chore: apply proto-format --- proto/ostracon/abci/types.proto | 34 +++++----- proto/ostracon/blockchain/types.proto | 2 +- proto/ostracon/privval/types.proto | 6 +- proto/ostracon/rpc/grpc/types.proto | 2 +- proto/ostracon/state/types.pb.go | 91 +++++++++++++-------------- proto/ostracon/state/types.proto | 6 +- proto/ostracon/types/block.proto | 4 +- proto/ostracon/types/evidence.proto | 8 +-- proto/ostracon/types/types.proto | 16 ++--- 9 files changed, 84 insertions(+), 85 deletions(-) diff --git a/proto/ostracon/abci/types.proto b/proto/ostracon/abci/types.proto index 6b974bd23..1b607fefd 100644 --- a/proto/ostracon/abci/types.proto +++ b/proto/ostracon/abci/types.proto @@ -28,7 +28,7 @@ message Request { tendermint.abci.RequestSetOption set_option = 4; tendermint.abci.RequestInitChain init_chain = 5; tendermint.abci.RequestQuery query = 6; - RequestBeginBlock begin_block = 7; + RequestBeginBlock begin_block = 7; tendermint.abci.RequestCheckTx check_tx = 8; tendermint.abci.RequestDeliverTx deliver_tx = 9; tendermint.abci.RequestEndBlock end_block = 10; @@ -37,16 +37,16 @@ message Request { tendermint.abci.RequestOfferSnapshot offer_snapshot = 13; tendermint.abci.RequestLoadSnapshotChunk load_snapshot_chunk = 14; tendermint.abci.RequestApplySnapshotChunk apply_snapshot_chunk = 15; - RequestBeginRecheckTx begin_recheck_tx = 1000; // 16~99 are reserved for merging original tendermint - RequestEndRecheckTx end_recheck_tx = 1001; + RequestBeginRecheckTx begin_recheck_tx = 1000; // 16~99 are reserved for merging original tendermint + RequestEndRecheckTx end_recheck_tx = 1001; } } message RequestBeginBlock { - bytes hash = 1; - ostracon.types.Header header = 2 [(gogoproto.nullable) = false]; - tendermint.abci.LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; - repeated tendermint.abci.Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; + bytes hash = 1; + ostracon.types.Header header = 2 [(gogoproto.nullable) = false]; + tendermint.abci.LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + repeated tendermint.abci.Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; } message RequestBeginRecheckTx { @@ -70,7 +70,7 @@ message Response { tendermint.abci.ResponseInitChain init_chain = 6; tendermint.abci.ResponseQuery query = 7; tendermint.abci.ResponseBeginBlock begin_block = 8; - ResponseCheckTx check_tx = 9; + ResponseCheckTx check_tx = 9; tendermint.abci.ResponseDeliverTx deliver_tx = 10; tendermint.abci.ResponseEndBlock end_block = 11; tendermint.abci.ResponseCommit commit = 12; @@ -78,19 +78,19 @@ message Response { tendermint.abci.ResponseOfferSnapshot offer_snapshot = 14; tendermint.abci.ResponseLoadSnapshotChunk load_snapshot_chunk = 15; tendermint.abci.ResponseApplySnapshotChunk apply_snapshot_chunk = 16; - ResponseBeginRecheckTx begin_recheck_tx = 1000; // 17~99 are reserved for merging original tendermint - ResponseEndRecheckTx end_recheck_tx = 1001; + ResponseBeginRecheckTx begin_recheck_tx = 1000; // 17~99 are reserved for merging original tendermint + ResponseEndRecheckTx end_recheck_tx = 1001; } } message ResponseCheckTx { - uint32 code = 1; - bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 gas_wanted = 5 [json_name = "gas_wanted"]; - int64 gas_used = 6 [json_name = "gas_used"]; - repeated tendermint.abci.Event events = 7 + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated tendermint.abci.Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; string codespace = 8; string sender = 9; // MEMO: not used, just reservation to implement https://github.com/tendermint/tendermint/pull/6740 first diff --git a/proto/ostracon/blockchain/types.proto b/proto/ostracon/blockchain/types.proto index 250b5917a..142b01d82 100644 --- a/proto/ostracon/blockchain/types.proto +++ b/proto/ostracon/blockchain/types.proto @@ -15,7 +15,7 @@ message Message { oneof sum { tendermint.blockchain.BlockRequest block_request = 1; tendermint.blockchain.NoBlockResponse no_block_response = 2; - BlockResponse block_response = 3; + BlockResponse block_response = 3; tendermint.blockchain.StatusRequest status_request = 4; tendermint.blockchain.StatusResponse status_response = 5; } diff --git a/proto/ostracon/privval/types.proto b/proto/ostracon/privval/types.proto index 8b0b13033..2613df611 100644 --- a/proto/ostracon/privval/types.proto +++ b/proto/ostracon/privval/types.proto @@ -15,7 +15,7 @@ message VRFProofRequest { // VRFProofResponse is a PrivValidatorSocket message containing a Proof. message VRFProofResponse { - bytes proof = 1; + bytes proof = 1; tendermint.privval.RemoteSignerError error = 2; } @@ -29,7 +29,7 @@ message Message { tendermint.privval.SignedProposalResponse signed_proposal_response = 6; tendermint.privval.PingRequest ping_request = 7; tendermint.privval.PingResponse ping_response = 8; - VRFProofRequest vrf_proof_request = 1000; - VRFProofResponse vrf_proof_response = 1001; + VRFProofRequest vrf_proof_request = 1000; + VRFProofResponse vrf_proof_response = 1001; } } diff --git a/proto/ostracon/rpc/grpc/types.proto b/proto/ostracon/rpc/grpc/types.proto index b6d933a7c..705bfa9bb 100644 --- a/proto/ostracon/rpc/grpc/types.proto +++ b/proto/ostracon/rpc/grpc/types.proto @@ -20,7 +20,7 @@ message RequestBroadcastTx { message ResponsePing {} message ResponseBroadcastTx { - ostracon.abci.ResponseCheckTx check_tx = 1; + ostracon.abci.ResponseCheckTx check_tx = 1; tendermint.abci.ResponseDeliverTx deliver_tx = 2; } diff --git a/proto/ostracon/state/types.pb.go b/proto/ostracon/state/types.pb.go index 710c11509..def5b4f77 100644 --- a/proto/ostracon/state/types.pb.go +++ b/proto/ostracon/state/types.pb.go @@ -273,52 +273,51 @@ func init() { func init() { proto.RegisterFile("ostracon/state/types.proto", fileDescriptor_898987a4421067cd) } var fileDescriptor_898987a4421067cd = []byte{ - // 708 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0xcf, 0x4e, 0xdb, 0x4a, - 0x14, 0xc6, 0xe3, 0x1b, 0x20, 0x61, 0x4c, 0x92, 0x7b, 0x7d, 0xef, 0xc2, 0x84, 0x5b, 0x27, 0xa5, - 0xff, 0xa2, 0x4a, 0x75, 0x24, 0xba, 0xea, 0xa6, 0x52, 0x9d, 0x54, 0x10, 0x09, 0x55, 0xc8, 0x20, - 0x16, 0xdd, 0x58, 0x13, 0x7b, 0xb0, 0x47, 0x75, 0x3c, 0x96, 0x67, 0x82, 0xe8, 0x2b, 0x74, 0xc5, - 0x63, 0xb1, 0x64, 0x59, 0x75, 0x41, 0xab, 0xb0, 0xe9, 0x63, 0x54, 0x33, 0xe3, 0x71, 0x06, 0x22, - 0x24, 0x76, 0x93, 0xf3, 0x7d, 0xe7, 0xa7, 0xcf, 0x67, 0x8e, 0x1d, 0xd0, 0x25, 0x94, 0x15, 0x30, - 0x24, 0xd9, 0x90, 0x32, 0xc8, 0xd0, 0x90, 0x7d, 0xcd, 0x11, 0x75, 0xf3, 0x82, 0x30, 0x62, 0xb5, - 0x95, 0xe6, 0x0a, 0xad, 0xfb, 0x5f, 0x4c, 0x62, 0x22, 0xa4, 0x21, 0x3f, 0x49, 0x57, 0x77, 0xbb, - 0x22, 0xc0, 0x69, 0x88, 0x75, 0x40, 0x77, 0x09, 0x17, 0xd5, 0x3b, 0x5a, 0x9f, 0xa1, 0x2c, 0x42, - 0xc5, 0x0c, 0x67, 0xac, 0x54, 0xcf, 0x61, 0x8a, 0x23, 0xc8, 0x48, 0x51, 0x3a, 0x9e, 0xac, 0x38, - 0x72, 0x58, 0xc0, 0x99, 0x02, 0xfc, 0xbf, 0x22, 0xeb, 0x78, 0x47, 0x53, 0xcf, 0x51, 0x41, 0xb1, - 0x0a, 0x51, 0xea, 0xbd, 0x98, 0x90, 0x38, 0x45, 0x43, 0xf1, 0x6b, 0x3a, 0x3f, 0x1b, 0x32, 0x3c, - 0x43, 0x94, 0xc1, 0x59, 0xfe, 0x28, 0xbc, 0xae, 0xae, 0x0c, 0xae, 0xbb, 0xa3, 0xa9, 0xf7, 0x87, - 0xb2, 0xfb, 0xc3, 0x00, 0xad, 0x0f, 0xde, 0x68, 0xe2, 0x23, 0x9a, 0x93, 0x8c, 0x22, 0x6a, 0x8d, - 0x80, 0x19, 0xa1, 0x14, 0x9f, 0xa3, 0x22, 0x60, 0x17, 0xd4, 0x36, 0xfa, 0xf5, 0x81, 0xb9, 0xb7, - 0xeb, 0x2e, 0x21, 0x2e, 0x87, 0xb8, 0xaa, 0x61, 0x2c, 0xbd, 0x27, 0x17, 0x3e, 0x88, 0xd4, 0x91, - 0x5a, 0xef, 0xc1, 0x26, 0xca, 0xa2, 0x60, 0x9a, 0x92, 0xf0, 0x8b, 0xfd, 0x57, 0xdf, 0x18, 0x98, - 0x7b, 0x4f, 0x1f, 0x44, 0x7c, 0xcc, 0x22, 0x8f, 0x1b, 0xfd, 0x26, 0x2a, 0x4f, 0xd6, 0x18, 0x98, - 0x53, 0x14, 0xe3, 0xac, 0x24, 0xd4, 0x05, 0xe1, 0xd9, 0x83, 0x04, 0x8f, 0x7b, 0x25, 0x03, 0x4c, - 0xab, 0xf3, 0xee, 0xb7, 0x06, 0x58, 0x3f, 0xe6, 0xf3, 0xb0, 0xde, 0x81, 0x46, 0x39, 0x77, 0xdb, - 0x10, 0xac, 0x6d, 0x9d, 0x25, 0x66, 0xe6, 0x9e, 0x4a, 0x83, 0xb7, 0x76, 0x75, 0xd3, 0xab, 0xf9, - 0xca, 0x6f, 0xbd, 0x04, 0xcd, 0x30, 0x81, 0x38, 0x0b, 0x70, 0x24, 0x9e, 0x64, 0xd3, 0x33, 0x17, - 0x37, 0xbd, 0xc6, 0x88, 0xd7, 0x26, 0x63, 0xbf, 0x21, 0xc4, 0x49, 0x64, 0xbd, 0x00, 0x6d, 0x9c, - 0x61, 0x86, 0x61, 0x1a, 0x24, 0x08, 0xc7, 0x09, 0xb3, 0xdb, 0x7d, 0x63, 0x50, 0xf7, 0x5b, 0x65, - 0xf5, 0x40, 0x14, 0xad, 0x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, 0xb2, 0xf5, 0x09, 0x3c, 0xd7, 0x83, - 0xdd, 0xe7, 0x57, 0xf1, 0x4c, 0x11, 0xaf, 0xbf, 0x8c, 0x77, 0x8f, 0xaf, 0x32, 0xaa, 0x45, 0x2c, - 0x10, 0x9d, 0xa7, 0x8c, 0x06, 0x09, 0xa4, 0x89, 0xbd, 0xd5, 0x37, 0x06, 0x5b, 0x72, 0x11, 0x7d, - 0x59, 0x3f, 0x80, 0x34, 0xb1, 0xb6, 0x41, 0x13, 0xe6, 0xb9, 0xb4, 0xb4, 0x84, 0xa5, 0x01, 0xf3, - 0x5c, 0x48, 0xaf, 0xca, 0xc1, 0xe7, 0x05, 0x21, 0x67, 0xd2, 0xf1, 0xbb, 0x21, 0x2c, 0x62, 0x55, - 0x8e, 0x78, 0x99, 0x1b, 0xbd, 0xfd, 0xab, 0x85, 0x63, 0x5c, 0x2f, 0x1c, 0xe3, 0xd7, 0xc2, 0x31, - 0x2e, 0x6f, 0x9d, 0xda, 0xf5, 0xad, 0x53, 0xfb, 0x7e, 0xeb, 0xd4, 0x3e, 0xbf, 0x89, 0x31, 0x4b, - 0xe6, 0x53, 0x37, 0x24, 0xb3, 0x61, 0x8a, 0x33, 0x34, 0xac, 0x3e, 0xd4, 0xf2, 0xf3, 0x7e, 0xf7, - 0x4f, 0x61, 0xba, 0x21, 0xaa, 0x6f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x58, 0x15, 0x8f, 0x75, - 0x2d, 0x06, 0x00, 0x00, + // 703 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x1b, 0xba, 0xad, 0x9d, 0xb3, 0xb6, 0x10, 0x38, 0x64, 0x1d, 0xa4, 0x65, 0xfc, 0xab, + 0x90, 0x48, 0xa5, 0x71, 0xe2, 0x82, 0x44, 0x5a, 0xb4, 0x55, 0x9a, 0xd0, 0x94, 0x4d, 0x3b, 0x70, + 0x89, 0x9c, 0xc4, 0x4b, 0x2c, 0xd2, 0x38, 0x8a, 0xdd, 0x69, 0x7c, 0x05, 0x4e, 0xfb, 0x58, 0x3b, + 0xee, 0x88, 0x38, 0x0c, 0xd4, 0x5d, 0xf8, 0x18, 0xc8, 0x76, 0x9c, 0x66, 0x2b, 0x93, 0x76, 0x73, + 0xde, 0xe7, 0x79, 0x7f, 0x7a, 0x6c, 0xbf, 0x31, 0xe8, 0x12, 0xca, 0x72, 0x18, 0x90, 0x74, 0x48, + 0x19, 0x64, 0x68, 0xc8, 0xbe, 0x67, 0x88, 0xda, 0x59, 0x4e, 0x18, 0x31, 0xda, 0x4a, 0xb3, 0x85, + 0xd6, 0x7d, 0x12, 0x91, 0x88, 0x08, 0x69, 0xc8, 0x57, 0xd2, 0xd5, 0xdd, 0x2c, 0x09, 0xd0, 0x0f, + 0x70, 0x15, 0xd0, 0x5d, 0xc0, 0x45, 0xf5, 0x86, 0xd6, 0x67, 0x28, 0x0d, 0x51, 0x3e, 0xc5, 0x29, + 0x2b, 0xd4, 0x53, 0x98, 0xe0, 0x10, 0x32, 0x92, 0x17, 0x8e, 0x67, 0x4b, 0x8e, 0x0c, 0xe6, 0x70, + 0xaa, 0x00, 0x4f, 0x97, 0xe4, 0x2a, 0xde, 0xaa, 0xa8, 0xa7, 0x28, 0xa7, 0x58, 0x85, 0x28, 0xf4, + 0x5e, 0x44, 0x48, 0x94, 0xa0, 0xa1, 0xf8, 0xf2, 0x67, 0x27, 0x43, 0x86, 0xa7, 0x88, 0x32, 0x38, + 0xcd, 0xfe, 0x83, 0x5f, 0x3a, 0x9a, 0xee, 0x56, 0x45, 0xbd, 0xbd, 0xed, 0xed, 0x5f, 0x1a, 0x68, + 0x7d, 0x72, 0x46, 0x13, 0x17, 0xd1, 0x8c, 0xa4, 0x14, 0x51, 0x63, 0x04, 0xf4, 0x10, 0x25, 0xf8, + 0x14, 0xe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0xa8, + 0x17, 0x43, 0x1a, 0x9b, 0x1b, 0x7d, 0x6d, 0xb0, 0x21, 0x07, 0xd1, 0x95, 0xf5, 0x3d, 0x48, 0x63, + 0x63, 0x13, 0x34, 0x61, 0x96, 0x49, 0x4b, 0x4b, 0x58, 0x1a, 0x30, 0xcb, 0x84, 0xf4, 0xa6, 0x38, + 0xf8, 0x2c, 0x27, 0xe4, 0x44, 0x3a, 0xfe, 0x36, 0x84, 0x45, 0x8c, 0xca, 0x01, 0x2f, 0x73, 0xa3, + 0xb3, 0x7b, 0x31, 0xb7, 0xb4, 0xcb, 0xb9, 0xa5, 0xfd, 0x99, 0x5b, 0xda, 0xf9, 0xb5, 0x55, 0xbb, + 0xbc, 0xb6, 0x6a, 0x3f, 0xaf, 0xad, 0xda, 0xd7, 0x77, 0x11, 0x66, 0xf1, 0xcc, 0xb7, 0x03, 0x32, + 0x1d, 0x26, 0x38, 0x45, 0xc3, 0xf2, 0x29, 0x96, 0x0f, 0xf8, 0xcd, 0x67, 0xdf, 0x5f, 0x13, 0xd5, + 0xf7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x82, 0xd1, 0xeb, 0x0f, 0x06, 0x00, 0x00, } func (m *ABCIResponses) Marshal() (dAtA []byte, err error) { diff --git a/proto/ostracon/state/types.proto b/proto/ostracon/state/types.proto index 13820cea8..87436ba90 100644 --- a/proto/ostracon/state/types.proto +++ b/proto/ostracon/state/types.proto @@ -31,7 +31,7 @@ message State { int64 initial_height = 14; // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) - int64 last_block_height = 3; + int64 last_block_height = 3; tendermint.types.BlockID last_block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"]; google.protobuf.Timestamp last_block_time = 5 @@ -46,12 +46,12 @@ message State { tendermint.types.ValidatorSet next_validators = 6; tendermint.types.ValidatorSet validators = 7; tendermint.types.ValidatorSet last_validators = 8; - int64 last_height_validators_changed = 9; + int64 last_height_validators_changed = 9; // Consensus parameters used for validating blocks. // Changes returned by EndBlock and updated after Commit. tendermint.types.ConsensusParams consensus_params = 10 [(gogoproto.nullable) = false]; - int64 last_height_consensus_params_changed = 11; + int64 last_height_consensus_params_changed = 11; // Merkle root of the results from executing prev block bytes last_results_hash = 12; diff --git a/proto/ostracon/types/block.proto b/proto/ostracon/types/block.proto index c60f0488c..756c223a3 100644 --- a/proto/ostracon/types/block.proto +++ b/proto/ostracon/types/block.proto @@ -10,7 +10,7 @@ import "tendermint/types/types.proto"; message Block { Header header = 1 [(gogoproto.nullable) = false]; - tendermint.types.Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.Data data = 2 [(gogoproto.nullable) = false]; ostracon.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; - tendermint.types.Commit last_commit = 4; + tendermint.types.Commit last_commit = 4; } diff --git a/proto/ostracon/types/evidence.proto b/proto/ostracon/types/evidence.proto index 82c5c5bb8..688d7e9e0 100644 --- a/proto/ostracon/types/evidence.proto +++ b/proto/ostracon/types/evidence.proto @@ -27,11 +27,11 @@ message DuplicateVoteEvidence { // LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. message LightClientAttackEvidence { - ostracon.types.LightBlock conflicting_block = 1; - int64 common_height = 2; + ostracon.types.LightBlock conflicting_block = 1; + int64 common_height = 2; repeated tendermint.types.Validator byzantine_validators = 3; - int64 total_voting_power = 4; // total voting power - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + int64 total_voting_power = 4; // total voting power + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } message EvidenceList { diff --git a/proto/ostracon/types/types.proto b/proto/ostracon/types/types.proto index f483e7fb7..28ea9fbed 100644 --- a/proto/ostracon/types/types.proto +++ b/proto/ostracon/types/types.proto @@ -16,9 +16,9 @@ import "tendermint/types/validator.proto"; message Header { // basic block info tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; - string chain_id = 2 [(gogoproto.customname) = "ChainID"]; - int64 height = 3; - google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // prev block info tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false]; @@ -47,18 +47,18 @@ message Header { } message SignedHeader { - Header header = 1; + Header header = 1; tendermint.types.Commit commit = 2; } message LightBlock { - SignedHeader signed_header = 1; + SignedHeader signed_header = 1; tendermint.types.ValidatorSet validator_set = 2; } message BlockMeta { tendermint.types.BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - int64 block_size = 2; - Header header = 3 [(gogoproto.nullable) = false]; - int64 num_txs = 4; + int64 block_size = 2; + Header header = 3 [(gogoproto.nullable) = false]; + int64 num_txs = 4; } From 2ab8ad1d096fec07c71d3eefa0cab82334cb80b0 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 27 Jan 2023 14:40:13 +0900 Subject: [PATCH 21/25] chore: modify import alias to reduce the difference previous codes. --- abci/client/client.go | 56 +++---- abci/client/grpc_client.go | 56 +++---- abci/client/grpc_client_test.go | 46 +++--- abci/client/local_client.go | 58 +++---- abci/client/local_client_test.go | 46 +++--- abci/client/mocks/client.go | 184 ++++++++++----------- abci/client/socket_client.go | 54 +++--- abci/client/socket_client_test.go | 50 +++--- abci/cmd/abci-cli/abci-cli.go | 18 +- abci/example/counter/counter.go | 42 ++--- abci/example/example_test.go | 18 +- abci/example/kvstore/helpers.go | 10 +- abci/example/kvstore/kvstore.go | 26 +-- abci/example/kvstore/kvstore_test.go | 54 +++--- abci/example/kvstore/persistent_kvstore.go | 82 ++++----- abci/server/grpc_server.go | 8 +- abci/server/server.go | 11 +- abci/server/socket_server.go | 94 +++++------ abci/tests/benchmarks/parallel/parallel.go | 10 +- abci/tests/benchmarks/simple/simple.go | 20 +-- abci/tests/server/client.go | 12 +- abci/tests/test_app/app.go | 6 +- abci/tests/test_app/main.go | 12 +- abci/types/application.go | 116 ++++++------- abci/types/messages.go | 60 +++---- abci/types/messages_test.go | 22 +-- abci/types/mocks/application.go | 104 ++++++------ abci/types/pubkey.go | 6 +- abci/types/util.go | 4 +- blockchain/v0/reactor.go | 28 ++-- blockchain/v1/reactor.go | 34 ++-- blockchain/v1/reactor_test.go | 4 +- blockchain/v2/io.go | 14 +- blockchain/v2/reactor.go | 14 +- blockchain/v2/reactor_test.go | 18 +- consensus/replay_stubs.go | 6 +- consensus/replay_test.go | 8 +- consensus/state_test.go | 2 +- evidence/pool.go | 8 +- evidence/reactor.go | 8 +- light/store/db/db.go | 4 +- mempool/cache_test.go | 4 +- mempool/mempool_test.go | 12 +- p2p/conn/connection.go | 3 +- p2p/conn/connection_test.go | 4 +- privval/msgs_test.go | 26 +-- proxy/app_conn.go | 62 +++---- proxy/app_conn_test.go | 10 +- proxy/client.go | 8 +- proxy/mocks/app_conn_consensus.go | 42 ++--- proxy/mocks/app_conn_mempool.go | 20 +-- proxy/mocks/app_conn_query.go | 30 ++-- proxy/mocks/app_conn_snapshot.go | 42 ++--- rpc/client/event_test.go | 4 +- rpc/client/rpc_test.go | 14 +- rpc/core/blocks_test.go | 4 +- rpc/core/types/responses.go | 4 +- rpc/test/helpers.go | 6 +- state/execution.go | 10 +- state/export_test.go | 4 +- state/helpers_test.go | 14 +- state/mocks/store.go | 24 +-- state/state_test.go | 30 ++-- statesync/messages_test.go | 4 +- statesync/stateprovider_test.go | 4 +- test/kms/bench_test.go | 7 +- types/block_meta.go | 8 +- types/event_bus.go | 8 +- types/light.go | 14 +- types/protobuf_test.go | 4 +- 70 files changed, 929 insertions(+), 930 deletions(-) diff --git a/abci/client/client.go b/abci/client/client.go index 7b37e5b15..54e38939f 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" @@ -31,39 +31,39 @@ type Client interface { FlushAsync(ResponseCallback) *ReqRes EchoAsync(string, ResponseCallback) *ReqRes - InfoAsync(abci.RequestInfo, ResponseCallback) *ReqRes - SetOptionAsync(abci.RequestSetOption, ResponseCallback) *ReqRes - DeliverTxAsync(abci.RequestDeliverTx, ResponseCallback) *ReqRes - CheckTxAsync(abci.RequestCheckTx, ResponseCallback) *ReqRes - QueryAsync(abci.RequestQuery, ResponseCallback) *ReqRes + InfoAsync(types.RequestInfo, ResponseCallback) *ReqRes + SetOptionAsync(types.RequestSetOption, ResponseCallback) *ReqRes + DeliverTxAsync(types.RequestDeliverTx, ResponseCallback) *ReqRes + CheckTxAsync(types.RequestCheckTx, ResponseCallback) *ReqRes + QueryAsync(types.RequestQuery, ResponseCallback) *ReqRes CommitAsync(ResponseCallback) *ReqRes - InitChainAsync(abci.RequestInitChain, ResponseCallback) *ReqRes + InitChainAsync(types.RequestInitChain, ResponseCallback) *ReqRes BeginBlockAsync(ocabci.RequestBeginBlock, ResponseCallback) *ReqRes - EndBlockAsync(abci.RequestEndBlock, ResponseCallback) *ReqRes + EndBlockAsync(types.RequestEndBlock, ResponseCallback) *ReqRes BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx, ResponseCallback) *ReqRes EndRecheckTxAsync(ocabci.RequestEndRecheckTx, ResponseCallback) *ReqRes - ListSnapshotsAsync(abci.RequestListSnapshots, ResponseCallback) *ReqRes - OfferSnapshotAsync(abci.RequestOfferSnapshot, ResponseCallback) *ReqRes - LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk, ResponseCallback) *ReqRes - ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk, ResponseCallback) *ReqRes - - FlushSync() (*abci.ResponseFlush, error) - EchoSync(string) (*abci.ResponseEcho, error) - InfoSync(abci.RequestInfo) (*abci.ResponseInfo, error) - SetOptionSync(abci.RequestSetOption) (*abci.ResponseSetOption, error) - DeliverTxSync(abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) - CheckTxSync(abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) - QuerySync(abci.RequestQuery) (*abci.ResponseQuery, error) - CommitSync() (*abci.ResponseCommit, error) - InitChainSync(abci.RequestInitChain) (*abci.ResponseInitChain, error) - BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) - EndBlockSync(abci.RequestEndBlock) (*abci.ResponseEndBlock, error) + ListSnapshotsAsync(types.RequestListSnapshots, ResponseCallback) *ReqRes + OfferSnapshotAsync(types.RequestOfferSnapshot, ResponseCallback) *ReqRes + LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk, ResponseCallback) *ReqRes + ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk, ResponseCallback) *ReqRes + + FlushSync() (*types.ResponseFlush, error) + EchoSync(string) (*types.ResponseEcho, error) + InfoSync(types.RequestInfo) (*types.ResponseInfo, error) + SetOptionSync(types.RequestSetOption) (*types.ResponseSetOption, error) + DeliverTxSync(types.RequestDeliverTx) (*types.ResponseDeliverTx, error) + CheckTxSync(types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) + QuerySync(types.RequestQuery) (*types.ResponseQuery, error) + CommitSync() (*types.ResponseCommit, error) + InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error) + BeginBlockSync(ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) + EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error) BeginRecheckTxSync(ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) EndRecheckTxSync(ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) - ListSnapshotsSync(abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) - OfferSnapshotSync(abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) - LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) + ListSnapshotsSync(types.RequestListSnapshots) (*types.ResponseListSnapshots, error) + OfferSnapshotSync(types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) + LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunkSync(types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) } //---------------------------------------- diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index a951219f1..456530f92 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -9,7 +9,7 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ocabci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" @@ -73,7 +73,7 @@ RETRY_LOOP: ENSURE_CONNECTED: for { - _, err := client.Echo(context.Background(), &abci.RequestEcho{Message: "hello"}, grpc.WaitForReady(true)) + _, err := client.Echo(context.Background(), &types.RequestEcho{Message: "hello"}, grpc.WaitForReady(true)) if err == nil { break ENSURE_CONNECTED } @@ -156,7 +156,7 @@ func (cli *grpcClient) FlushAsync(cb ResponseCallback) *ReqRes { return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Flush{Flush: res}}, cb) } -func (cli *grpcClient) InfoAsync(params abci.RequestInfo, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) InfoAsync(params types.RequestInfo, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestInfo(params) res, err := cli.client.Info(context.Background(), req.GetInfo(), grpc.WaitForReady(true)) if err != nil { @@ -165,7 +165,7 @@ func (cli *grpcClient) InfoAsync(params abci.RequestInfo, cb ResponseCallback) * return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Info{Info: res}}, cb) } -func (cli *grpcClient) SetOptionAsync(params abci.RequestSetOption, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) SetOptionAsync(params types.RequestSetOption, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestSetOption(params) res, err := cli.client.SetOption(context.Background(), req.GetSetOption(), grpc.WaitForReady(true)) if err != nil { @@ -174,7 +174,7 @@ func (cli *grpcClient) SetOptionAsync(params abci.RequestSetOption, cb ResponseC return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_SetOption{SetOption: res}}, cb) } -func (cli *grpcClient) DeliverTxAsync(params abci.RequestDeliverTx, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) DeliverTxAsync(params types.RequestDeliverTx, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestDeliverTx(params) res, err := cli.client.DeliverTx(context.Background(), req.GetDeliverTx(), grpc.WaitForReady(true)) if err != nil { @@ -183,7 +183,7 @@ func (cli *grpcClient) DeliverTxAsync(params abci.RequestDeliverTx, cb ResponseC return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_DeliverTx{DeliverTx: res}}, cb) } -func (cli *grpcClient) CheckTxAsync(params abci.RequestCheckTx, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) CheckTxAsync(params types.RequestCheckTx, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestCheckTx(params) res, err := cli.client.CheckTx(context.Background(), req.GetCheckTx(), grpc.WaitForReady(true)) if err != nil { @@ -192,7 +192,7 @@ func (cli *grpcClient) CheckTxAsync(params abci.RequestCheckTx, cb ResponseCallb return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_CheckTx{CheckTx: res}}, cb) } -func (cli *grpcClient) QueryAsync(params abci.RequestQuery, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) QueryAsync(params types.RequestQuery, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestQuery(params) res, err := cli.client.Query(context.Background(), req.GetQuery(), grpc.WaitForReady(true)) if err != nil { @@ -210,7 +210,7 @@ func (cli *grpcClient) CommitAsync(cb ResponseCallback) *ReqRes { return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_Commit{Commit: res}}, cb) } -func (cli *grpcClient) InitChainAsync(params abci.RequestInitChain, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) InitChainAsync(params types.RequestInitChain, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestInitChain(params) res, err := cli.client.InitChain(context.Background(), req.GetInitChain(), grpc.WaitForReady(true)) if err != nil { @@ -228,7 +228,7 @@ func (cli *grpcClient) BeginBlockAsync(params ocabci.RequestBeginBlock, cb Respo return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_BeginBlock{BeginBlock: res}}, cb) } -func (cli *grpcClient) EndBlockAsync(params abci.RequestEndBlock, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) EndBlockAsync(params types.RequestEndBlock, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestEndBlock(params) res, err := cli.client.EndBlock(context.Background(), req.GetEndBlock(), grpc.WaitForReady(true)) if err != nil { @@ -255,7 +255,7 @@ func (cli *grpcClient) EndRecheckTxAsync(params ocabci.RequestEndRecheckTx, cb R return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_EndRecheckTx{EndRecheckTx: res}}, cb) } -func (cli *grpcClient) ListSnapshotsAsync(params abci.RequestListSnapshots, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) ListSnapshotsAsync(params types.RequestListSnapshots, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestListSnapshots(params) res, err := cli.client.ListSnapshots(context.Background(), req.GetListSnapshots(), grpc.WaitForReady(true)) if err != nil { @@ -264,7 +264,7 @@ func (cli *grpcClient) ListSnapshotsAsync(params abci.RequestListSnapshots, cb R return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_ListSnapshots{ListSnapshots: res}}, cb) } -func (cli *grpcClient) OfferSnapshotAsync(params abci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) OfferSnapshotAsync(params types.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestOfferSnapshot(params) res, err := cli.client.OfferSnapshot(context.Background(), req.GetOfferSnapshot(), grpc.WaitForReady(true)) if err != nil { @@ -273,7 +273,7 @@ func (cli *grpcClient) OfferSnapshotAsync(params abci.RequestOfferSnapshot, cb R return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_OfferSnapshot{OfferSnapshot: res}}, cb) } -func (cli *grpcClient) LoadSnapshotChunkAsync(params abci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) LoadSnapshotChunkAsync(params types.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestLoadSnapshotChunk(params) res, err := cli.client.LoadSnapshotChunk(context.Background(), req.GetLoadSnapshotChunk(), grpc.WaitForReady(true)) if err != nil { @@ -282,7 +282,7 @@ func (cli *grpcClient) LoadSnapshotChunkAsync(params abci.RequestLoadSnapshotChu return cli.finishAsyncCall(req, &ocabci.Response{Value: &ocabci.Response_LoadSnapshotChunk{LoadSnapshotChunk: res}}, cb) } -func (cli *grpcClient) ApplySnapshotChunkAsync(params abci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { +func (cli *grpcClient) ApplySnapshotChunkAsync(params types.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { req := ocabci.ToRequestApplySnapshotChunk(params) res, err := cli.client.ApplySnapshotChunk(context.Background(), req.GetApplySnapshotChunk(), grpc.WaitForReady(true)) if err != nil { @@ -310,68 +310,68 @@ func (cli *grpcClient) finishAsyncCall(req *ocabci.Request, res *ocabci.Response } // ---------------------------------------- -func (cli *grpcClient) FlushSync() (*abci.ResponseFlush, error) { +func (cli *grpcClient) FlushSync() (*types.ResponseFlush, error) { reqres := cli.FlushAsync(nil) reqres.Wait() return reqres.Response.GetFlush(), cli.Error() } -func (cli *grpcClient) EchoSync(msg string) (*abci.ResponseEcho, error) { +func (cli *grpcClient) EchoSync(msg string) (*types.ResponseEcho, error) { reqres := cli.EchoAsync(msg, nil) reqres.Wait() // StopForError should already have been called if error is set return reqres.Response.GetEcho(), cli.Error() } -func (cli *grpcClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { +func (cli *grpcClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { reqres := cli.InfoAsync(req, nil) reqres.Wait() return reqres.Response.GetInfo(), cli.Error() } -func (cli *grpcClient) SetOptionSync(req abci.RequestSetOption) (*abci.ResponseSetOption, error) { +func (cli *grpcClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { reqres := cli.SetOptionAsync(req, nil) reqres.Wait() return reqres.Response.GetSetOption(), cli.Error() } -func (cli *grpcClient) DeliverTxSync(params abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { +func (cli *grpcClient) DeliverTxSync(params types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { reqres := cli.DeliverTxAsync(params, nil) reqres.Wait() return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *grpcClient) CheckTxSync(params abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (cli *grpcClient) CheckTxSync(params types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { reqres := cli.CheckTxAsync(params, nil) reqres.Wait() return reqres.Response.GetCheckTx(), cli.Error() } -func (cli *grpcClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, error) { +func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { reqres := cli.QueryAsync(req, nil) reqres.Wait() return reqres.Response.GetQuery(), cli.Error() } -func (cli *grpcClient) CommitSync() (*abci.ResponseCommit, error) { +func (cli *grpcClient) CommitSync() (*types.ResponseCommit, error) { reqres := cli.CommitAsync(nil) reqres.Wait() return reqres.Response.GetCommit(), cli.Error() } -func (cli *grpcClient) InitChainSync(params abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (cli *grpcClient) InitChainSync(params types.RequestInitChain) (*types.ResponseInitChain, error) { reqres := cli.InitChainAsync(params, nil) reqres.Wait() return reqres.Response.GetInitChain(), cli.Error() } -func (cli *grpcClient) BeginBlockSync(params ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { +func (cli *grpcClient) BeginBlockSync(params ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) { reqres := cli.BeginBlockAsync(params, nil) reqres.Wait() return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *grpcClient) EndBlockSync(params abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (cli *grpcClient) EndBlockSync(params types.RequestEndBlock) (*types.ResponseEndBlock, error) { reqres := cli.EndBlockAsync(params, nil) reqres.Wait() return reqres.Response.GetEndBlock(), cli.Error() @@ -389,27 +389,27 @@ func (cli *grpcClient) EndRecheckTxSync(params ocabci.RequestEndRecheckTx) (*oca return reqres.Response.GetEndRecheckTx(), cli.Error() } -func (cli *grpcClient) ListSnapshotsSync(params abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { +func (cli *grpcClient) ListSnapshotsSync(params types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { reqres := cli.ListSnapshotsAsync(params, nil) reqres.Wait() return reqres.Response.GetListSnapshots(), cli.Error() } -func (cli *grpcClient) OfferSnapshotSync(params abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { +func (cli *grpcClient) OfferSnapshotSync(params types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { reqres := cli.OfferSnapshotAsync(params, nil) reqres.Wait() return reqres.Response.GetOfferSnapshot(), cli.Error() } func (cli *grpcClient) LoadSnapshotChunkSync( - params abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { + params types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { reqres := cli.LoadSnapshotChunkAsync(params, nil) reqres.Wait() return reqres.Response.GetLoadSnapshotChunk(), cli.Error() } func (cli *grpcClient) ApplySnapshotChunkSync( - params abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { + params types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { reqres := cli.ApplySnapshotChunkAsync(params, nil) reqres.Wait() return reqres.Response.GetApplySnapshotChunk(), cli.Error() diff --git a/abci/client/grpc_client_test.go b/abci/client/grpc_client_test.go index eed8cc155..56915b77c 100644 --- a/abci/client/grpc_client_test.go +++ b/abci/client/grpc_client_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/abci/server" ocabci "github.com/line/ostracon/abci/types" @@ -31,21 +31,21 @@ func TestGrpcClientCalls(t *testing.T) { c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(abci.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(abci.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(abci.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(types.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(types.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(types.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(types.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(types.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) + c.InitChainAsync(types.RequestInitChain{}, getResponseCallback(t)) c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) + c.EndBlockAsync(types.RequestEndBlock{}, getResponseCallback(t)) c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) c.EndRecheckTxAsync(ocabci.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(abci.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(abci.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.ListSnapshotsAsync(types.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(types.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -53,31 +53,31 @@ func TestGrpcClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(abci.RequestInfo{}) + _, err = c.InfoSync(types.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(abci.RequestSetOption{}) + _, err = c.SetOptionSync(types.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(abci.RequestDeliverTx{}) + _, err = c.DeliverTxSync(types.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(abci.RequestCheckTx{}) + _, err = c.CheckTxSync(types.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(abci.RequestQuery{}) + _, err = c.QuerySync(types.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(abci.RequestInitChain{}) + _, err = c.InitChainSync(types.RequestInitChain{}) require.NoError(t, err) _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(abci.RequestEndBlock{}) + _, err = c.EndBlockSync(types.RequestEndBlock{}) require.NoError(t, err) _, err = c.BeginRecheckTxSync(ocabci.RequestBeginRecheckTx{}) @@ -86,15 +86,15 @@ func TestGrpcClientCalls(t *testing.T) { _, err = c.EndRecheckTxSync(ocabci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(abci.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(types.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(abci.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(types.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(types.RequestApplySnapshotChunk{}) require.NoError(t, err) } diff --git a/abci/client/local_client.go b/abci/client/local_client.go index 1fe7ed455..7180897ac 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -1,7 +1,7 @@ package abcicli import ( - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" @@ -77,7 +77,7 @@ func (app *localClient) EchoAsync(msg string, cb ResponseCallback) *ReqRes { return app.done(reqRes, ocabci.ToResponseEcho(msg)) } -func (app *localClient) InfoAsync(req abci.RequestInfo, cb ResponseCallback) *ReqRes { +func (app *localClient) InfoAsync(req types.RequestInfo, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -86,7 +86,7 @@ func (app *localClient) InfoAsync(req abci.RequestInfo, cb ResponseCallback) *Re return app.done(reqRes, ocabci.ToResponseInfo(res)) } -func (app *localClient) SetOptionAsync(req abci.RequestSetOption, cb ResponseCallback) *ReqRes { +func (app *localClient) SetOptionAsync(req types.RequestSetOption, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -95,7 +95,7 @@ func (app *localClient) SetOptionAsync(req abci.RequestSetOption, cb ResponseCal return app.done(reqRes, ocabci.ToResponseSetOption(res)) } -func (app *localClient) DeliverTxAsync(req abci.RequestDeliverTx, cb ResponseCallback) *ReqRes { +func (app *localClient) DeliverTxAsync(req types.RequestDeliverTx, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -104,7 +104,7 @@ func (app *localClient) DeliverTxAsync(req abci.RequestDeliverTx, cb ResponseCal return app.done(reqRes, ocabci.ToResponseDeliverTx(res)) } -func (app *localClient) CheckTxAsync(req abci.RequestCheckTx, cb ResponseCallback) *ReqRes { +func (app *localClient) CheckTxAsync(req types.RequestCheckTx, cb ResponseCallback) *ReqRes { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -119,7 +119,7 @@ func (app *localClient) CheckTxAsync(req abci.RequestCheckTx, cb ResponseCallbac return reqRes } -func (app *localClient) QueryAsync(req abci.RequestQuery, cb ResponseCallback) *ReqRes { +func (app *localClient) QueryAsync(req types.RequestQuery, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -137,7 +137,7 @@ func (app *localClient) CommitAsync(cb ResponseCallback) *ReqRes { return app.done(reqRes, ocabci.ToResponseCommit(res)) } -func (app *localClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { +func (app *localClient) InitChainAsync(req types.RequestInitChain, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -155,7 +155,7 @@ func (app *localClient) BeginBlockAsync(req ocabci.RequestBeginBlock, cb Respons return app.done(reqRes, ocabci.ToResponseBeginBlock(res)) } -func (app *localClient) EndBlockAsync(req abci.RequestEndBlock, cb ResponseCallback) *ReqRes { +func (app *localClient) EndBlockAsync(req types.RequestEndBlock, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -184,7 +184,7 @@ func (app *localClient) EndRecheckTxAsync(req ocabci.RequestEndRecheckTx, cb Res return app.done(reqRes, ocabci.ToResponseEndRecheckTx(res)) } -func (app *localClient) ListSnapshotsAsync(req abci.RequestListSnapshots, cb ResponseCallback) *ReqRes { +func (app *localClient) ListSnapshotsAsync(req types.RequestListSnapshots, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -193,7 +193,7 @@ func (app *localClient) ListSnapshotsAsync(req abci.RequestListSnapshots, cb Res return app.done(reqRes, ocabci.ToResponseListSnapshots(res)) } -func (app *localClient) OfferSnapshotAsync(req abci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { +func (app *localClient) OfferSnapshotAsync(req types.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -202,7 +202,7 @@ func (app *localClient) OfferSnapshotAsync(req abci.RequestOfferSnapshot, cb Res return app.done(reqRes, ocabci.ToResponseOfferSnapshot(res)) } -func (app *localClient) LoadSnapshotChunkAsync(req abci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { +func (app *localClient) LoadSnapshotChunkAsync(req types.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -211,7 +211,7 @@ func (app *localClient) LoadSnapshotChunkAsync(req abci.RequestLoadSnapshotChunk return app.done(reqRes, ocabci.ToResponseLoadSnapshotChunk(res)) } -func (app *localClient) ApplySnapshotChunkAsync(req abci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { +func (app *localClient) ApplySnapshotChunkAsync(req types.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -221,19 +221,19 @@ func (app *localClient) ApplySnapshotChunkAsync(req abci.RequestApplySnapshotChu } // ------------------------------------------------------- -func (app *localClient) FlushSync() (*abci.ResponseFlush, error) { - return &abci.ResponseFlush{}, nil +func (app *localClient) FlushSync() (*types.ResponseFlush, error) { + return &types.ResponseFlush{}, nil } -func (app *localClient) EchoSync(msg string) (*abci.ResponseEcho, error) { +func (app *localClient) EchoSync(msg string) (*types.ResponseEcho, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() - return &abci.ResponseEcho{Message: msg}, nil + return &types.ResponseEcho{Message: msg}, nil } -func (app *localClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { +func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -241,7 +241,7 @@ func (app *localClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, erro return &res, nil } -func (app *localClient) SetOptionSync(req abci.RequestSetOption) (*abci.ResponseSetOption, error) { +func (app *localClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -249,7 +249,7 @@ func (app *localClient) SetOptionSync(req abci.RequestSetOption) (*abci.Response return &res, nil } -func (app *localClient) DeliverTxSync(req abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { +func (app *localClient) DeliverTxSync(req types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -257,7 +257,7 @@ func (app *localClient) DeliverTxSync(req abci.RequestDeliverTx) (*abci.Response return &res, nil } -func (app *localClient) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (app *localClient) CheckTxSync(req types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { // NOTE: commented out for performance. delete all after commenting out all `app.mtx` // app.mtx.Lock() // defer app.mtx.Unlock() @@ -266,7 +266,7 @@ func (app *localClient) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseCh return &res, nil } -func (app *localClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, error) { +func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -274,7 +274,7 @@ func (app *localClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, e return &res, nil } -func (app *localClient) CommitSync() (*abci.ResponseCommit, error) { +func (app *localClient) CommitSync() (*types.ResponseCommit, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -282,7 +282,7 @@ func (app *localClient) CommitSync() (*abci.ResponseCommit, error) { return &res, nil } -func (app *localClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (app *localClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -290,7 +290,7 @@ func (app *localClient) InitChainSync(req abci.RequestInitChain) (*abci.Response return &res, nil } -func (app *localClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { +func (app *localClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -298,7 +298,7 @@ func (app *localClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.Resp return &res, nil } -func (app *localClient) EndBlockSync(req abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (app *localClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -324,7 +324,7 @@ func (app *localClient) EndRecheckTxSync(req ocabci.RequestEndRecheckTx) (*ocabc return &res, nil } -func (app *localClient) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { +func (app *localClient) ListSnapshotsSync(req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -332,7 +332,7 @@ func (app *localClient) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci. return &res, nil } -func (app *localClient) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { +func (app *localClient) OfferSnapshotSync(req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -341,7 +341,7 @@ func (app *localClient) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci. } func (app *localClient) LoadSnapshotChunkSync( - req abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { + req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { app.mtx.Lock() defer app.mtx.Unlock() @@ -350,7 +350,7 @@ func (app *localClient) LoadSnapshotChunkSync( } func (app *localClient) ApplySnapshotChunkSync( - req abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { + req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { app.mtx.Lock() defer app.mtx.Unlock() diff --git a/abci/client/local_client_test.go b/abci/client/local_client_test.go index ac218b348..c1b32e239 100644 --- a/abci/client/local_client_test.go +++ b/abci/client/local_client_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ocabci "github.com/line/ostracon/abci/types" "github.com/stretchr/testify/require" @@ -44,21 +44,21 @@ func TestLocalClientCalls(t *testing.T) { c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(abci.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(abci.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(abci.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(types.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(types.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(types.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(types.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(types.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) + c.InitChainAsync(types.RequestInitChain{}, getResponseCallback(t)) c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) + c.EndBlockAsync(types.RequestEndBlock{}, getResponseCallback(t)) c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) c.EndRecheckTxAsync(ocabci.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(abci.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(abci.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.ListSnapshotsAsync(types.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(types.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -66,31 +66,31 @@ func TestLocalClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(abci.RequestInfo{}) + _, err = c.InfoSync(types.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(abci.RequestSetOption{}) + _, err = c.SetOptionSync(types.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(abci.RequestDeliverTx{}) + _, err = c.DeliverTxSync(types.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(abci.RequestCheckTx{}) + _, err = c.CheckTxSync(types.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(abci.RequestQuery{}) + _, err = c.QuerySync(types.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(abci.RequestInitChain{}) + _, err = c.InitChainSync(types.RequestInitChain{}) require.NoError(t, err) _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(abci.RequestEndBlock{}) + _, err = c.EndBlockSync(types.RequestEndBlock{}) require.NoError(t, err) _, err = c.BeginRecheckTxSync(ocabci.RequestBeginRecheckTx{}) @@ -99,15 +99,15 @@ func TestLocalClientCalls(t *testing.T) { _, err = c.EndRecheckTxSync(ocabci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(abci.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(types.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(abci.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(types.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(types.RequestApplySnapshotChunk{}) require.NoError(t, err) } diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 5541254f8..bfdf6c12e 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - abci "github.com/tendermint/tendermint/abci/types" + types "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" ocabci "github.com/line/ostracon/abci/types" @@ -18,11 +18,11 @@ type Client struct { } // ApplySnapshotChunkAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) ApplySnapshotChunkAsync(_a0 abci.RequestApplySnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) ApplySnapshotChunkAsync(_a0 types.RequestApplySnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -34,20 +34,20 @@ func (_m *Client) ApplySnapshotChunkAsync(_a0 abci.RequestApplySnapshotChunk, _a } // ApplySnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *Client) ApplySnapshotChunkSync(_a0 abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { +func (_m *Client) ApplySnapshotChunkSync(_a0 types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk) *abci.ResponseApplySnapshotChunk); ok { + var r0 *types.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -73,15 +73,15 @@ func (_m *Client) BeginBlockAsync(_a0 ocabci.RequestBeginBlock, _a1 abcicli.Resp } // BeginBlockSync provides a mock function with given fields: _a0 -func (_m *Client) BeginBlockSync(_a0 ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { +func (_m *Client) BeginBlockSync(_a0 ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) *abci.ResponseBeginBlock); ok { + var r0 *types.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) *types.ResponseBeginBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseBeginBlock) + r0 = ret.Get(0).(*types.ResponseBeginBlock) } } @@ -135,11 +135,11 @@ func (_m *Client) BeginRecheckTxSync(_a0 ocabci.RequestBeginRecheckTx) (*ocabci. } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -151,11 +151,11 @@ func (_m *Client) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 abcicli.ResponseCall } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Client) CheckTxSync(_a0 abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (_m *Client) CheckTxSync(_a0 types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { ret := _m.Called(_a0) var r0 *ocabci.ResponseCheckTx - if rf, ok := ret.Get(0).(func(abci.RequestCheckTx) *ocabci.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(types.RequestCheckTx) *ocabci.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { @@ -164,7 +164,7 @@ func (_m *Client) CheckTxSync(_a0 abci.RequestCheckTx) (*ocabci.ResponseCheckTx, } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestCheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -190,15 +190,15 @@ func (_m *Client) CommitAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqRes { } // CommitSync provides a mock function with given fields: -func (_m *Client) CommitSync() (*abci.ResponseCommit, error) { +func (_m *Client) CommitSync() (*types.ResponseCommit, error) { ret := _m.Called() - var r0 *abci.ResponseCommit - if rf, ok := ret.Get(0).(func() *abci.ResponseCommit); ok { + var r0 *types.ResponseCommit + if rf, ok := ret.Get(0).(func() *types.ResponseCommit); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseCommit) + r0 = ret.Get(0).(*types.ResponseCommit) } } @@ -213,11 +213,11 @@ func (_m *Client) CommitSync() (*abci.ResponseCommit, error) { } // DeliverTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) DeliverTxAsync(_a0 abci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) DeliverTxAsync(_a0 types.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -229,20 +229,20 @@ func (_m *Client) DeliverTxAsync(_a0 abci.RequestDeliverTx, _a1 abcicli.Response } // DeliverTxSync provides a mock function with given fields: _a0 -func (_m *Client) DeliverTxSync(_a0 abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { +func (_m *Client) DeliverTxSync(_a0 types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseDeliverTx - if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx) *abci.ResponseDeliverTx); ok { + var r0 *types.ResponseDeliverTx + if rf, ok := ret.Get(0).(func(types.RequestDeliverTx) *types.ResponseDeliverTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseDeliverTx) + r0 = ret.Get(0).(*types.ResponseDeliverTx) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestDeliverTx) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestDeliverTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -268,15 +268,15 @@ func (_m *Client) EchoAsync(_a0 string, _a1 abcicli.ResponseCallback) *abcicli.R } // EchoSync provides a mock function with given fields: _a0 -func (_m *Client) EchoSync(_a0 string) (*abci.ResponseEcho, error) { +func (_m *Client) EchoSync(_a0 string) (*types.ResponseEcho, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseEcho - if rf, ok := ret.Get(0).(func(string) *abci.ResponseEcho); ok { + var r0 *types.ResponseEcho + if rf, ok := ret.Get(0).(func(string) *types.ResponseEcho); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseEcho) + r0 = ret.Get(0).(*types.ResponseEcho) } } @@ -291,11 +291,11 @@ func (_m *Client) EchoSync(_a0 string) (*abci.ResponseEcho, error) { } // EndBlockAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) EndBlockAsync(_a0 abci.RequestEndBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) EndBlockAsync(_a0 types.RequestEndBlock, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestEndBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestEndBlock, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -307,20 +307,20 @@ func (_m *Client) EndBlockAsync(_a0 abci.RequestEndBlock, _a1 abcicli.ResponseCa } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *Client) EndBlockSync(_a0 abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (_m *Client) EndBlockSync(_a0 types.RequestEndBlock) (*types.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *abci.ResponseEndBlock); ok { + var r0 *types.ResponseEndBlock + if rf, ok := ret.Get(0).(func(types.RequestEndBlock) *types.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseEndBlock) + r0 = ret.Get(0).(*types.ResponseEndBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestEndBlock) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestEndBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -399,15 +399,15 @@ func (_m *Client) FlushAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqRes { } // FlushSync provides a mock function with given fields: -func (_m *Client) FlushSync() (*abci.ResponseFlush, error) { +func (_m *Client) FlushSync() (*types.ResponseFlush, error) { ret := _m.Called() - var r0 *abci.ResponseFlush - if rf, ok := ret.Get(0).(func() *abci.ResponseFlush); ok { + var r0 *types.ResponseFlush + if rf, ok := ret.Get(0).(func() *types.ResponseFlush); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseFlush) + r0 = ret.Get(0).(*types.ResponseFlush) } } @@ -438,11 +438,11 @@ func (_m *Client) GetGlobalCallback() abcicli.GlobalCallback { } // InfoAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) InfoAsync(_a0 abci.RequestInfo, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) InfoAsync(_a0 types.RequestInfo, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestInfo, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestInfo, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -454,20 +454,20 @@ func (_m *Client) InfoAsync(_a0 abci.RequestInfo, _a1 abcicli.ResponseCallback) } // InfoSync provides a mock function with given fields: _a0 -func (_m *Client) InfoSync(_a0 abci.RequestInfo) (*abci.ResponseInfo, error) { +func (_m *Client) InfoSync(_a0 types.RequestInfo) (*types.ResponseInfo, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseInfo - if rf, ok := ret.Get(0).(func(abci.RequestInfo) *abci.ResponseInfo); ok { + var r0 *types.ResponseInfo + if rf, ok := ret.Get(0).(func(types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseInfo) + r0 = ret.Get(0).(*types.ResponseInfo) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestInfo) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -477,11 +477,11 @@ func (_m *Client) InfoSync(_a0 abci.RequestInfo) (*abci.ResponseInfo, error) { } // InitChainAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) InitChainAsync(_a0 abci.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) InitChainAsync(_a0 types.RequestInitChain, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestInitChain, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -493,20 +493,20 @@ func (_m *Client) InitChainAsync(_a0 abci.RequestInitChain, _a1 abcicli.Response } // InitChainSync provides a mock function with given fields: _a0 -func (_m *Client) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (_m *Client) InitChainSync(_a0 types.RequestInitChain) (*types.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { + var r0 *types.ResponseInitChain + if rf, ok := ret.Get(0).(func(types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseInitChain) + r0 = ret.Get(0).(*types.ResponseInitChain) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -530,11 +530,11 @@ func (_m *Client) IsRunning() bool { } // ListSnapshotsAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) ListSnapshotsAsync(_a0 abci.RequestListSnapshots, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) ListSnapshotsAsync(_a0 types.RequestListSnapshots, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestListSnapshots, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -546,20 +546,20 @@ func (_m *Client) ListSnapshotsAsync(_a0 abci.RequestListSnapshots, _a1 abcicli. } // ListSnapshotsSync provides a mock function with given fields: _a0 -func (_m *Client) ListSnapshotsSync(_a0 abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { +func (_m *Client) ListSnapshotsSync(_a0 types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots) *abci.ResponseListSnapshots); ok { + var r0 *types.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseListSnapshots) + r0 = ret.Get(0).(*types.ResponseListSnapshots) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestListSnapshots) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -569,11 +569,11 @@ func (_m *Client) ListSnapshotsSync(_a0 abci.RequestListSnapshots) (*abci.Respon } // LoadSnapshotChunkAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) LoadSnapshotChunkAsync(_a0 abci.RequestLoadSnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) LoadSnapshotChunkAsync(_a0 types.RequestLoadSnapshotChunk, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -585,20 +585,20 @@ func (_m *Client) LoadSnapshotChunkAsync(_a0 abci.RequestLoadSnapshotChunk, _a1 } // LoadSnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *Client) LoadSnapshotChunkSync(_a0 abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { +func (_m *Client) LoadSnapshotChunkSync(_a0 types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk) *abci.ResponseLoadSnapshotChunk); ok { + var r0 *types.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -608,11 +608,11 @@ func (_m *Client) LoadSnapshotChunkSync(_a0 abci.RequestLoadSnapshotChunk) (*abc } // OfferSnapshotAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) OfferSnapshotAsync(_a0 abci.RequestOfferSnapshot, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) OfferSnapshotAsync(_a0 types.RequestOfferSnapshot, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -624,20 +624,20 @@ func (_m *Client) OfferSnapshotAsync(_a0 abci.RequestOfferSnapshot, _a1 abcicli. } // OfferSnapshotSync provides a mock function with given fields: _a0 -func (_m *Client) OfferSnapshotSync(_a0 abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { +func (_m *Client) OfferSnapshotSync(_a0 types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot) *abci.ResponseOfferSnapshot); ok { + var r0 *types.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseOfferSnapshot) + r0 = ret.Get(0).(*types.ResponseOfferSnapshot) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestOfferSnapshot) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -680,11 +680,11 @@ func (_m *Client) OnStop() { } // QueryAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) QueryAsync(_a0 abci.RequestQuery, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) QueryAsync(_a0 types.RequestQuery, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestQuery, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestQuery, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -696,20 +696,20 @@ func (_m *Client) QueryAsync(_a0 abci.RequestQuery, _a1 abcicli.ResponseCallback } // QuerySync provides a mock function with given fields: _a0 -func (_m *Client) QuerySync(_a0 abci.RequestQuery) (*abci.ResponseQuery, error) { +func (_m *Client) QuerySync(_a0 types.RequestQuery) (*types.ResponseQuery, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseQuery - if rf, ok := ret.Get(0).(func(abci.RequestQuery) *abci.ResponseQuery); ok { + var r0 *types.ResponseQuery + if rf, ok := ret.Get(0).(func(types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseQuery) + r0 = ret.Get(0).(*types.ResponseQuery) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestQuery) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -759,11 +759,11 @@ func (_m *Client) SetLogger(_a0 log.Logger) { } // SetOptionAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) SetOptionAsync(_a0 abci.RequestSetOption, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *Client) SetOptionAsync(_a0 types.RequestSetOption, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestSetOption, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestSetOption, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -775,20 +775,20 @@ func (_m *Client) SetOptionAsync(_a0 abci.RequestSetOption, _a1 abcicli.Response } // SetOptionSync provides a mock function with given fields: _a0 -func (_m *Client) SetOptionSync(_a0 abci.RequestSetOption) (*abci.ResponseSetOption, error) { +func (_m *Client) SetOptionSync(_a0 types.RequestSetOption) (*types.ResponseSetOption, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseSetOption - if rf, ok := ret.Get(0).(func(abci.RequestSetOption) *abci.ResponseSetOption); ok { + var r0 *types.ResponseSetOption + if rf, ok := ret.Get(0).(func(types.RequestSetOption) *types.ResponseSetOption); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseSetOption) + r0 = ret.Get(0).(*types.ResponseSetOption) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestSetOption) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestSetOption) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index d82ade6fe..32a2aade5 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -10,7 +10,7 @@ import ( "reflect" "time" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ocabci "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" @@ -234,23 +234,23 @@ func (cli *socketClient) FlushAsync(cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestFlush(), cb) } -func (cli *socketClient) InfoAsync(req abci.RequestInfo, cb ResponseCallback) *ReqRes { +func (cli *socketClient) InfoAsync(req types.RequestInfo, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestInfo(req), cb) } -func (cli *socketClient) SetOptionAsync(req abci.RequestSetOption, cb ResponseCallback) *ReqRes { +func (cli *socketClient) SetOptionAsync(req types.RequestSetOption, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestSetOption(req), cb) } -func (cli *socketClient) DeliverTxAsync(req abci.RequestDeliverTx, cb ResponseCallback) *ReqRes { +func (cli *socketClient) DeliverTxAsync(req types.RequestDeliverTx, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestDeliverTx(req), cb) } -func (cli *socketClient) CheckTxAsync(req abci.RequestCheckTx, cb ResponseCallback) *ReqRes { +func (cli *socketClient) CheckTxAsync(req types.RequestCheckTx, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestCheckTx(req), cb) } -func (cli *socketClient) QueryAsync(req abci.RequestQuery, cb ResponseCallback) *ReqRes { +func (cli *socketClient) QueryAsync(req types.RequestQuery, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestQuery(req), cb) } @@ -258,7 +258,7 @@ func (cli *socketClient) CommitAsync(cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestCommit(), cb) } -func (cli *socketClient) InitChainAsync(req abci.RequestInitChain, cb ResponseCallback) *ReqRes { +func (cli *socketClient) InitChainAsync(req types.RequestInitChain, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestInitChain(req), cb) } @@ -266,7 +266,7 @@ func (cli *socketClient) BeginBlockAsync(req ocabci.RequestBeginBlock, cb Respon return cli.queueRequest(ocabci.ToRequestBeginBlock(req), cb) } -func (cli *socketClient) EndBlockAsync(req abci.RequestEndBlock, cb ResponseCallback) *ReqRes { +func (cli *socketClient) EndBlockAsync(req types.RequestEndBlock, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestEndBlock(req), cb) } @@ -278,25 +278,25 @@ func (cli *socketClient) EndRecheckTxAsync(req ocabci.RequestEndRecheckTx, cb Re return cli.queueRequest(ocabci.ToRequestEndRecheckTx(req), cb) } -func (cli *socketClient) ListSnapshotsAsync(req abci.RequestListSnapshots, cb ResponseCallback) *ReqRes { +func (cli *socketClient) ListSnapshotsAsync(req types.RequestListSnapshots, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestListSnapshots(req), cb) } -func (cli *socketClient) OfferSnapshotAsync(req abci.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { +func (cli *socketClient) OfferSnapshotAsync(req types.RequestOfferSnapshot, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestOfferSnapshot(req), cb) } -func (cli *socketClient) LoadSnapshotChunkAsync(req abci.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { +func (cli *socketClient) LoadSnapshotChunkAsync(req types.RequestLoadSnapshotChunk, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestLoadSnapshotChunk(req), cb) } -func (cli *socketClient) ApplySnapshotChunkAsync(req abci.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { +func (cli *socketClient) ApplySnapshotChunkAsync(req types.RequestApplySnapshotChunk, cb ResponseCallback) *ReqRes { return cli.queueRequest(ocabci.ToRequestApplySnapshotChunk(req), cb) } //---------------------------------------- -func (cli *socketClient) FlushSync() (*abci.ResponseFlush, error) { +func (cli *socketClient) FlushSync() (*types.ResponseFlush, error) { reqRes := cli.queueRequest(ocabci.ToRequestFlush(), nil) if err := cli.Error(); err != nil { return nil, err @@ -305,7 +305,7 @@ func (cli *socketClient) FlushSync() (*abci.ResponseFlush, error) { return reqRes.Response.GetFlush(), cli.Error() } -func (cli *socketClient) EchoSync(msg string) (*abci.ResponseEcho, error) { +func (cli *socketClient) EchoSync(msg string) (*types.ResponseEcho, error) { reqres := cli.queueRequest(ocabci.ToRequestEcho(msg), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -314,7 +314,7 @@ func (cli *socketClient) EchoSync(msg string) (*abci.ResponseEcho, error) { return reqres.Response.GetEcho(), cli.Error() } -func (cli *socketClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { +func (cli *socketClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { reqres := cli.queueRequest(ocabci.ToRequestInfo(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -323,7 +323,7 @@ func (cli *socketClient) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, err return reqres.Response.GetInfo(), cli.Error() } -func (cli *socketClient) SetOptionSync(req abci.RequestSetOption) (*abci.ResponseSetOption, error) { +func (cli *socketClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { reqres := cli.queueRequest(ocabci.ToRequestSetOption(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -332,7 +332,7 @@ func (cli *socketClient) SetOptionSync(req abci.RequestSetOption) (*abci.Respons return reqres.Response.GetSetOption(), cli.Error() } -func (cli *socketClient) DeliverTxSync(req abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { +func (cli *socketClient) DeliverTxSync(req types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { reqres := cli.queueRequest(ocabci.ToRequestDeliverTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -341,7 +341,7 @@ func (cli *socketClient) DeliverTxSync(req abci.RequestDeliverTx) (*abci.Respons return reqres.Response.GetDeliverTx(), cli.Error() } -func (cli *socketClient) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (cli *socketClient) CheckTxSync(req types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { reqres := cli.queueRequest(ocabci.ToRequestCheckTx(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -350,7 +350,7 @@ func (cli *socketClient) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseC return reqres.Response.GetCheckTx(), cli.Error() } -func (cli *socketClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, error) { +func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { reqres := cli.queueRequest(ocabci.ToRequestQuery(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -359,7 +359,7 @@ func (cli *socketClient) QuerySync(req abci.RequestQuery) (*abci.ResponseQuery, return reqres.Response.GetQuery(), cli.Error() } -func (cli *socketClient) CommitSync() (*abci.ResponseCommit, error) { +func (cli *socketClient) CommitSync() (*types.ResponseCommit, error) { reqres := cli.queueRequest(ocabci.ToRequestCommit(), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -368,7 +368,7 @@ func (cli *socketClient) CommitSync() (*abci.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (cli *socketClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { reqres := cli.queueRequest(ocabci.ToRequestInitChain(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -377,7 +377,7 @@ func (cli *socketClient) InitChainSync(req abci.RequestInitChain) (*abci.Respons return reqres.Response.GetInitChain(), cli.Error() } -func (cli *socketClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { +func (cli *socketClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) { reqres := cli.queueRequest(ocabci.ToRequestBeginBlock(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -386,7 +386,7 @@ func (cli *socketClient) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.Res return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *socketClient) EndBlockSync(req abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (cli *socketClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { reqres := cli.queueRequest(ocabci.ToRequestEndBlock(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -413,7 +413,7 @@ func (cli *socketClient) EndRecheckTxSync(req ocabci.RequestEndRecheckTx) (*ocab return reqres.Response.GetEndRecheckTx(), cli.Error() } -func (cli *socketClient) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { +func (cli *socketClient) ListSnapshotsSync(req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { reqres := cli.queueRequest(ocabci.ToRequestListSnapshots(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -422,7 +422,7 @@ func (cli *socketClient) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci return reqres.Response.GetListSnapshots(), cli.Error() } -func (cli *socketClient) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { +func (cli *socketClient) OfferSnapshotSync(req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { reqres := cli.queueRequest(ocabci.ToRequestOfferSnapshot(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -432,7 +432,7 @@ func (cli *socketClient) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci } func (cli *socketClient) LoadSnapshotChunkSync( - req abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { + req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { reqres := cli.queueRequest(ocabci.ToRequestLoadSnapshotChunk(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err @@ -442,7 +442,7 @@ func (cli *socketClient) LoadSnapshotChunkSync( } func (cli *socketClient) ApplySnapshotChunkSync( - req abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { + req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { reqres := cli.queueRequest(ocabci.ToRequestApplySnapshotChunk(req), nil) if _, err := cli.FlushSync(); err != nil { return nil, err diff --git a/abci/client/socket_client_test.go b/abci/client/socket_client_test.go index 8d349ffb4..356cf09fe 100644 --- a/abci/client/socket_client_test.go +++ b/abci/client/socket_client_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/server" @@ -116,9 +116,9 @@ type slowApp struct { ocabci.BaseApplication } -func (slowApp) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { +func (slowApp) BeginBlock(req ocabci.RequestBeginBlock) types.ResponseBeginBlock { time.Sleep(200 * time.Millisecond) - return abci.ResponseBeginBlock{} + return types.ResponseBeginBlock{} } func TestSockerClientCalls(t *testing.T) { @@ -141,21 +141,21 @@ func TestSockerClientCalls(t *testing.T) { c.EchoAsync("msg", getResponseCallback(t)) c.FlushAsync(getResponseCallback(t)) - c.InfoAsync(abci.RequestInfo{}, getResponseCallback(t)) - c.SetOptionAsync(abci.RequestSetOption{}, getResponseCallback(t)) - c.DeliverTxAsync(abci.RequestDeliverTx{}, getResponseCallback(t)) - c.CheckTxAsync(abci.RequestCheckTx{}, getResponseCallback(t)) - c.QueryAsync(abci.RequestQuery{}, getResponseCallback(t)) + c.InfoAsync(types.RequestInfo{}, getResponseCallback(t)) + c.SetOptionAsync(types.RequestSetOption{}, getResponseCallback(t)) + c.DeliverTxAsync(types.RequestDeliverTx{}, getResponseCallback(t)) + c.CheckTxAsync(types.RequestCheckTx{}, getResponseCallback(t)) + c.QueryAsync(types.RequestQuery{}, getResponseCallback(t)) c.CommitAsync(getResponseCallback(t)) - c.InitChainAsync(abci.RequestInitChain{}, getResponseCallback(t)) + c.InitChainAsync(types.RequestInitChain{}, getResponseCallback(t)) c.BeginBlockAsync(ocabci.RequestBeginBlock{}, getResponseCallback(t)) - c.EndBlockAsync(abci.RequestEndBlock{}, getResponseCallback(t)) + c.EndBlockAsync(types.RequestEndBlock{}, getResponseCallback(t)) c.BeginRecheckTxAsync(ocabci.RequestBeginRecheckTx{}, getResponseCallback(t)) c.EndRecheckTxAsync(ocabci.RequestEndRecheckTx{}, getResponseCallback(t)) - c.ListSnapshotsAsync(abci.RequestListSnapshots{}, getResponseCallback(t)) - c.OfferSnapshotAsync(abci.RequestOfferSnapshot{}, getResponseCallback(t)) - c.LoadSnapshotChunkAsync(abci.RequestLoadSnapshotChunk{}, getResponseCallback(t)) - c.ApplySnapshotChunkAsync(abci.RequestApplySnapshotChunk{}, getResponseCallback(t)) + c.ListSnapshotsAsync(types.RequestListSnapshots{}, getResponseCallback(t)) + c.OfferSnapshotAsync(types.RequestOfferSnapshot{}, getResponseCallback(t)) + c.LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk{}, getResponseCallback(t)) + c.ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk{}, getResponseCallback(t)) _, err := c.EchoSync("msg") require.NoError(t, err) @@ -163,31 +163,31 @@ func TestSockerClientCalls(t *testing.T) { _, err = c.FlushSync() require.NoError(t, err) - _, err = c.InfoSync(abci.RequestInfo{}) + _, err = c.InfoSync(types.RequestInfo{}) require.NoError(t, err) - _, err = c.SetOptionSync(abci.RequestSetOption{}) + _, err = c.SetOptionSync(types.RequestSetOption{}) require.NoError(t, err) - _, err = c.DeliverTxSync(abci.RequestDeliverTx{}) + _, err = c.DeliverTxSync(types.RequestDeliverTx{}) require.NoError(t, err) - _, err = c.CheckTxSync(abci.RequestCheckTx{}) + _, err = c.CheckTxSync(types.RequestCheckTx{}) require.NoError(t, err) - _, err = c.QuerySync(abci.RequestQuery{}) + _, err = c.QuerySync(types.RequestQuery{}) require.NoError(t, err) _, err = c.CommitSync() require.NoError(t, err) - _, err = c.InitChainSync(abci.RequestInitChain{}) + _, err = c.InitChainSync(types.RequestInitChain{}) require.NoError(t, err) _, err = c.BeginBlockSync(ocabci.RequestBeginBlock{}) require.NoError(t, err) - _, err = c.EndBlockSync(abci.RequestEndBlock{}) + _, err = c.EndBlockSync(types.RequestEndBlock{}) require.NoError(t, err) _, err = c.BeginRecheckTxSync(ocabci.RequestBeginRecheckTx{}) @@ -196,16 +196,16 @@ func TestSockerClientCalls(t *testing.T) { _, err = c.EndRecheckTxSync(ocabci.RequestEndRecheckTx{}) require.NoError(t, err) - _, err = c.ListSnapshotsSync(abci.RequestListSnapshots{}) + _, err = c.ListSnapshotsSync(types.RequestListSnapshots{}) require.NoError(t, err) - _, err = c.OfferSnapshotSync(abci.RequestOfferSnapshot{}) + _, err = c.OfferSnapshotSync(types.RequestOfferSnapshot{}) require.NoError(t, err) - _, err = c.LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk{}) + _, err = c.LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk{}) require.NoError(t, err) - _, err = c.ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk{}) + _, err = c.ApplySnapshotChunkSync(types.RequestApplySnapshotChunk{}) require.NoError(t, err) } diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index f2d2372e4..4112932c2 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -13,7 +13,7 @@ import ( "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" abcicli "github.com/line/ostracon/abci/client" @@ -519,7 +519,7 @@ func cmdInfo(cmd *cobra.Command, args []string) error { if len(args) == 1 { version = args[0] } - res, err := client.InfoSync(abci.RequestInfo{Version: version}) + res, err := client.InfoSync(types.RequestInfo{Version: version}) if err != nil { return err } @@ -542,7 +542,7 @@ func cmdSetOption(cmd *cobra.Command, args []string) error { } key, val := args[0], args[1] - _, err := client.SetOptionSync(abci.RequestSetOption{Key: key, Value: val}) + _, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: val}) if err != nil { return err } @@ -563,7 +563,7 @@ func cmdDeliverTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res, err := client.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) + res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes}) if err != nil { return err } @@ -589,7 +589,7 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res, err := client.CheckTxSync(abci.RequestCheckTx{Tx: txBytes}) + res, err := client.CheckTxSync(types.RequestCheckTx{Tx: txBytes}) if err != nil { return err } @@ -629,7 +629,7 @@ func cmdQuery(cmd *cobra.Command, args []string) error { return err } - resQuery, err := client.QuerySync(abci.RequestQuery{ + resQuery, err := client.QuerySync(types.RequestQuery{ Data: queryBytes, Path: flagPath, Height: int64(flagHeight), @@ -734,7 +734,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro pubStr, tx := kvstore.MakeValSetChangeTxAndMore(publicKey, flagVotingPower) { fmt.Printf("DeliverTxSync: data=%s, tx=%s\n", pubStr, tx) - res, err := client.DeliverTxSync(abci.RequestDeliverTx{Tx: []byte(tx)}) + res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: []byte(tx)}) if err != nil { return err } @@ -747,7 +747,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro } { fmt.Printf("QuerySync: data=%s\n", pubStr) - res, err := client.QuerySync(abci.RequestQuery{Path: "/val", Data: []byte(pubStr)}) + res, err := client.QuerySync(types.RequestQuery{Path: "/val", Data: []byte(pubStr)}) if err != nil { return err } @@ -757,7 +757,7 @@ func cmdPersistKVStoreMakeValSetChangeTx(cmd *cobra.Command, args []string) erro Log: res.Log, }) fmt.Printf("original:publicKey:%s\n", publicKey) - validatorUpdate := abci.ValidatorUpdate{} + validatorUpdate := types.ValidatorUpdate{} err = ocabci.ReadMessage(bytes.NewReader(res.Value), &validatorUpdate) if err != nil { panic(err) diff --git a/abci/example/counter/counter.go b/abci/example/counter/counter.go index e9d83691d..3a460c2bd 100644 --- a/abci/example/counter/counter.go +++ b/abci/example/counter/counter.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "fmt" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/abci/example/code" ocabci "github.com/line/ostracon/abci/types" @@ -22,11 +22,11 @@ func NewApplication(serial bool) *Application { return &Application{serial: serial} } -func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo { - return abci.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} +func (app *Application) Info(req types.RequestInfo) types.ResponseInfo { + return types.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } -func (app *Application) SetOption(req abci.RequestSetOption) abci.ResponseSetOption { +func (app *Application) SetOption(req types.RequestSetOption) types.ResponseSetOption { key, value := req.Key, req.Value if key == "serial" && value == "on" { app.serial = true @@ -34,20 +34,20 @@ func (app *Application) SetOption(req abci.RequestSetOption) abci.ResponseSetOpt /* TODO Panic and have the ABCI server pass an exception. The client can call SetOptionSync() and get an `error`. - return abci.ResponseSetOption{ + return types.ResponseSetOption{ Error: fmt.Sprintf("Unknown key (%s) or value (%s)", key, value), } */ - return abci.ResponseSetOption{} + return types.ResponseSetOption{} } - return abci.ResponseSetOption{} + return types.ResponseSetOption{} } -func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { if app.serial { if len(req.Tx) > 8 { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx))} } @@ -55,24 +55,24 @@ func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDelive copy(tx8[len(tx8)-len(req.Tx):], req.Tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } } app.txCount++ - return abci.ResponseDeliverTx{Code: code.CodeTypeOK} + return types.ResponseDeliverTx{Code: code.CodeTypeOK} } -func (app *Application) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) CheckTxSync(req types.RequestCheckTx) ocabci.ResponseCheckTx { return app.checkTx(req) } -func (app *Application) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { +func (app *Application) CheckTxAsync(req types.RequestCheckTx, callback ocabci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *Application) checkTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) checkTx(req types.RequestCheckTx) ocabci.ResponseCheckTx { if app.serial { if len(req.Tx) > 8 { return ocabci.ResponseCheckTx{ @@ -91,23 +91,23 @@ func (app *Application) checkTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx return ocabci.ResponseCheckTx{Code: code.CodeTypeOK} } -func (app *Application) Commit() (resp abci.ResponseCommit) { +func (app *Application) Commit() (resp types.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return abci.ResponseCommit{} + return types.ResponseCommit{} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return abci.ResponseCommit{Data: hash} + return types.ResponseCommit{Data: hash} } -func (app *Application) Query(reqQuery abci.RequestQuery) abci.ResponseQuery { +func (app *Application) Query(reqQuery types.RequestQuery) types.ResponseQuery { switch reqQuery.Path { case "hash": - return abci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))} + return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))} case "tx": - return abci.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))} + return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))} default: - return abci.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} + return types.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } diff --git a/abci/example/example_test.go b/abci/example/example_test.go index 3b1c79b38..c7f97122e 100644 --- a/abci/example/example_test.go +++ b/abci/example/example_test.go @@ -24,7 +24,7 @@ import ( "github.com/line/ostracon/abci/example/code" "github.com/line/ostracon/abci/example/kvstore" abciserver "github.com/line/ostracon/abci/server" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" ) func init() { @@ -38,15 +38,15 @@ func TestKVStore(t *testing.T) { func TestBaseApp(t *testing.T) { fmt.Println("### Testing BaseApp") - testStream(t, ocabci.NewBaseApplication()) + testStream(t, types.NewBaseApplication()) } func TestGRPC(t *testing.T) { fmt.Println("### Testing GRPC") - testGRPCSync(t, ocabci.NewGRPCApplication(ocabci.NewBaseApplication())) + testGRPCSync(t, types.NewGRPCApplication(types.NewBaseApplication())) } -func testStream(t *testing.T, app ocabci.Application) { +func testStream(t *testing.T, app types.Application) { numDeliverTxs := 20000 socketFile := fmt.Sprintf("test-%08x.sock", rand.Int31n(1<<30)) defer os.Remove(socketFile) @@ -78,10 +78,10 @@ func testStream(t *testing.T, app ocabci.Application) { done := make(chan struct{}) counter := 0 - client.SetGlobalCallback(func(req *ocabci.Request, res *ocabci.Response) { + client.SetGlobalCallback(func(req *types.Request, res *types.Response) { // Process response switch r := res.Value.(type) { - case *ocabci.Response_DeliverTx: + case *types.Response_DeliverTx: counter++ if r.DeliverTx.Code != code.CodeTypeOK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) @@ -96,7 +96,7 @@ func testStream(t *testing.T, app ocabci.Application) { }() return } - case *ocabci.Response_Flush: + case *types.Response_Flush: // ignore default: t.Error("Unexpected response type", reflect.TypeOf(res.Value)) @@ -130,7 +130,7 @@ func dialerFunc(ctx context.Context, addr string) (net.Conn, error) { return tmnet.Connect(addr) } -func testGRPCSync(t *testing.T, app ocabci.ABCIApplicationServer) { +func testGRPCSync(t *testing.T, app types.ABCIApplicationServer) { numDeliverTxs := 2000 socketFile := fmt.Sprintf("/tmp/test-%08x.sock", rand.Int31n(1<<30)) defer os.Remove(socketFile) @@ -162,7 +162,7 @@ func testGRPCSync(t *testing.T, app ocabci.ABCIApplicationServer) { } }) - client := ocabci.NewABCIApplicationClient(conn) + client := types.NewABCIApplicationClient(conn) // Write requests for counter := 0; counter < numDeliverTxs; counter++ { diff --git a/abci/example/kvstore/helpers.go b/abci/example/kvstore/helpers.go index 86901beb0..0ccccb851 100644 --- a/abci/example/kvstore/helpers.go +++ b/abci/example/kvstore/helpers.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" @@ -36,7 +36,7 @@ func GenDefaultPrivKey() crypto.PrivKey { // RandVal creates one random validator, with a key derived // from the input value -func RandVal(i int) abci.ValidatorUpdate { +func RandVal(i int) types.ValidatorUpdate { pk := GenDefaultPrivKey().PubKey() power := tmrand.Uint16() + 1 v := ocabci.NewValidatorUpdate(pk, int64(power)) @@ -47,8 +47,8 @@ func RandVal(i int) abci.ValidatorUpdate { // the application. Note that the keys are deterministically // derived from the index in the array, while the power is // random (Change this if not desired) -func RandVals(cnt int) []abci.ValidatorUpdate { - res := make([]abci.ValidatorUpdate, cnt) +func RandVals(cnt int) []types.ValidatorUpdate { + res := make([]types.ValidatorUpdate, cnt) for i := 0; i < cnt; i++ { res[i] = RandVal(i) } @@ -59,7 +59,7 @@ func RandVals(cnt int) []abci.ValidatorUpdate { // which allows tests to pass and is fine as long as you // don't make any tx that modify the validator state func InitKVStore(app *PersistentKVStoreApplication) { - app.InitChain(abci.RequestInitChain{ + app.InitChain(types.RequestInitChain{ Validators: RandVals(1), }) } diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 5a3cc1e74..ddd896613 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -6,7 +6,7 @@ import ( "encoding/json" "fmt" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" "github.com/line/ostracon/abci/example/code" @@ -76,8 +76,8 @@ func NewApplication() *Application { return &Application{state: state} } -func (app *Application) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { - return abci.ResponseInfo{ +func (app *Application) Info(req types.RequestInfo) (resInfo types.ResponseInfo) { + return types.ResponseInfo{ Data: fmt.Sprintf("{\"size\":%v}", app.state.Size), Version: version.ABCIVersion, AppVersion: ProtocolVersion, @@ -87,7 +87,7 @@ func (app *Application) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { } // tx is either "key=value" or just arbitrary bytes -func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { var key, value []byte parts := bytes.Split(req.Tx, []byte("=")) if len(parts) == 2 { @@ -102,10 +102,10 @@ func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDelive } app.state.Size++ - events := []abci.Event{ + events := []types.Event{ { Type: "app", - Attributes: []abci.EventAttribute{ + Attributes: []types.EventAttribute{ {Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko"), Index: true}, {Key: []byte("key"), Value: key, Index: true}, {Key: []byte("index_key"), Value: []byte("index is working"), Index: true}, @@ -114,22 +114,22 @@ func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDelive }, } - return abci.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events} + return types.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events} } -func (app *Application) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) CheckTxSync(req types.RequestCheckTx) ocabci.ResponseCheckTx { return app.checkTx(req) } -func (app *Application) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { +func (app *Application) CheckTxAsync(req types.RequestCheckTx, callback ocabci.CheckTxCallback) { callback(app.checkTx(req)) } -func (app *Application) checkTx(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *Application) checkTx(req types.RequestCheckTx) ocabci.ResponseCheckTx { return ocabci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1} } -func (app *Application) Commit() abci.ResponseCommit { +func (app *Application) Commit() types.ResponseCommit { // Using a memdb - just return the big endian size of the db appHash := make([]byte, 8) binary.PutVarint(appHash, app.state.Size) @@ -137,7 +137,7 @@ func (app *Application) Commit() abci.ResponseCommit { app.state.Height++ saveState(app.state) - resp := abci.ResponseCommit{Data: appHash} + resp := types.ResponseCommit{Data: appHash} if app.RetainBlocks > 0 && app.state.Height >= app.RetainBlocks { resp.RetainHeight = app.state.Height - app.RetainBlocks + 1 } @@ -145,7 +145,7 @@ func (app *Application) Commit() abci.ResponseCommit { } // Returns an associated value or nil if missing. -func (app *Application) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { +func (app *Application) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { if reqQuery.Prove { value, err := app.state.db.Get(prefixKey(reqQuery.Data)) if err != nil { diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 887501a76..ee1069786 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/code" @@ -26,7 +26,7 @@ const ( ) func testKVStore(t *testing.T, app ocabci.Application, tx []byte, key, value string) { - req := abci.RequestDeliverTx{Tx: tx} + req := types.RequestDeliverTx{Tx: tx} ar := app.DeliverTx(req) require.False(t, ar.IsErr(), ar) // repeating tx doesn't raise error @@ -35,11 +35,11 @@ func testKVStore(t *testing.T, app ocabci.Application, tx []byte, key, value str // commit app.Commit() - info := app.Info(abci.RequestInfo{}) + info := app.Info(types.RequestInfo{}) require.NotZero(t, info.LastBlockHeight) // make sure query is fine - resQuery := app.Query(abci.RequestQuery{ + resQuery := app.Query(types.RequestQuery{ Path: "/store", Data: []byte(key), }) @@ -49,7 +49,7 @@ func testKVStore(t *testing.T, app ocabci.Application, tx []byte, key, value str require.EqualValues(t, info.LastBlockHeight, resQuery.Height) // make sure proof is fine - resQuery = app.Query(abci.RequestQuery{ + resQuery = app.Query(types.RequestQuery{ Path: "/store", Data: []byte(key), Prove: true, @@ -97,7 +97,7 @@ func TestPersistentKVStoreInfo(t *testing.T) { InitKVStore(kvstore) height := int64(0) - resInfo := kvstore.Info(abci.RequestInfo{}) + resInfo := kvstore.Info(types.RequestInfo{}) if resInfo.LastBlockHeight != height { t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } @@ -109,10 +109,10 @@ func TestPersistentKVStoreInfo(t *testing.T) { Height: height, } kvstore.BeginBlock(ocabci.RequestBeginBlock{Hash: hash, Header: header}) - kvstore.EndBlock(abci.RequestEndBlock{Height: header.Height}) + kvstore.EndBlock(types.RequestEndBlock{Height: header.Height}) kvstore.Commit() - resInfo = kvstore.Info(abci.RequestInfo{}) + resInfo = kvstore.Info(types.RequestInfo{}) if resInfo.LastBlockHeight != height { t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } @@ -132,18 +132,18 @@ func TestValUpdates(t *testing.T) { nInit := 5 vals := RandVals(total) // initialize with the first nInit - kvstore.InitChain(abci.RequestInitChain{ + kvstore.InitChain(types.RequestInitChain{ Validators: vals[:nInit], }) vals1, vals2 := vals[:nInit], kvstore.Validators() valsEqual(t, vals1, vals2) - var v1, v2, v3 abci.ValidatorUpdate + var v1, v2, v3 types.ValidatorUpdate // add some validators v1, v2 = vals[nInit], vals[nInit+1] - diff := []abci.ValidatorUpdate{v1, v2} + diff := []types.ValidatorUpdate{v1, v2} tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power) @@ -157,7 +157,7 @@ func TestValUpdates(t *testing.T) { v1.Power = 0 v2.Power = 0 v3.Power = 0 - diff = []abci.ValidatorUpdate{v1, v2, v3} + diff = []types.ValidatorUpdate{v1, v2, v3} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power) tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power) @@ -175,12 +175,12 @@ func TestValUpdates(t *testing.T) { } else { v1.Power = 5 } - diff = []abci.ValidatorUpdate{v1} + diff = []types.ValidatorUpdate{v1} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) makeApplyBlock(t, kvstore, 3, diff, tx1) - vals1 = append([]abci.ValidatorUpdate{v1}, vals1[1:]...) + vals1 = append([]types.ValidatorUpdate{v1}, vals1[1:]...) vals2 = kvstore.Validators() valsEqual(t, vals1, vals2) @@ -193,7 +193,7 @@ func makeApplyBlock( t *testing.T, kvstore ocabci.Application, heightInt int, - diff []abci.ValidatorUpdate, + diff []types.ValidatorUpdate, txs ...[]byte) { // make and apply block height := int64(heightInt) @@ -204,40 +204,40 @@ func makeApplyBlock( kvstore.BeginBlock(ocabci.RequestBeginBlock{Hash: hash, Header: header}) for _, tx := range txs { - if r := kvstore.DeliverTx(abci.RequestDeliverTx{Tx: tx}); r.IsErr() { + if r := kvstore.DeliverTx(types.RequestDeliverTx{Tx: tx}); r.IsErr() { t.Fatal(r) } } - resEndBlock := kvstore.EndBlock(abci.RequestEndBlock{Height: header.Height}) + resEndBlock := kvstore.EndBlock(types.RequestEndBlock{Height: header.Height}) kvstore.Commit() valsEqual(t, diff, resEndBlock.ValidatorUpdates) } -func existInPersistStore(t *testing.T, kvstore ocabci.Application, v abci.ValidatorUpdate) { +func existInPersistStore(t *testing.T, kvstore ocabci.Application, v types.ValidatorUpdate) { // success pubkeyStr, _ := MakeValSetChangeTxAndMore(v.PubKey, v.Power) - resQuery := kvstore.Query(abci.RequestQuery{Path: "/val", Data: []byte(pubkeyStr)}) + resQuery := kvstore.Query(types.RequestQuery{Path: "/val", Data: []byte(pubkeyStr)}) assert.False(t, resQuery.IsErr(), resQuery) assert.Equal(t, "", resQuery.Log) // failures { // default Query: does not exist - r := kvstore.Query(abci.RequestQuery{Path: "/val_", Data: []byte(pubkeyStr)}) + r := kvstore.Query(types.RequestQuery{Path: "/val_", Data: []byte(pubkeyStr)}) assert.False(t, r.IsErr(), r) assert.Contains(t, r.Log, "does not exist") } { // Query: does not exist - r := kvstore.Query(abci.RequestQuery{Path: "/val", Data: []byte{}}) + r := kvstore.Query(types.RequestQuery{Path: "/val", Data: []byte{}}) assert.False(t, r.IsErr(), r) assert.Equal(t, "", resQuery.Log) } } // order doesn't matter -func valsEqual(t *testing.T, vals1, vals2 []abci.ValidatorUpdate) { +func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) { if len(vals1) != len(vals2) { t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1)) } @@ -349,23 +349,23 @@ func runClientTests(t *testing.T, client abcicli.Client) { } func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) { - ar, err := app.DeliverTxSync(abci.RequestDeliverTx{Tx: tx}) + ar, err := app.DeliverTxSync(types.RequestDeliverTx{Tx: tx}) require.NoError(t, err) require.False(t, ar.IsErr(), ar) // repeating tx doesn't raise error - ar, err = app.DeliverTxSync(abci.RequestDeliverTx{Tx: tx}) + ar, err = app.DeliverTxSync(types.RequestDeliverTx{Tx: tx}) require.NoError(t, err) require.False(t, ar.IsErr(), ar) // commit _, err = app.CommitSync() require.NoError(t, err) - info, err := app.InfoSync(abci.RequestInfo{}) + info, err := app.InfoSync(types.RequestInfo{}) require.NoError(t, err) require.NotZero(t, info.LastBlockHeight) // make sure query is fine - resQuery, err := app.QuerySync(abci.RequestQuery{ + resQuery, err := app.QuerySync(types.RequestQuery{ Path: "/store", Data: []byte(key), }) @@ -376,7 +376,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) require.EqualValues(t, info.LastBlockHeight, resQuery.Height) // make sure proof is fine - resQuery, err = app.QuerySync(abci.RequestQuery{ + resQuery, err = app.QuerySync(types.RequestQuery{ Path: "/store", Data: []byte(key), Prove: true, diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index daef40882..dd82ff31c 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" pc "github.com/tendermint/tendermint/proto/tendermint/crypto" dbm "github.com/tendermint/tm-db" @@ -29,7 +29,7 @@ type PersistentKVStoreApplication struct { app *Application // validator set - ValUpdates []abci.ValidatorUpdate + ValUpdates []types.ValidatorUpdate valAddrToPubKeyMap map[string]pc.PublicKey @@ -56,19 +56,19 @@ func (app *PersistentKVStoreApplication) SetLogger(l log.Logger) { app.logger = l } -func (app *PersistentKVStoreApplication) Info(req abci.RequestInfo) abci.ResponseInfo { +func (app *PersistentKVStoreApplication) Info(req types.RequestInfo) types.ResponseInfo { res := app.app.Info(req) res.LastBlockHeight = app.app.state.Height res.LastBlockAppHash = app.app.state.AppHash return res } -func (app *PersistentKVStoreApplication) SetOption(req abci.RequestSetOption) abci.ResponseSetOption { +func (app *PersistentKVStoreApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption { return app.app.SetOption(req) } // tx is either "val:pubkey!power" or "key=value" or just arbitrary bytes -func (app *PersistentKVStoreApplication) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { // if it starts with "val:", update the validator set // format is "val:pubkey!power" if isValidatorTx(req.Tx) { @@ -81,11 +81,11 @@ func (app *PersistentKVStoreApplication) DeliverTx(req abci.RequestDeliverTx) ab return app.app.DeliverTx(req) } -func (app *PersistentKVStoreApplication) CheckTxSync(req abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (app *PersistentKVStoreApplication) CheckTxSync(req types.RequestCheckTx) ocabci.ResponseCheckTx { return app.app.CheckTxSync(req) } -func (app *PersistentKVStoreApplication) CheckTxAsync(req abci.RequestCheckTx, callback ocabci.CheckTxCallback) { +func (app *PersistentKVStoreApplication) CheckTxAsync(req types.RequestCheckTx, callback ocabci.CheckTxCallback) { app.app.CheckTxAsync(req, callback) } @@ -98,13 +98,13 @@ func (app *PersistentKVStoreApplication) EndRecheckTx(req ocabci.RequestEndReche } // Commit will panic if InitChain was not called -func (app *PersistentKVStoreApplication) Commit() abci.ResponseCommit { +func (app *PersistentKVStoreApplication) Commit() types.ResponseCommit { return app.app.Commit() } -// When path=/val and data={validator address}, returns the validator update (abci.ValidatorUpdate) varint encoded. +// When path=/val and data={validator address}, returns the validator update (types.ValidatorUpdate) varint encoded. // For any other path, returns an associated value or nil if missing. -func (app *PersistentKVStoreApplication) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) { +func (app *PersistentKVStoreApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { switch reqQuery.Path { case "/val": key := []byte("val:" + string(reqQuery.Data)) @@ -122,27 +122,27 @@ func (app *PersistentKVStoreApplication) Query(reqQuery abci.RequestQuery) (resQ } // Save the validators in the merkle tree -func (app *PersistentKVStoreApplication) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { +func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain { for _, v := range req.Validators { r := app.updateValidator(v) if r.IsErr() { app.logger.Error("Error updating validators", "r", r) } } - return abci.ResponseInitChain{} + return types.ResponseInitChain{} } // Track the block hash and header information -func (app *PersistentKVStoreApplication) BeginBlock(req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { +func (app *PersistentKVStoreApplication) BeginBlock(req ocabci.RequestBeginBlock) types.ResponseBeginBlock { // reset valset changes - app.ValUpdates = make([]abci.ValidatorUpdate, 0) + app.ValUpdates = make([]types.ValidatorUpdate, 0) // Punish validators who committed equivocation. for _, ev := range req.ByzantineValidators { - if ev.Type == abci.EvidenceType_DUPLICATE_VOTE { + if ev.Type == types.EvidenceType_DUPLICATE_VOTE { addr := string(ev.Validator.Address) if pubKey, ok := app.valAddrToPubKeyMap[addr]; ok { - app.updateValidator(abci.ValidatorUpdate{ + app.updateValidator(types.ValidatorUpdate{ PubKey: pubKey, Power: ev.Validator.Power - 1, }) @@ -155,45 +155,45 @@ func (app *PersistentKVStoreApplication) BeginBlock(req ocabci.RequestBeginBlock } } - return abci.ResponseBeginBlock{} + return types.ResponseBeginBlock{} } // Update the validator set -func (app *PersistentKVStoreApplication) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { - return abci.ResponseEndBlock{ValidatorUpdates: app.ValUpdates} +func (app *PersistentKVStoreApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock { + return types.ResponseEndBlock{ValidatorUpdates: app.ValUpdates} } func (app *PersistentKVStoreApplication) ListSnapshots( - req abci.RequestListSnapshots) abci.ResponseListSnapshots { - return abci.ResponseListSnapshots{} + req types.RequestListSnapshots) types.ResponseListSnapshots { + return types.ResponseListSnapshots{} } func (app *PersistentKVStoreApplication) LoadSnapshotChunk( - req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { - return abci.ResponseLoadSnapshotChunk{} + req types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk { + return types.ResponseLoadSnapshotChunk{} } func (app *PersistentKVStoreApplication) OfferSnapshot( - req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { - return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT} + req types.RequestOfferSnapshot) types.ResponseOfferSnapshot { + return types.ResponseOfferSnapshot{Result: types.ResponseOfferSnapshot_ABORT} } func (app *PersistentKVStoreApplication) ApplySnapshotChunk( - req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { - return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ABORT} + req types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk { + return types.ResponseApplySnapshotChunk{Result: types.ResponseApplySnapshotChunk_ABORT} } //--------------------------------------------- // update validators -func (app *PersistentKVStoreApplication) Validators() (validators []abci.ValidatorUpdate) { +func (app *PersistentKVStoreApplication) Validators() (validators []types.ValidatorUpdate) { itr, err := app.app.state.db.Iterator(nil, nil) if err != nil { panic(err) } for ; itr.Valid(); itr.Next() { if isValidatorTx(itr.Key()) { - validator := new(abci.ValidatorUpdate) + validator := new(types.ValidatorUpdate) err := ocabci.ReadMessage(bytes.NewBuffer(itr.Value()), validator) if err != nil { panic(err) @@ -228,13 +228,13 @@ func isValidatorTx(tx []byte) bool { // format is "val:pubkey!power" // pubkey is a base64-encoded proto.ostracon.crypto.PublicKey bytes // See MakeValSetChangeTx -func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) abci.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.ResponseDeliverTx { tx = tx[len(ValidatorSetChangePrefix):] // get the pubkey and power pubKeyAndPower := strings.Split(string(tx), "!") if len(pubKeyAndPower) != 2 { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Expected 'pubkey!power'. Got %v", pubKeyAndPower)} } @@ -243,20 +243,20 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) abci.Respons // decode the pubkey pkBytes, err := base64.StdEncoding.DecodeString(pubkeyS) if err != nil { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pubkeyS (%s) is invalid base64", pubkeyS)} } var pkProto pc.PublicKey err = pkProto.Unmarshal(pkBytes) if err != nil { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pkBytes (%x) is invalid binary", pkBytes)} } pubkey, err := cryptoenc.PubKeyFromProto(&pkProto) if err != nil { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("pkProto (%s) is invalid binary", pkProto)} } @@ -264,7 +264,7 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) abci.Respons // decode the power power, err := strconv.ParseInt(powerS, 10, 64) if err != nil { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Power (%s) is not an int", powerS)} } @@ -275,10 +275,10 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) abci.Respons // add, update, or remove a validator // See MakeValSetChangeTx -func (app *PersistentKVStoreApplication) updateValidator(v abci.ValidatorUpdate) abci.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate) types.ResponseDeliverTx { pubkey, err := cryptoenc.PubKeyFromProto(&v.PubKey) if err != nil { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding Public Key: %s", err)} } @@ -292,7 +292,7 @@ func (app *PersistentKVStoreApplication) updateValidator(v abci.ValidatorUpdate) panic(err) } if !hasKey { - return abci.ResponseDeliverTx{ + return types.ResponseDeliverTx{ Code: code.CodeTypeUnauthorized, Log: fmt.Sprintf("Cannot remove non-existent validator %s", pubStr)} } @@ -303,8 +303,8 @@ func (app *PersistentKVStoreApplication) updateValidator(v abci.ValidatorUpdate) } else { // add or update validator value := bytes.NewBuffer(make([]byte, 0)) - if err := abci.WriteMessage(&v, value); err != nil { - return abci.ResponseDeliverTx{ + if err := types.WriteMessage(&v, value); err != nil { + return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding validator: %v", err)} } @@ -317,5 +317,5 @@ func (app *PersistentKVStoreApplication) updateValidator(v abci.ValidatorUpdate) // we only update the changes array if we successfully updated the tree app.ValUpdates = append(app.ValUpdates, v) - return abci.ResponseDeliverTx{Code: code.CodeTypeOK} + return types.ResponseDeliverTx{Code: code.CodeTypeOK} } diff --git a/abci/server/grpc_server.go b/abci/server/grpc_server.go index 9ec5c5133..50b32410c 100644 --- a/abci/server/grpc_server.go +++ b/abci/server/grpc_server.go @@ -5,7 +5,7 @@ import ( "google.golang.org/grpc" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" ) @@ -18,11 +18,11 @@ type GRPCServer struct { listener net.Listener server *grpc.Server - app ocabci.ABCIApplicationServer + app types.ABCIApplicationServer } // NewGRPCServer returns a new gRPC ABCI server -func NewGRPCServer(protoAddr string, app ocabci.ABCIApplicationServer) service.Service { +func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) service.Service { proto, addr := tmnet.ProtocolAndAddress(protoAddr) s := &GRPCServer{ proto: proto, @@ -44,7 +44,7 @@ func (s *GRPCServer) OnStart() error { s.listener = ln s.server = grpc.NewServer() - ocabci.RegisterABCIApplicationServer(s.server, s.app) + types.RegisterABCIApplicationServer(s.server, s.app) s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr) go func() { diff --git a/abci/server/server.go b/abci/server/server.go index 708898b4e..39bbce361 100644 --- a/abci/server/server.go +++ b/abci/server/server.go @@ -2,27 +2,26 @@ Package server is used to start a new ABCI server. It contains two server implementation: - * gRPC server - * socket server - + - gRPC server + - socket server */ package server import ( "fmt" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/service" ) -func NewServer(protoAddr, transport string, app ocabci.Application) (service.Service, error) { +func NewServer(protoAddr, transport string, app types.Application) (service.Service, error) { var s service.Service var err error switch transport { case "socket": s = NewSocketServer(protoAddr, app) case "grpc": - s = NewGRPCServer(protoAddr, ocabci.NewGRPCApplication(app)) + s = NewGRPCServer(protoAddr, types.NewGRPCApplication(app)) default: err = fmt.Errorf("unknown server type %s", transport) } diff --git a/abci/server/socket_server.go b/abci/server/socket_server.go index 4e322dc1c..42e7b6ad1 100644 --- a/abci/server/socket_server.go +++ b/abci/server/socket_server.go @@ -8,7 +8,7 @@ import ( "os" "runtime" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" tmlog "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/libs/service" @@ -30,10 +30,10 @@ type SocketServer struct { nextConnID int appMtx tmsync.Mutex - app ocabci.Application + app types.Application } -func NewSocketServer(protoAddr string, app ocabci.Application) service.Service { +func NewSocketServer(protoAddr string, app types.Application) service.Service { proto, addr := tmnet.ProtocolAndAddress(protoAddr) s := &SocketServer{ proto: proto, @@ -120,8 +120,8 @@ func (s *SocketServer) acceptConnectionsRoutine() { connID := s.addConn(conn) - closeConn := make(chan error, 2) // Push to signal connection closed - responses := make(chan *ocabci.Response, 1000) // A channel to buffer responses + closeConn := make(chan error, 2) // Push to signal connection closed + responses := make(chan *types.Response, 1000) // A channel to buffer responses // Read requests from conn and deal with them go s.handleRequests(closeConn, conn, responses) @@ -152,7 +152,7 @@ func (s *SocketServer) waitForClose(closeConn chan error, connID int) { } // Read requests from conn and deal with them -func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *ocabci.Response) { +func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *types.Response) { var count int var bufReader = bufio.NewReader(conn) @@ -174,8 +174,8 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp for { - var req = &ocabci.Request{} - err := ocabci.ReadMessage(bufReader, req) + var req = &types.Request{} + err := types.ReadMessage(bufReader, req) if err != nil { if err == io.EOF { closeConn <- err @@ -191,74 +191,74 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp } } -func (s *SocketServer) handleRequest(req *ocabci.Request, responses chan<- *ocabci.Response) { +func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types.Response) { switch r := req.Value.(type) { - case *ocabci.Request_Echo: - responses <- ocabci.ToResponseEcho(r.Echo.Message) - case *ocabci.Request_Flush: - responses <- ocabci.ToResponseFlush() - case *ocabci.Request_Info: + case *types.Request_Echo: + responses <- types.ToResponseEcho(r.Echo.Message) + case *types.Request_Flush: + responses <- types.ToResponseFlush() + case *types.Request_Info: res := s.app.Info(*r.Info) - responses <- ocabci.ToResponseInfo(res) - case *ocabci.Request_SetOption: + responses <- types.ToResponseInfo(res) + case *types.Request_SetOption: res := s.app.SetOption(*r.SetOption) - responses <- ocabci.ToResponseSetOption(res) - case *ocabci.Request_DeliverTx: + responses <- types.ToResponseSetOption(res) + case *types.Request_DeliverTx: res := s.app.DeliverTx(*r.DeliverTx) - responses <- ocabci.ToResponseDeliverTx(res) - case *ocabci.Request_CheckTx: + responses <- types.ToResponseDeliverTx(res) + case *types.Request_CheckTx: res := s.app.CheckTxSync(*r.CheckTx) - responses <- ocabci.ToResponseCheckTx(res) - case *ocabci.Request_Commit: + responses <- types.ToResponseCheckTx(res) + case *types.Request_Commit: res := s.app.Commit() - responses <- ocabci.ToResponseCommit(res) - case *ocabci.Request_Query: + responses <- types.ToResponseCommit(res) + case *types.Request_Query: res := s.app.Query(*r.Query) - responses <- ocabci.ToResponseQuery(res) - case *ocabci.Request_InitChain: + responses <- types.ToResponseQuery(res) + case *types.Request_InitChain: res := s.app.InitChain(*r.InitChain) - responses <- ocabci.ToResponseInitChain(res) - case *ocabci.Request_BeginBlock: + responses <- types.ToResponseInitChain(res) + case *types.Request_BeginBlock: res := s.app.BeginBlock(*r.BeginBlock) - responses <- ocabci.ToResponseBeginBlock(res) - case *ocabci.Request_EndBlock: + responses <- types.ToResponseBeginBlock(res) + case *types.Request_EndBlock: res := s.app.EndBlock(*r.EndBlock) - responses <- ocabci.ToResponseEndBlock(res) - case *ocabci.Request_BeginRecheckTx: + responses <- types.ToResponseEndBlock(res) + case *types.Request_BeginRecheckTx: res := s.app.BeginRecheckTx(*r.BeginRecheckTx) - responses <- ocabci.ToResponseBeginRecheckTx(res) - case *ocabci.Request_EndRecheckTx: + responses <- types.ToResponseBeginRecheckTx(res) + case *types.Request_EndRecheckTx: res := s.app.EndRecheckTx(*r.EndRecheckTx) - responses <- ocabci.ToResponseEndRecheckTx(res) - case *ocabci.Request_ListSnapshots: + responses <- types.ToResponseEndRecheckTx(res) + case *types.Request_ListSnapshots: res := s.app.ListSnapshots(*r.ListSnapshots) - responses <- ocabci.ToResponseListSnapshots(res) - case *ocabci.Request_OfferSnapshot: + responses <- types.ToResponseListSnapshots(res) + case *types.Request_OfferSnapshot: res := s.app.OfferSnapshot(*r.OfferSnapshot) - responses <- ocabci.ToResponseOfferSnapshot(res) - case *ocabci.Request_LoadSnapshotChunk: + responses <- types.ToResponseOfferSnapshot(res) + case *types.Request_LoadSnapshotChunk: res := s.app.LoadSnapshotChunk(*r.LoadSnapshotChunk) - responses <- ocabci.ToResponseLoadSnapshotChunk(res) - case *ocabci.Request_ApplySnapshotChunk: + responses <- types.ToResponseLoadSnapshotChunk(res) + case *types.Request_ApplySnapshotChunk: res := s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk) - responses <- ocabci.ToResponseApplySnapshotChunk(res) + responses <- types.ToResponseApplySnapshotChunk(res) default: - responses <- ocabci.ToResponseException("Unknown request") + responses <- types.ToResponseException("Unknown request") } } // Pull responses from 'responses' and write them to conn. -func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *ocabci.Response) { +func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *types.Response) { var count int var bufWriter = bufio.NewWriter(conn) for { var res = <-responses - err := ocabci.WriteMessage(res, bufWriter) + err := types.WriteMessage(res, bufWriter) if err != nil { closeConn <- fmt.Errorf("error writing message: %w", err) return } - if _, ok := res.Value.(*ocabci.Response_Flush); ok { + if _, ok := res.Value.(*types.Response_Flush); ok { err = bufWriter.Flush() if err != nil { closeConn <- fmt.Errorf("error flushing write buffer: %w", err) diff --git a/abci/tests/benchmarks/parallel/parallel.go b/abci/tests/benchmarks/parallel/parallel.go index 40a37d80f..5f7f21517 100644 --- a/abci/tests/benchmarks/parallel/parallel.go +++ b/abci/tests/benchmarks/parallel/parallel.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" ) @@ -20,8 +20,8 @@ func main() { go func() { counter := 0 for { - var res = &ocabci.Response{} - err := ocabci.ReadMessage(conn, res) + var res = &types.Response{} + err := types.ReadMessage(conn, res) if err != nil { log.Fatal(err.Error()) } @@ -36,9 +36,9 @@ func main() { counter := 0 for i := 0; ; i++ { var bufWriter = bufio.NewWriter(conn) - var req = ocabci.ToRequestEcho("foobar") + var req = types.ToRequestEcho("foobar") - err := ocabci.WriteMessage(req, bufWriter) + err := types.WriteMessage(req, bufWriter) if err != nil { log.Fatal(err.Error()) } diff --git a/abci/tests/benchmarks/simple/simple.go b/abci/tests/benchmarks/simple/simple.go index d31806df2..98fd5cd79 100644 --- a/abci/tests/benchmarks/simple/simple.go +++ b/abci/tests/benchmarks/simple/simple.go @@ -7,7 +7,7 @@ import ( "log" "reflect" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" tmnet "github.com/line/ostracon/libs/net" ) @@ -21,7 +21,7 @@ func main() { // Make a bunch of requests counter := 0 for i := 0; ; i++ { - req := ocabci.ToRequestEcho("foobar") + req := types.ToRequestEcho("foobar") _, err := makeRequest(conn, req) if err != nil { log.Fatal(err.Error()) @@ -33,15 +33,15 @@ func main() { } } -func makeRequest(conn io.ReadWriter, req *ocabci.Request) (*ocabci.Response, error) { +func makeRequest(conn io.ReadWriter, req *types.Request) (*types.Response, error) { var bufWriter = bufio.NewWriter(conn) // Write desired request - err := ocabci.WriteMessage(req, bufWriter) + err := types.WriteMessage(req, bufWriter) if err != nil { return nil, err } - err = ocabci.WriteMessage(ocabci.ToRequestFlush(), bufWriter) + err = types.WriteMessage(types.ToRequestFlush(), bufWriter) if err != nil { return nil, err } @@ -51,17 +51,17 @@ func makeRequest(conn io.ReadWriter, req *ocabci.Request) (*ocabci.Response, err } // Read desired response - var res = &ocabci.Response{} - err = ocabci.ReadMessage(conn, res) + var res = &types.Response{} + err = types.ReadMessage(conn, res) if err != nil { return nil, err } - var resFlush = &ocabci.Response{} - err = ocabci.ReadMessage(conn, resFlush) + var resFlush = &types.Response{} + err = types.ReadMessage(conn, resFlush) if err != nil { return nil, err } - if _, ok := resFlush.Value.(*ocabci.Response_Flush); !ok { + if _, ok := resFlush.Value.(*types.Response_Flush); !ok { return nil, fmt.Errorf("expected flush response but got something else: %v", reflect.TypeOf(resFlush)) } diff --git a/abci/tests/server/client.go b/abci/tests/server/client.go index 892a4dba2..2c289a5b5 100644 --- a/abci/tests/server/client.go +++ b/abci/tests/server/client.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" @@ -15,13 +15,13 @@ import ( func InitChain(client abcicli.Client) error { total := 10 - vals := make([]abci.ValidatorUpdate, total) + vals := make([]types.ValidatorUpdate, total) for i := 0; i < total; i++ { pubkey := kvstore.GenDefaultPrivKey().PubKey() power := tmrand.Int() vals[i] = ocabci.NewValidatorUpdate(pubkey, int64(power)) } - _, err := client.InitChainSync(abci.RequestInitChain{ + _, err := client.InitChainSync(types.RequestInitChain{ Validators: vals, }) if err != nil { @@ -33,7 +33,7 @@ func InitChain(client abcicli.Client) error { } func SetOption(client abcicli.Client, key, value string) error { - _, err := client.SetOptionSync(abci.RequestSetOption{Key: key, Value: value}) + _, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: value}) if err != nil { fmt.Println("Failed test: SetOption") fmt.Printf("error while setting %v=%v: \nerror: %v\n", key, value, err) @@ -61,7 +61,7 @@ func Commit(client abcicli.Client, hashExp []byte) error { } func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { - res, _ := client.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) + res, _ := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes}) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: DeliverTx") @@ -80,7 +80,7 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp [] } func CheckTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { - res, _ := client.CheckTxSync(abci.RequestCheckTx{Tx: txBytes}) + res, _ := client.CheckTxSync(types.RequestCheckTx{Tx: txBytes}) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: CheckTx") diff --git a/abci/tests/test_app/app.go b/abci/tests/test_app/app.go index d38d447dc..d3b6fdcf9 100644 --- a/abci/tests/test_app/app.go +++ b/abci/tests/test_app/app.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/libs/log" @@ -27,7 +27,7 @@ func startClient(abciType string) abcicli.Client { } func setOption(client abcicli.Client, key, value string) { - _, err := client.SetOptionSync(abci.RequestSetOption{Key: key, Value: value}) + _, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: value}) if err != nil { panicf("setting %v=%v: \nerr: %v", key, value, err) } @@ -44,7 +44,7 @@ func commit(client abcicli.Client, hashExp []byte) { } func deliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) { - res, err := client.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) + res, err := client.DeliverTxSync(types.RequestDeliverTx{Tx: txBytes}) if err != nil { panicf("client error: %v", err) } diff --git a/abci/tests/test_app/main.go b/abci/tests/test_app/main.go index da5669c57..a1a8723e5 100644 --- a/abci/tests/test_app/main.go +++ b/abci/tests/test_app/main.go @@ -8,7 +8,7 @@ import ( "time" "github.com/line/ostracon/abci/example/code" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" ) var abciType string @@ -83,13 +83,13 @@ func testCounter() { commit(client, nil) deliverTx(client, []byte("abc"), code.CodeTypeBadNonce, nil) commit(client, nil) - deliverTx(client, []byte{0x00}, ocabci.CodeTypeOK, nil) + deliverTx(client, []byte{0x00}, types.CodeTypeOK, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) deliverTx(client, []byte{0x00}, code.CodeTypeBadNonce, nil) - deliverTx(client, []byte{0x01}, ocabci.CodeTypeOK, nil) - deliverTx(client, []byte{0x00, 0x02}, ocabci.CodeTypeOK, nil) - deliverTx(client, []byte{0x00, 0x03}, ocabci.CodeTypeOK, nil) - deliverTx(client, []byte{0x00, 0x00, 0x04}, ocabci.CodeTypeOK, nil) + deliverTx(client, []byte{0x01}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x02}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x03}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeTypeOK, nil) deliverTx(client, []byte{0x00, 0x00, 0x06}, code.CodeTypeBadNonce, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) } diff --git a/abci/types/application.go b/abci/types/application.go index e513d8311..e9540b94b 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -3,7 +3,7 @@ package types import ( context "golang.org/x/net/context" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ) //go:generate mockery --case underscore --name Application @@ -16,28 +16,28 @@ type CheckTxCallback func(ResponseCheckTx) // except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing. type Application interface { // Info/Query Connection - Info(abci.RequestInfo) abci.ResponseInfo // Return application info - SetOption(abci.RequestSetOption) abci.ResponseSetOption // Set application option - Query(abci.RequestQuery) abci.ResponseQuery // Query for state + Info(types.RequestInfo) types.ResponseInfo // Return application info + SetOption(types.RequestSetOption) types.ResponseSetOption // Set application option + Query(types.RequestQuery) types.ResponseQuery // Query for state // Mempool Connection - CheckTxSync(abci.RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool - CheckTxAsync(abci.RequestCheckTx, CheckTxCallback) // Asynchronously validate a tx for the mempool + CheckTxSync(types.RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool + CheckTxAsync(types.RequestCheckTx, CheckTxCallback) // Asynchronously validate a tx for the mempool BeginRecheckTx(RequestBeginRecheckTx) ResponseBeginRecheckTx // Signals the beginning of rechecking EndRecheckTx(RequestEndRecheckTx) ResponseEndRecheckTx // Signals the end of rechecking // Consensus Connection - InitChain(abci.RequestInitChain) abci.ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore - BeginBlock(RequestBeginBlock) abci.ResponseBeginBlock // Signals the beginning of a block - DeliverTx(abci.RequestDeliverTx) abci.ResponseDeliverTx // Deliver a tx for full processing - EndBlock(abci.RequestEndBlock) abci.ResponseEndBlock // Signals the end of a block, returns changes to the validator set - Commit() abci.ResponseCommit // Commit the state and return the application Merkle root hash + InitChain(types.RequestInitChain) types.ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore + BeginBlock(RequestBeginBlock) types.ResponseBeginBlock // Signals the beginning of a block + DeliverTx(types.RequestDeliverTx) types.ResponseDeliverTx // Deliver a tx for full processing + EndBlock(types.RequestEndBlock) types.ResponseEndBlock // Signals the end of a block, returns changes to the validator set + Commit() types.ResponseCommit // Commit the state and return the application Merkle root hash // State Sync Connection - ListSnapshots(abci.RequestListSnapshots) abci.ResponseListSnapshots // List available snapshots - OfferSnapshot(abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot // Offer a snapshot to the application - LoadSnapshotChunk(abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk // Load a snapshot chunk - ApplySnapshotChunk(abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk // Apply a shapshot chunk + ListSnapshots(types.RequestListSnapshots) types.ResponseListSnapshots // List available snapshots + OfferSnapshot(types.RequestOfferSnapshot) types.ResponseOfferSnapshot // Offer a snapshot to the application + LoadSnapshotChunk(types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk // Load a snapshot chunk + ApplySnapshotChunk(types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk // Apply a shapshot chunk } //------------------------------------------------------- @@ -52,23 +52,23 @@ func NewBaseApplication() *BaseApplication { return &BaseApplication{} } -func (BaseApplication) Info(req abci.RequestInfo) abci.ResponseInfo { - return abci.ResponseInfo{} +func (BaseApplication) Info(req types.RequestInfo) types.ResponseInfo { + return types.ResponseInfo{} } -func (BaseApplication) SetOption(req abci.RequestSetOption) abci.ResponseSetOption { - return abci.ResponseSetOption{} +func (BaseApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption { + return types.ResponseSetOption{} } -func (BaseApplication) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { - return abci.ResponseDeliverTx{Code: CodeTypeOK} +func (BaseApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { + return types.ResponseDeliverTx{Code: CodeTypeOK} } -func (BaseApplication) CheckTxSync(req abci.RequestCheckTx) ResponseCheckTx { +func (BaseApplication) CheckTxSync(req types.RequestCheckTx) ResponseCheckTx { return ResponseCheckTx{Code: CodeTypeOK} } -func (BaseApplication) CheckTxAsync(req abci.RequestCheckTx, callback CheckTxCallback) { +func (BaseApplication) CheckTxAsync(req types.RequestCheckTx, callback CheckTxCallback) { callback(ResponseCheckTx{Code: CodeTypeOK}) } @@ -80,40 +80,40 @@ func (BaseApplication) EndRecheckTx(req RequestEndRecheckTx) ResponseEndRecheckT return ResponseEndRecheckTx{Code: CodeTypeOK} } -func (BaseApplication) Commit() abci.ResponseCommit { - return abci.ResponseCommit{} +func (BaseApplication) Commit() types.ResponseCommit { + return types.ResponseCommit{} } -func (BaseApplication) Query(req abci.RequestQuery) abci.ResponseQuery { - return abci.ResponseQuery{Code: CodeTypeOK} +func (BaseApplication) Query(req types.RequestQuery) types.ResponseQuery { + return types.ResponseQuery{Code: CodeTypeOK} } -func (BaseApplication) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { - return abci.ResponseInitChain{} +func (BaseApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain { + return types.ResponseInitChain{} } -func (BaseApplication) BeginBlock(req RequestBeginBlock) abci.ResponseBeginBlock { - return abci.ResponseBeginBlock{} +func (BaseApplication) BeginBlock(req RequestBeginBlock) types.ResponseBeginBlock { + return types.ResponseBeginBlock{} } -func (BaseApplication) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { - return abci.ResponseEndBlock{} +func (BaseApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock { + return types.ResponseEndBlock{} } -func (BaseApplication) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots { - return abci.ResponseListSnapshots{} +func (BaseApplication) ListSnapshots(req types.RequestListSnapshots) types.ResponseListSnapshots { + return types.ResponseListSnapshots{} } -func (BaseApplication) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { - return abci.ResponseOfferSnapshot{} +func (BaseApplication) OfferSnapshot(req types.RequestOfferSnapshot) types.ResponseOfferSnapshot { + return types.ResponseOfferSnapshot{} } -func (BaseApplication) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { - return abci.ResponseLoadSnapshotChunk{} +func (BaseApplication) LoadSnapshotChunk(req types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk { + return types.ResponseLoadSnapshotChunk{} } -func (BaseApplication) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { - return abci.ResponseApplySnapshotChunk{} +func (BaseApplication) ApplySnapshotChunk(req types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk { + return types.ResponseApplySnapshotChunk{} } //------------------------------------------------------- @@ -127,30 +127,30 @@ func NewGRPCApplication(app Application) *GRPCApplication { return &GRPCApplication{app} } -func (app *GRPCApplication) Echo(ctx context.Context, req *abci.RequestEcho) (*abci.ResponseEcho, error) { - return &abci.ResponseEcho{Message: req.Message}, nil +func (app *GRPCApplication) Echo(ctx context.Context, req *types.RequestEcho) (*types.ResponseEcho, error) { + return &types.ResponseEcho{Message: req.Message}, nil } -func (app *GRPCApplication) Flush(ctx context.Context, req *abci.RequestFlush) (*abci.ResponseFlush, error) { - return &abci.ResponseFlush{}, nil +func (app *GRPCApplication) Flush(ctx context.Context, req *types.RequestFlush) (*types.ResponseFlush, error) { + return &types.ResponseFlush{}, nil } -func (app *GRPCApplication) Info(ctx context.Context, req *abci.RequestInfo) (*abci.ResponseInfo, error) { +func (app *GRPCApplication) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) { res := app.app.Info(*req) return &res, nil } -func (app *GRPCApplication) SetOption(ctx context.Context, req *abci.RequestSetOption) (*abci.ResponseSetOption, error) { +func (app *GRPCApplication) SetOption(ctx context.Context, req *types.RequestSetOption) (*types.ResponseSetOption, error) { res := app.app.SetOption(*req) return &res, nil } -func (app *GRPCApplication) DeliverTx(ctx context.Context, req *abci.RequestDeliverTx) (*abci.ResponseDeliverTx, error) { +func (app *GRPCApplication) DeliverTx(ctx context.Context, req *types.RequestDeliverTx) (*types.ResponseDeliverTx, error) { res := app.app.DeliverTx(*req) return &res, nil } -func (app *GRPCApplication) CheckTx(ctx context.Context, req *abci.RequestCheckTx) (*ResponseCheckTx, error) { +func (app *GRPCApplication) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*ResponseCheckTx, error) { res := app.app.CheckTxSync(*req) return &res, nil } @@ -166,51 +166,51 @@ func (app *GRPCApplication) EndRecheckTx(ctx context.Context, req *RequestEndRec return &res, nil } -func (app *GRPCApplication) Query(ctx context.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) { +func (app *GRPCApplication) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) { res := app.app.Query(*req) return &res, nil } -func (app *GRPCApplication) Commit(ctx context.Context, req *abci.RequestCommit) (*abci.ResponseCommit, error) { +func (app *GRPCApplication) Commit(ctx context.Context, req *types.RequestCommit) (*types.ResponseCommit, error) { res := app.app.Commit() return &res, nil } -func (app *GRPCApplication) InitChain(ctx context.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (app *GRPCApplication) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) { res := app.app.InitChain(*req) return &res, nil } -func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*abci.ResponseBeginBlock, error) { +func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*types.ResponseBeginBlock, error) { res := app.app.BeginBlock(*req) return &res, nil } -func (app *GRPCApplication) EndBlock(ctx context.Context, req *abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (app *GRPCApplication) EndBlock(ctx context.Context, req *types.RequestEndBlock) (*types.ResponseEndBlock, error) { res := app.app.EndBlock(*req) return &res, nil } func (app *GRPCApplication) ListSnapshots( - ctx context.Context, req *abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { + ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { res := app.app.ListSnapshots(*req) return &res, nil } func (app *GRPCApplication) OfferSnapshot( - ctx context.Context, req *abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { + ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { res := app.app.OfferSnapshot(*req) return &res, nil } func (app *GRPCApplication) LoadSnapshotChunk( - ctx context.Context, req *abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { + ctx context.Context, req *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { res := app.app.LoadSnapshotChunk(*req) return &res, nil } func (app *GRPCApplication) ApplySnapshotChunk( - ctx context.Context, req *abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { + ctx context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { res := app.app.ApplySnapshotChunk(*req) return &res, nil } diff --git a/abci/types/messages.go b/abci/types/messages.go index 1e3e374f1..6db61a7af 100644 --- a/abci/types/messages.go +++ b/abci/types/messages.go @@ -7,7 +7,7 @@ import ( "github.com/gogo/protobuf/proto" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ) const ( @@ -73,35 +73,35 @@ func encodeVarint(w io.Writer, i int64) (err error) { func ToRequestEcho(message string) *Request { return &Request{ - Value: &Request_Echo{&abci.RequestEcho{Message: message}}, + Value: &Request_Echo{&types.RequestEcho{Message: message}}, } } func ToRequestFlush() *Request { return &Request{ - Value: &Request_Flush{&abci.RequestFlush{}}, + Value: &Request_Flush{&types.RequestFlush{}}, } } -func ToRequestInfo(req abci.RequestInfo) *Request { +func ToRequestInfo(req types.RequestInfo) *Request { return &Request{ Value: &Request_Info{&req}, } } -func ToRequestSetOption(req abci.RequestSetOption) *Request { +func ToRequestSetOption(req types.RequestSetOption) *Request { return &Request{ Value: &Request_SetOption{&req}, } } -func ToRequestDeliverTx(req abci.RequestDeliverTx) *Request { +func ToRequestDeliverTx(req types.RequestDeliverTx) *Request { return &Request{ Value: &Request_DeliverTx{&req}, } } -func ToRequestCheckTx(req abci.RequestCheckTx) *Request { +func ToRequestCheckTx(req types.RequestCheckTx) *Request { return &Request{ Value: &Request_CheckTx{&req}, } @@ -109,17 +109,17 @@ func ToRequestCheckTx(req abci.RequestCheckTx) *Request { func ToRequestCommit() *Request { return &Request{ - Value: &Request_Commit{&abci.RequestCommit{}}, + Value: &Request_Commit{&types.RequestCommit{}}, } } -func ToRequestQuery(req abci.RequestQuery) *Request { +func ToRequestQuery(req types.RequestQuery) *Request { return &Request{ Value: &Request_Query{&req}, } } -func ToRequestInitChain(req abci.RequestInitChain) *Request { +func ToRequestInitChain(req types.RequestInitChain) *Request { return &Request{ Value: &Request_InitChain{&req}, } @@ -131,7 +131,7 @@ func ToRequestBeginBlock(req RequestBeginBlock) *Request { } } -func ToRequestEndBlock(req abci.RequestEndBlock) *Request { +func ToRequestEndBlock(req types.RequestEndBlock) *Request { return &Request{ Value: &Request_EndBlock{&req}, } @@ -149,25 +149,25 @@ func ToRequestEndRecheckTx(req RequestEndRecheckTx) *Request { } } -func ToRequestListSnapshots(req abci.RequestListSnapshots) *Request { +func ToRequestListSnapshots(req types.RequestListSnapshots) *Request { return &Request{ Value: &Request_ListSnapshots{&req}, } } -func ToRequestOfferSnapshot(req abci.RequestOfferSnapshot) *Request { +func ToRequestOfferSnapshot(req types.RequestOfferSnapshot) *Request { return &Request{ Value: &Request_OfferSnapshot{&req}, } } -func ToRequestLoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) *Request { +func ToRequestLoadSnapshotChunk(req types.RequestLoadSnapshotChunk) *Request { return &Request{ Value: &Request_LoadSnapshotChunk{&req}, } } -func ToRequestApplySnapshotChunk(req abci.RequestApplySnapshotChunk) *Request { +func ToRequestApplySnapshotChunk(req types.RequestApplySnapshotChunk) *Request { return &Request{ Value: &Request_ApplySnapshotChunk{&req}, } @@ -177,35 +177,35 @@ func ToRequestApplySnapshotChunk(req abci.RequestApplySnapshotChunk) *Request { func ToResponseException(errStr string) *Response { return &Response{ - Value: &Response_Exception{&abci.ResponseException{Error: errStr}}, + Value: &Response_Exception{&types.ResponseException{Error: errStr}}, } } func ToResponseEcho(message string) *Response { return &Response{ - Value: &Response_Echo{&abci.ResponseEcho{Message: message}}, + Value: &Response_Echo{&types.ResponseEcho{Message: message}}, } } func ToResponseFlush() *Response { return &Response{ - Value: &Response_Flush{&abci.ResponseFlush{}}, + Value: &Response_Flush{&types.ResponseFlush{}}, } } -func ToResponseInfo(res abci.ResponseInfo) *Response { +func ToResponseInfo(res types.ResponseInfo) *Response { return &Response{ Value: &Response_Info{&res}, } } -func ToResponseSetOption(res abci.ResponseSetOption) *Response { +func ToResponseSetOption(res types.ResponseSetOption) *Response { return &Response{ Value: &Response_SetOption{&res}, } } -func ToResponseDeliverTx(res abci.ResponseDeliverTx) *Response { +func ToResponseDeliverTx(res types.ResponseDeliverTx) *Response { return &Response{ Value: &Response_DeliverTx{&res}, } @@ -217,31 +217,31 @@ func ToResponseCheckTx(res ResponseCheckTx) *Response { } } -func ToResponseCommit(res abci.ResponseCommit) *Response { +func ToResponseCommit(res types.ResponseCommit) *Response { return &Response{ Value: &Response_Commit{&res}, } } -func ToResponseQuery(res abci.ResponseQuery) *Response { +func ToResponseQuery(res types.ResponseQuery) *Response { return &Response{ Value: &Response_Query{&res}, } } -func ToResponseInitChain(res abci.ResponseInitChain) *Response { +func ToResponseInitChain(res types.ResponseInitChain) *Response { return &Response{ Value: &Response_InitChain{&res}, } } -func ToResponseBeginBlock(res abci.ResponseBeginBlock) *Response { +func ToResponseBeginBlock(res types.ResponseBeginBlock) *Response { return &Response{ Value: &Response_BeginBlock{&res}, } } -func ToResponseEndBlock(res abci.ResponseEndBlock) *Response { +func ToResponseEndBlock(res types.ResponseEndBlock) *Response { return &Response{ Value: &Response_EndBlock{&res}, } @@ -259,25 +259,25 @@ func ToResponseEndRecheckTx(res ResponseEndRecheckTx) *Response { } } -func ToResponseListSnapshots(res abci.ResponseListSnapshots) *Response { +func ToResponseListSnapshots(res types.ResponseListSnapshots) *Response { return &Response{ Value: &Response_ListSnapshots{&res}, } } -func ToResponseOfferSnapshot(res abci.ResponseOfferSnapshot) *Response { +func ToResponseOfferSnapshot(res types.ResponseOfferSnapshot) *Response { return &Response{ Value: &Response_OfferSnapshot{&res}, } } -func ToResponseLoadSnapshotChunk(res abci.ResponseLoadSnapshotChunk) *Response { +func ToResponseLoadSnapshotChunk(res types.ResponseLoadSnapshotChunk) *Response { return &Response{ Value: &Response_LoadSnapshotChunk{&res}, } } -func ToResponseApplySnapshotChunk(res abci.ResponseApplySnapshotChunk) *Response { +func ToResponseApplySnapshotChunk(res types.ResponseApplySnapshotChunk) *Response { return &Response{ Value: &Response_ApplySnapshotChunk{&res}, } diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index bc6621f94..edcd37436 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -9,13 +9,13 @@ import ( "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" - ocproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/line/ostracon/proto/ostracon/types" ) func TestMarshalJSON(t *testing.T) { - b, err := json.Marshal(&abci.ResponseDeliverTx{}) + b, err := json.Marshal(&types.ResponseDeliverTx{}) assert.Nil(t, err) // include empty fields. assert.True(t, strings.Contains(string(b), "code")) @@ -23,10 +23,10 @@ func TestMarshalJSON(t *testing.T) { Code: 1, Data: []byte("hello"), GasWanted: 43, - Events: []abci.Event{ + Events: []types.Event{ { Type: "testEvent", - Attributes: []abci.EventAttribute{ + Attributes: []types.EventAttribute{ {Key: []byte("pho"), Value: []byte("bo")}, }, }, @@ -43,7 +43,7 @@ func TestMarshalJSON(t *testing.T) { func TestWriteReadMessageSimple(t *testing.T) { cases := []proto.Message{ - &abci.RequestEcho{ + &types.RequestEcho{ Message: "Hello", }, } @@ -53,7 +53,7 @@ func TestWriteReadMessageSimple(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(abci.RequestEcho) + msg := new(types.RequestEcho) err = ReadMessage(buf, msg) assert.Nil(t, err) @@ -63,7 +63,7 @@ func TestWriteReadMessageSimple(t *testing.T) { func TestWriteReadMessage(t *testing.T) { cases := []proto.Message{ - &ocproto.Header{ + &tmproto.Header{ Height: 4, ChainID: "test", }, @@ -75,7 +75,7 @@ func TestWriteReadMessage(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(ocproto.Header) + msg := new(tmproto.Header) err = ReadMessage(buf, msg) assert.Nil(t, err) @@ -90,10 +90,10 @@ func TestWriteReadMessage2(t *testing.T) { Data: []byte(phrase), Log: phrase, GasWanted: 10, - Events: []abci.Event{ + Events: []types.Event{ { Type: "testEvent", - Attributes: []abci.EventAttribute{ + Attributes: []types.EventAttribute{ {Key: []byte("abc"), Value: []byte("def")}, }, }, diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 960ded0b1..ca92d8dad 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -3,7 +3,7 @@ package mocks import ( - abci "github.com/tendermint/tendermint/abci/types" + types "github.com/tendermint/tendermint/abci/types" ocabci "github.com/line/ostracon/abci/types" mock "github.com/stretchr/testify/mock" @@ -15,28 +15,28 @@ type Application struct { } // ApplySnapshotChunk provides a mock function with given fields: _a0 -func (_m *Application) ApplySnapshotChunk(_a0 abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { +func (_m *Application) ApplySnapshotChunk(_a0 types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk { ret := _m.Called(_a0) - var r0 abci.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk); ok { + var r0 types.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(types.ResponseApplySnapshotChunk) } return r0 } // BeginBlock provides a mock function with given fields: _a0 -func (_m *Application) BeginBlock(_a0 ocabci.RequestBeginBlock) abci.ResponseBeginBlock { +func (_m *Application) BeginBlock(_a0 ocabci.RequestBeginBlock) types.ResponseBeginBlock { ret := _m.Called(_a0) - var r0 abci.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) abci.ResponseBeginBlock); ok { + var r0 types.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) types.ResponseBeginBlock); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseBeginBlock) + r0 = ret.Get(0).(types.ResponseBeginBlock) } return r0 @@ -57,16 +57,16 @@ func (_m *Application) BeginRecheckTx(_a0 ocabci.RequestBeginRecheckTx) ocabci.R } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Application) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 ocabci.CheckTxCallback) { +func (_m *Application) CheckTxAsync(_a0 types.RequestCheckTx, _a1 ocabci.CheckTxCallback) { _m.Called(_a0, _a1) } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *Application) CheckTxSync(_a0 abci.RequestCheckTx) ocabci.ResponseCheckTx { +func (_m *Application) CheckTxSync(_a0 types.RequestCheckTx) ocabci.ResponseCheckTx { ret := _m.Called(_a0) var r0 ocabci.ResponseCheckTx - if rf, ok := ret.Get(0).(func(abci.RequestCheckTx) ocabci.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(types.RequestCheckTx) ocabci.ResponseCheckTx); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(ocabci.ResponseCheckTx) @@ -76,42 +76,42 @@ func (_m *Application) CheckTxSync(_a0 abci.RequestCheckTx) ocabci.ResponseCheck } // Commit provides a mock function with given fields: -func (_m *Application) Commit() abci.ResponseCommit { +func (_m *Application) Commit() types.ResponseCommit { ret := _m.Called() - var r0 abci.ResponseCommit - if rf, ok := ret.Get(0).(func() abci.ResponseCommit); ok { + var r0 types.ResponseCommit + if rf, ok := ret.Get(0).(func() types.ResponseCommit); ok { r0 = rf() } else { - r0 = ret.Get(0).(abci.ResponseCommit) + r0 = ret.Get(0).(types.ResponseCommit) } return r0 } // DeliverTx provides a mock function with given fields: _a0 -func (_m *Application) DeliverTx(_a0 abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (_m *Application) DeliverTx(_a0 types.RequestDeliverTx) types.ResponseDeliverTx { ret := _m.Called(_a0) - var r0 abci.ResponseDeliverTx - if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx) abci.ResponseDeliverTx); ok { + var r0 types.ResponseDeliverTx + if rf, ok := ret.Get(0).(func(types.RequestDeliverTx) types.ResponseDeliverTx); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseDeliverTx) + r0 = ret.Get(0).(types.ResponseDeliverTx) } return r0 } // EndBlock provides a mock function with given fields: _a0 -func (_m *Application) EndBlock(_a0 abci.RequestEndBlock) abci.ResponseEndBlock { +func (_m *Application) EndBlock(_a0 types.RequestEndBlock) types.ResponseEndBlock { ret := _m.Called(_a0) - var r0 abci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) abci.ResponseEndBlock); ok { + var r0 types.ResponseEndBlock + if rf, ok := ret.Get(0).(func(types.RequestEndBlock) types.ResponseEndBlock); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseEndBlock) + r0 = ret.Get(0).(types.ResponseEndBlock) } return r0 @@ -132,98 +132,98 @@ func (_m *Application) EndRecheckTx(_a0 ocabci.RequestEndRecheckTx) ocabci.Respo } // Info provides a mock function with given fields: _a0 -func (_m *Application) Info(_a0 abci.RequestInfo) abci.ResponseInfo { +func (_m *Application) Info(_a0 types.RequestInfo) types.ResponseInfo { ret := _m.Called(_a0) - var r0 abci.ResponseInfo - if rf, ok := ret.Get(0).(func(abci.RequestInfo) abci.ResponseInfo); ok { + var r0 types.ResponseInfo + if rf, ok := ret.Get(0).(func(types.RequestInfo) types.ResponseInfo); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseInfo) + r0 = ret.Get(0).(types.ResponseInfo) } return r0 } // InitChain provides a mock function with given fields: _a0 -func (_m *Application) InitChain(_a0 abci.RequestInitChain) abci.ResponseInitChain { +func (_m *Application) InitChain(_a0 types.RequestInitChain) types.ResponseInitChain { ret := _m.Called(_a0) - var r0 abci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) abci.ResponseInitChain); ok { + var r0 types.ResponseInitChain + if rf, ok := ret.Get(0).(func(types.RequestInitChain) types.ResponseInitChain); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseInitChain) + r0 = ret.Get(0).(types.ResponseInitChain) } return r0 } // ListSnapshots provides a mock function with given fields: _a0 -func (_m *Application) ListSnapshots(_a0 abci.RequestListSnapshots) abci.ResponseListSnapshots { +func (_m *Application) ListSnapshots(_a0 types.RequestListSnapshots) types.ResponseListSnapshots { ret := _m.Called(_a0) - var r0 abci.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots) abci.ResponseListSnapshots); ok { + var r0 types.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(types.RequestListSnapshots) types.ResponseListSnapshots); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseListSnapshots) + r0 = ret.Get(0).(types.ResponseListSnapshots) } return r0 } // LoadSnapshotChunk provides a mock function with given fields: _a0 -func (_m *Application) LoadSnapshotChunk(_a0 abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { +func (_m *Application) LoadSnapshotChunk(_a0 types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk { ret := _m.Called(_a0) - var r0 abci.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk); ok { + var r0 types.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(types.ResponseLoadSnapshotChunk) } return r0 } // OfferSnapshot provides a mock function with given fields: _a0 -func (_m *Application) OfferSnapshot(_a0 abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { +func (_m *Application) OfferSnapshot(_a0 types.RequestOfferSnapshot) types.ResponseOfferSnapshot { ret := _m.Called(_a0) - var r0 abci.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot); ok { + var r0 types.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot) types.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseOfferSnapshot) + r0 = ret.Get(0).(types.ResponseOfferSnapshot) } return r0 } // Query provides a mock function with given fields: _a0 -func (_m *Application) Query(_a0 abci.RequestQuery) abci.ResponseQuery { +func (_m *Application) Query(_a0 types.RequestQuery) types.ResponseQuery { ret := _m.Called(_a0) - var r0 abci.ResponseQuery - if rf, ok := ret.Get(0).(func(abci.RequestQuery) abci.ResponseQuery); ok { + var r0 types.ResponseQuery + if rf, ok := ret.Get(0).(func(types.RequestQuery) types.ResponseQuery); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseQuery) + r0 = ret.Get(0).(types.ResponseQuery) } return r0 } // SetOption provides a mock function with given fields: _a0 -func (_m *Application) SetOption(_a0 abci.RequestSetOption) abci.ResponseSetOption { +func (_m *Application) SetOption(_a0 types.RequestSetOption) types.ResponseSetOption { ret := _m.Called(_a0) - var r0 abci.ResponseSetOption - if rf, ok := ret.Get(0).(func(abci.RequestSetOption) abci.ResponseSetOption); ok { + var r0 types.ResponseSetOption + if rf, ok := ret.Get(0).(func(types.RequestSetOption) types.ResponseSetOption); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(abci.ResponseSetOption) + r0 = ret.Get(0).(types.ResponseSetOption) } return r0 diff --git a/abci/types/pubkey.go b/abci/types/pubkey.go index d7ab7c2b3..f7e366fb5 100644 --- a/abci/types/pubkey.go +++ b/abci/types/pubkey.go @@ -1,19 +1,19 @@ package types import ( - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" ) -func NewValidatorUpdate(pk crypto.PubKey, power int64) abci.ValidatorUpdate { +func NewValidatorUpdate(pk crypto.PubKey, power int64) types.ValidatorUpdate { pkp, err := cryptoenc.PubKeyToProto(pk) if err != nil { panic(err) } - return abci.ValidatorUpdate{ + return types.ValidatorUpdate{ // Address: PubKey: pkp, Power: power, diff --git a/abci/types/util.go b/abci/types/util.go index 96af04a21..0d6bc9297 100644 --- a/abci/types/util.go +++ b/abci/types/util.go @@ -3,13 +3,13 @@ package types import ( "sort" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" ) //------------------------------------------------------------------------------ // ValidatorUpdates is a list of validators that implements the Sort interface -type ValidatorUpdates []abci.ValidatorUpdate +type ValidatorUpdates []types.ValidatorUpdate var _ sort.Interface = (ValidatorUpdates)(nil) diff --git a/blockchain/v0/reactor.go b/blockchain/v0/reactor.go index c63e82a5f..ff006e2ae 100644 --- a/blockchain/v0/reactor.go +++ b/blockchain/v0/reactor.go @@ -5,12 +5,12 @@ import ( "reflect" "time" - tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" - bcproto "github.com/line/ostracon/proto/ostracon/blockchain" + ocbcproto "github.com/line/ostracon/proto/ostracon/blockchain" sm "github.com/line/ostracon/state" "github.com/line/ostracon/store" "github.com/line/ostracon/types" @@ -158,7 +158,7 @@ func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor { // AddPeer implements Reactor by sending our state to peer. func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) { - msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ + msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ Base: bcR.store.Base(), Height: bcR.store.Height()}) if err != nil { @@ -180,7 +180,7 @@ func (bcR *BlockchainReactor) RemovePeer(peer p2p.Peer, reason interface{}) { // respondToPeer loads a block and sends it to the requesting peer, // if we have it. Otherwise, we'll respond saying we don't have it. -func (bcR *BlockchainReactor) respondToPeer(msg *tmbcproto.BlockRequest, +func (bcR *BlockchainReactor) respondToPeer(msg *bcproto.BlockRequest, src p2p.Peer) (queued bool) { block := bcR.store.LoadBlock(msg.Height) @@ -191,7 +191,7 @@ func (bcR *BlockchainReactor) respondToPeer(msg *tmbcproto.BlockRequest, return false } - msgBytes, err := bc.EncodeMsg(&bcproto.BlockResponse{Block: bl}) + msgBytes, err := bc.EncodeMsg(&ocbcproto.BlockResponse{Block: bl}) if err != nil { bcR.Logger.Error("could not marshal msg", "err", err) return false @@ -202,7 +202,7 @@ func (bcR *BlockchainReactor) respondToPeer(msg *tmbcproto.BlockRequest, bcR.Logger.Info("Peer asking for a block we don't have", "src", src, "height", msg.Height) - msgBytes, err := bc.EncodeMsg(&tmbcproto.NoBlockResponse{Height: msg.Height}) + msgBytes, err := bc.EncodeMsg(&bcproto.NoBlockResponse{Height: msg.Height}) if err != nil { bcR.Logger.Error("could not convert msg to protobuf", "err", err) return false @@ -229,18 +229,18 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) bcR.Logger.Debug("Receive", "src", src, "chID", chID, "msg", msg) switch msg := msg.(type) { - case *tmbcproto.BlockRequest: + case *bcproto.BlockRequest: bcR.respondToPeer(msg, src) - case *bcproto.BlockResponse: + case *ocbcproto.BlockResponse: bi, err := types.BlockFromProto(msg.Block) if err != nil { bcR.Logger.Error("Block content is invalid", "err", err) return } bcR.pool.AddBlock(src.ID(), bi, len(msgBytes)) - case *tmbcproto.StatusRequest: + case *bcproto.StatusRequest: // Send peer our state. - msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ + msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ Height: bcR.store.Height(), Base: bcR.store.Base(), }) @@ -249,10 +249,10 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) return } src.TrySend(BlockchainChannel, msgBytes) - case *tmbcproto.StatusResponse: + case *bcproto.StatusResponse: // Got a peer status. Unverified. bcR.pool.SetPeerRange(src.ID(), msg.Base, msg.Height) - case *tmbcproto.NoBlockResponse: + case *bcproto.NoBlockResponse: bcR.Logger.Debug("Peer does not have requested block", "peer", src, "height", msg.Height) default: bcR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) @@ -294,7 +294,7 @@ func (bcR *BlockchainReactor) poolRoutine(stateSynced bool) { if peer == nil { continue } - msgBytes, err := bc.EncodeMsg(&tmbcproto.BlockRequest{Height: request.Height}) + msgBytes, err := bc.EncodeMsg(&bcproto.BlockRequest{Height: request.Height}) if err != nil { bcR.Logger.Error("could not convert msg to proto", "err", err) continue @@ -433,7 +433,7 @@ FOR_LOOP: // BroadcastStatusRequest broadcasts `BlockStore` base and height. func (bcR *BlockchainReactor) BroadcastStatusRequest() error { - bm, err := bc.EncodeMsg(&tmbcproto.StatusRequest{}) + bm, err := bc.EncodeMsg(&bcproto.StatusRequest{}) if err != nil { bcR.Logger.Error("could not convert msg to proto", "err", err) return fmt.Errorf("could not convert msg to proto: %w", err) diff --git a/blockchain/v1/reactor.go b/blockchain/v1/reactor.go index dce6a45cc..238195dfc 100644 --- a/blockchain/v1/reactor.go +++ b/blockchain/v1/reactor.go @@ -5,13 +5,13 @@ import ( "reflect" "time" - tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" "github.com/line/ostracon/behaviour" bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" - bcproto "github.com/line/ostracon/proto/ostracon/blockchain" + ocbcproto "github.com/line/ostracon/proto/ostracon/blockchain" sm "github.com/line/ostracon/state" "github.com/line/ostracon/store" "github.com/line/ostracon/types" @@ -187,7 +187,7 @@ func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor { // AddPeer implements Reactor by sending our state to peer. func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) { - msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ + msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ Base: bcR.store.Base(), Height: bcR.store.Height(), }) @@ -205,7 +205,7 @@ func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) { // sendBlockToPeer loads a block and sends it to the requesting peer. // If the block doesn't exist a bcNoBlockResponseMessage is sent. // If all nodes are honest, no node should be requesting for a block that doesn't exist. -func (bcR *BlockchainReactor) sendBlockToPeer(msg *tmbcproto.BlockRequest, +func (bcR *BlockchainReactor) sendBlockToPeer(msg *bcproto.BlockRequest, src p2p.Peer) (queued bool) { block := bcR.store.LoadBlock(msg.Height) @@ -215,7 +215,7 @@ func (bcR *BlockchainReactor) sendBlockToPeer(msg *tmbcproto.BlockRequest, bcR.Logger.Error("Could not send block message to peer", "err", err) return false } - msgBytes, err := bc.EncodeMsg(&bcproto.BlockResponse{Block: pbbi}) + msgBytes, err := bc.EncodeMsg(&ocbcproto.BlockResponse{Block: pbbi}) if err != nil { bcR.Logger.Error("unable to marshal msg", "err", err) return false @@ -225,7 +225,7 @@ func (bcR *BlockchainReactor) sendBlockToPeer(msg *tmbcproto.BlockRequest, bcR.Logger.Info("peer asking for a block we don't have", "src", src, "height", msg.Height) - msgBytes, err := bc.EncodeMsg(&tmbcproto.NoBlockResponse{Height: msg.Height}) + msgBytes, err := bc.EncodeMsg(&bcproto.NoBlockResponse{Height: msg.Height}) if err != nil { bcR.Logger.Error("unable to marshal msg", "err", err) return false @@ -233,8 +233,8 @@ func (bcR *BlockchainReactor) sendBlockToPeer(msg *tmbcproto.BlockRequest, return src.TrySend(BlockchainChannel, msgBytes) } -func (bcR *BlockchainReactor) sendStatusResponseToPeer(msg *tmbcproto.StatusRequest, src p2p.Peer) (queued bool) { - msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{ +func (bcR *BlockchainReactor) sendStatusResponseToPeer(msg *bcproto.StatusRequest, src p2p.Peer) (queued bool) { + msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{ Base: bcR.store.Base(), Height: bcR.store.Height(), }) @@ -276,20 +276,20 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) bcR.Logger.Debug("Receive", "src", src, "chID", chID, "msg", msg) switch msg := msg.(type) { - case *tmbcproto.BlockRequest: + case *bcproto.BlockRequest: if queued := bcR.sendBlockToPeer(msg, src); !queued { // Unfortunately not queued since the queue is full. bcR.Logger.Error("Could not send block message to peer", "src", src, "height", msg.Height) } - case *tmbcproto.StatusRequest: + case *bcproto.StatusRequest: // Send peer our state. if queued := bcR.sendStatusResponseToPeer(msg, src); !queued { // Unfortunately not queued since the queue is full. bcR.Logger.Error("Could not send status message to peer", "src", src) } - case *bcproto.BlockResponse: + case *ocbcproto.BlockResponse: bi, err := types.BlockFromProto(msg.Block) if err != nil { bcR.Logger.Error("error transition block from protobuf", "err", err) @@ -306,7 +306,7 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) } bcR.Logger.Info("Received", "src", src, "height", bi.Height) bcR.messagesForFSMCh <- msgForFSM - case *tmbcproto.NoBlockResponse: + case *bcproto.NoBlockResponse: msgForFSM := bcReactorMessage{ event: noBlockResponseEv, data: bReactorEventData{ @@ -317,7 +317,7 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) bcR.Logger.Debug("Peer does not have requested block", "peer", src, "height", msg.Height) bcR.messagesForFSMCh <- msgForFSM - case *tmbcproto.StatusResponse: + case *bcproto.StatusResponse: // Got a peer status. Unverified. msgForFSM := bcReactorMessage{ event: statusResponseEv, @@ -501,7 +501,7 @@ func (bcR *BlockchainReactor) processBlock() error { // Implements bcRNotifier // sendStatusRequest broadcasts `BlockStore` height. func (bcR *BlockchainReactor) sendStatusRequest() { - msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusRequest{}) + msgBytes, err := bc.EncodeMsg(&bcproto.StatusRequest{}) if err != nil { panic(err) } @@ -516,7 +516,7 @@ func (bcR *BlockchainReactor) sendBlockRequest(peerID p2p.ID, height int64) erro return errNilPeerForBlockRequest } - msgBytes, err := bc.EncodeMsg(&tmbcproto.BlockRequest{Height: height}) + msgBytes, err := bc.EncodeMsg(&bcproto.BlockRequest{Height: height}) if err != nil { return err } @@ -543,8 +543,8 @@ func (bcR *BlockchainReactor) switchToConsensus() { // Called by FSM and pool: // - pool calls when it detects slow peer or when peer times out // - FSM calls when: -// - adding a block (addBlock) fails -// - reactor processing of a block reports failure and FSM sends back the peers of first and second blocks +// - adding a block (addBlock) fails +// - reactor processing of a block reports failure and FSM sends back the peers of first and second blocks func (bcR *BlockchainReactor) sendPeerError(err error, peerID p2p.ID) { bcR.Logger.Info("sendPeerError:", "peer", peerID, "error", err) msgData := bcFsmMessage{ diff --git a/blockchain/v1/reactor_test.go b/blockchain/v1/reactor_test.go index 1ab37aef4..92d89becb 100644 --- a/blockchain/v1/reactor_test.go +++ b/blockchain/v1/reactor_test.go @@ -14,7 +14,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/mempool/mock" @@ -367,5 +367,5 @@ func makeBlock(privVal types.PrivValidator, height int64, state sm.State, lastCo } type testApp struct { - ocabci.BaseApplication + abci.BaseApplication } diff --git a/blockchain/v2/io.go b/blockchain/v2/io.go index 49d2d59c1..8ee9811f4 100644 --- a/blockchain/v2/io.go +++ b/blockchain/v2/io.go @@ -3,11 +3,11 @@ package v2 import ( "fmt" - tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/p2p" - bcproto "github.com/line/ostracon/proto/ostracon/blockchain" + ocbcproto "github.com/line/ostracon/proto/ostracon/blockchain" "github.com/line/ostracon/state" "github.com/line/ostracon/types" ) @@ -49,7 +49,7 @@ func (sio *switchIO) sendBlockRequest(peerID p2p.ID, height int64) error { if peer == nil { return fmt.Errorf("peer not found") } - msgBytes, err := bc.EncodeMsg(&tmbcproto.BlockRequest{Height: height}) + msgBytes, err := bc.EncodeMsg(&bcproto.BlockRequest{Height: height}) if err != nil { return err } @@ -67,7 +67,7 @@ func (sio *switchIO) sendStatusResponse(base int64, height int64, peerID p2p.ID) return fmt.Errorf("peer not found") } - msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusResponse{Height: height, Base: base}) + msgBytes, err := bc.EncodeMsg(&bcproto.StatusResponse{Height: height, Base: base}) if err != nil { return err } @@ -93,7 +93,7 @@ func (sio *switchIO) sendBlockToPeer(block *types.Block, peerID p2p.ID) error { return err } - msgBytes, err := bc.EncodeMsg(&bcproto.BlockResponse{Block: bpb}) + msgBytes, err := bc.EncodeMsg(&ocbcproto.BlockResponse{Block: bpb}) if err != nil { return err } @@ -109,7 +109,7 @@ func (sio *switchIO) sendBlockNotFound(height int64, peerID p2p.ID) error { if peer == nil { return fmt.Errorf("peer not found") } - msgBytes, err := bc.EncodeMsg(&tmbcproto.NoBlockResponse{Height: height}) + msgBytes, err := bc.EncodeMsg(&bcproto.NoBlockResponse{Height: height}) if err != nil { return err } @@ -130,7 +130,7 @@ func (sio *switchIO) trySwitchToConsensus(state state.State, skipWAL bool) bool } func (sio *switchIO) broadcastStatusRequest() error { - msgBytes, err := bc.EncodeMsg(&tmbcproto.StatusRequest{}) + msgBytes, err := bc.EncodeMsg(&bcproto.StatusRequest{}) if err != nil { return err } diff --git a/blockchain/v2/reactor.go b/blockchain/v2/reactor.go index 44951369d..0464215a3 100644 --- a/blockchain/v2/reactor.go +++ b/blockchain/v2/reactor.go @@ -5,14 +5,14 @@ import ( "fmt" "time" - tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" "github.com/line/ostracon/behaviour" bc "github.com/line/ostracon/blockchain" "github.com/line/ostracon/libs/log" tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/p2p" - bcproto "github.com/line/ostracon/proto/ostracon/blockchain" + ocbcproto "github.com/line/ostracon/proto/ostracon/blockchain" "github.com/line/ostracon/state" "github.com/line/ostracon/types" ) @@ -476,12 +476,12 @@ func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { r.logger.Debug("Receive", "src", src.ID(), "chID", chID, "msg", msg) switch msg := msg.(type) { - case *tmbcproto.StatusRequest: + case *bcproto.StatusRequest: if err := r.io.sendStatusResponse(r.store.Base(), r.store.Height(), src.ID()); err != nil { r.logger.Error("Could not send status message to peer", "src", src) } - case *tmbcproto.BlockRequest: + case *bcproto.BlockRequest: block := r.store.LoadBlock(msg.Height) if block != nil { if err = r.io.sendBlockToPeer(block, src.ID()); err != nil { @@ -495,14 +495,14 @@ func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { } } - case *tmbcproto.StatusResponse: + case *bcproto.StatusResponse: r.mtx.RLock() if r.events != nil { r.events <- bcStatusResponse{peerID: src.ID(), base: msg.Base, height: msg.Height} } r.mtx.RUnlock() - case *bcproto.BlockResponse: + case *ocbcproto.BlockResponse: bi, err := types.BlockFromProto(msg.Block) if err != nil { r.logger.Error("error transitioning block from protobuf", "err", err) @@ -519,7 +519,7 @@ func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { } r.mtx.RUnlock() - case *tmbcproto.NoBlockResponse: + case *bcproto.NoBlockResponse: r.mtx.RLock() if r.events != nil { r.events <- bcNoBlockResponse{peerID: src.ID(), height: msg.Height, time: time.Now()} diff --git a/blockchain/v2/reactor_test.go b/blockchain/v2/reactor_test.go index e81107f82..98b88cd87 100644 --- a/blockchain/v2/reactor_test.go +++ b/blockchain/v2/reactor_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - tmbcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" + bcproto "github.com/tendermint/tendermint/proto/tendermint/blockchain" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/behaviour" bc "github.com/line/ostracon/blockchain" cfg "github.com/line/ostracon/config" @@ -381,10 +381,10 @@ func TestReactorHelperMode(t *testing.T) { name: "status request", params: params, msgs: []testEvent{ - {"P1", tmbcproto.StatusRequest{}}, - {"P1", tmbcproto.BlockRequest{Height: 13}}, - {"P1", tmbcproto.BlockRequest{Height: 20}}, - {"P1", tmbcproto.BlockRequest{Height: 22}}, + {"P1", bcproto.StatusRequest{}}, + {"P1", bcproto.BlockRequest{Height: 13}}, + {"P1", bcproto.BlockRequest{Height: 20}}, + {"P1", bcproto.BlockRequest{Height: 22}}, }, }, } @@ -401,13 +401,13 @@ func TestReactorHelperMode(t *testing.T) { for i := 0; i < len(tt.msgs); i++ { step := tt.msgs[i] switch ev := step.event.(type) { - case tmbcproto.StatusRequest: + case bcproto.StatusRequest: old := mockSwitch.numStatusResponse msg, err := bc.EncodeMsg(&ev) assert.NoError(t, err) reactor.Receive(channelID, mockPeer{id: p2p.ID(step.peer)}, msg) assert.Equal(t, old+1, mockSwitch.numStatusResponse) - case tmbcproto.BlockRequest: + case bcproto.BlockRequest: if ev.Height > params.startHeight { old := mockSwitch.numNoBlockResponse msg, err := bc.EncodeMsg(&ev) @@ -465,7 +465,7 @@ func makeBlock(privVal types.PrivValidator, height int64, state sm.State, lastCo } type testApp struct { - ocabci.BaseApplication + abci.BaseApplication } func randGenesisDoc(chainID string, numValidators int, randPower bool, minPower int64) ( diff --git a/consensus/replay_stubs.go b/consensus/replay_stubs.go index 70cb59d96..e1b60c39c 100644 --- a/consensus/replay_stubs.go +++ b/consensus/replay_stubs.go @@ -6,7 +6,7 @@ import ( ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/clist" mempl "github.com/line/ostracon/mempool" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" ) @@ -54,7 +54,7 @@ func (emptyMempool) CloseWAL() {} // Useful because we don't want to call Commit() twice for the same block on // the real app. -func newMockProxyApp(appHash []byte, abciResponses *ocstate.ABCIResponses) proxy.AppConnConsensus { +func newMockProxyApp(appHash []byte, abciResponses *tmstate.ABCIResponses) proxy.AppConnConsensus { clientCreator := proxy.NewLocalClientCreator(&mockProxyApp{ appHash: appHash, abciResponses: abciResponses, @@ -72,7 +72,7 @@ type mockProxyApp struct { appHash []byte txCount int - abciResponses *ocstate.ABCIResponses + abciResponses *tmstate.ABCIResponses } func (mock *mockProxyApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { diff --git a/consensus/replay_test.go b/consensus/replay_test.go index d6fb88ace..1ec6e48dc 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -30,7 +30,7 @@ import ( tmrand "github.com/line/ostracon/libs/rand" mempl "github.com/line/ostracon/mempool" "github.com/line/ostracon/privval" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" @@ -609,14 +609,14 @@ func TestMockProxyApp(t *testing.T) { txIndex := 0 assert.NotPanics(t, func() { - abciResWithEmptyDeliverTx := new(ocstate.ABCIResponses) + abciResWithEmptyDeliverTx := new(tmstate.ABCIResponses) abciResWithEmptyDeliverTx.DeliverTxs = make([]*abci.ResponseDeliverTx, 0) abciResWithEmptyDeliverTx.DeliverTxs = append(abciResWithEmptyDeliverTx.DeliverTxs, &abci.ResponseDeliverTx{}) // called when saveABCIResponses: bytes, err := proto.Marshal(abciResWithEmptyDeliverTx) require.NoError(t, err) - loadedAbciRes := new(ocstate.ABCIResponses) + loadedAbciRes := new(tmstate.ABCIResponses) // this also happens sm.LoadABCIResponses err = proto.Unmarshal(bytes, loadedAbciRes) @@ -624,7 +624,7 @@ func TestMockProxyApp(t *testing.T) { mock := newMockProxyApp([]byte("mock_hash"), loadedAbciRes) - abciRes := new(ocstate.ABCIResponses) + abciRes := new(tmstate.ABCIResponses) abciRes.DeliverTxs = make([]*abci.ResponseDeliverTx, len(loadedAbciRes.DeliverTxs)) // Execute transactions and get hash. proxyCb := func(req *ocabci.Request, res *ocabci.Response) { diff --git a/consensus/state_test.go b/consensus/state_test.go index 93e9f67a0..6dd4944fb 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - ocabci "github.com/line/ostracon/abci/types" "testing" "time" @@ -16,6 +15,7 @@ import ( "github.com/stretchr/testify/require" "github.com/line/ostracon/abci/example/counter" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/abci/types/mocks" cstypes "github.com/line/ostracon/consensus/types" "github.com/line/ostracon/crypto/tmhash" diff --git a/evidence/pool.go b/evidence/pool.go index 1f358dc84..5356affc5 100644 --- a/evidence/pool.go +++ b/evidence/pool.go @@ -14,7 +14,7 @@ import ( "github.com/line/ostracon/libs/clist" "github.com/line/ostracon/libs/log" - ocproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/line/ostracon/proto/ostracon/types" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" ) @@ -362,7 +362,7 @@ func (evpool *Pool) listEvidence(prefixKey byte, maxBytes int64) ([]types.Eviden evSize int64 totalSize int64 evidence []types.Evidence - evList ocproto.EvidenceList // used for calculating the bytes size + evList tmproto.EvidenceList // used for calculating the bytes size ) iter, err := dbm.IteratePrefix(evpool.evidenceStore, []byte{prefixKey}) @@ -371,7 +371,7 @@ func (evpool *Pool) listEvidence(prefixKey byte, maxBytes int64) ([]types.Eviden } defer iter.Close() for ; iter.Valid(); iter.Next() { - var evpb ocproto.Evidence + var evpb tmproto.Evidence err := evpb.Unmarshal(iter.Value()) if err != nil { return evidence, totalSize, err @@ -534,7 +534,7 @@ type duplicateVoteSet struct { } func bytesToEv(evBytes []byte) (types.Evidence, error) { - var evpb ocproto.Evidence + var evpb tmproto.Evidence err := evpb.Unmarshal(evBytes) if err != nil { return &types.DuplicateVoteEvidence{}, err diff --git a/evidence/reactor.go b/evidence/reactor.go index 59e04e3d4..d4f1ce941 100644 --- a/evidence/reactor.go +++ b/evidence/reactor.go @@ -7,7 +7,7 @@ import ( clist "github.com/line/ostracon/libs/clist" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/p2p" - ocproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) @@ -211,7 +211,7 @@ type PeerState interface { // encodemsg takes a array of evidence // returns the byte encoding of the List Message func encodeMsg(evis []types.Evidence) ([]byte, error) { - evi := make([]ocproto.Evidence, len(evis)) + evi := make([]tmproto.Evidence, len(evis)) for i := 0; i < len(evis); i++ { ev, err := types.EvidenceToProto(evis[i]) if err != nil { @@ -219,7 +219,7 @@ func encodeMsg(evis []types.Evidence) ([]byte, error) { } evi[i] = *ev } - epl := ocproto.EvidenceList{ + epl := tmproto.EvidenceList{ Evidence: evi, } @@ -229,7 +229,7 @@ func encodeMsg(evis []types.Evidence) ([]byte, error) { // decodemsg takes an array of bytes // returns an array of evidence func decodeMsg(bz []byte) (evis []types.Evidence, err error) { - lm := ocproto.EvidenceList{} + lm := tmproto.EvidenceList{} if err := lm.Unmarshal(bz); err != nil { return nil, err } diff --git a/light/store/db/db.go b/light/store/db/db.go index 948699189..d53ef8cfd 100644 --- a/light/store/db/db.go +++ b/light/store/db/db.go @@ -10,7 +10,7 @@ import ( tmsync "github.com/line/ostracon/libs/sync" "github.com/line/ostracon/light/store" - ocproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/ostracon/types" ) @@ -120,7 +120,7 @@ func (s *dbs) LightBlock(height int64) (*types.LightBlock, error) { return nil, store.ErrLightBlockNotFound } - var lbpb ocproto.LightBlock + var lbpb tmproto.LightBlock err = lbpb.Unmarshal(bz) if err != nil { return nil, fmt.Errorf("unmarshal error: %w", err) diff --git a/mempool/cache_test.go b/mempool/cache_test.go index 9a486df58..65aa0178c 100644 --- a/mempool/cache_test.go +++ b/mempool/cache_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/line/ostracon/abci/example/kvstore" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" ) @@ -69,7 +69,7 @@ func TestCacheAfterUpdate(t *testing.T) { updateTxs = append(updateTxs, tx) } err := mempool.Update(newTestBlock(int64(tcIndex), updateTxs), - abciResponses(len(updateTxs), ocabci.CodeTypeOK), nil, nil) + abciResponses(len(updateTxs), abci.CodeTypeOK), nil, nil) require.NoError(t, err) for _, v := range tc.reAddIndices { diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index d74b784a1..31a50ffff 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -3,20 +3,20 @@ package mempool import ( "testing" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" "github.com/stretchr/testify/require" ) func TestPostCheckMaxGas(t *testing.T) { tests := []struct { - res *ocabci.ResponseCheckTx + res *abci.ResponseCheckTx postCheck PostCheckFunc ok bool }{ - {&ocabci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(10), true}, - {&ocabci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(-1), true}, - {&ocabci.ResponseCheckTx{GasWanted: -1}, PostCheckMaxGas(10), false}, - {&ocabci.ResponseCheckTx{GasWanted: 11}, PostCheckMaxGas(10), false}, + {&abci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(10), true}, + {&abci.ResponseCheckTx{GasWanted: 10}, PostCheckMaxGas(-1), true}, + {&abci.ResponseCheckTx{GasWanted: -1}, PostCheckMaxGas(10), false}, + {&abci.ResponseCheckTx{GasWanted: 11}, PostCheckMaxGas(10), false}, } for tcIndex, tt := range tests { err := tt.postCheck(nil, tt.res) diff --git a/p2p/conn/connection.go b/p2p/conn/connection.go index 2fcaad8b3..0d9d688fd 100644 --- a/p2p/conn/connection.go +++ b/p2p/conn/connection.go @@ -64,6 +64,7 @@ The byte id and the relative priorities of each `Channel` are configured upon initialization of the connection. There are two methods for sending messages: + func (m MConnection) Send(chID byte, msgBytes []byte) bool {} func (m MConnection) TrySend(chID byte, msgBytes []byte}) bool {} @@ -889,7 +890,7 @@ func (ch *Channel) updateStats() { //---------------------------------------- // Packet -// mustWrapPacket takes a packet kind (oneof) and wraps it in a ocp2p.Packet message. +// mustWrapPacket takes a packet kind (oneof) and wraps it in a tmp2p.Packet message. func mustWrapPacket(pb proto.Message) *tmp2p.Packet { var msg tmp2p.Packet diff --git a/p2p/conn/connection_test.go b/p2p/conn/connection_test.go index 64b8fa624..78dad8903 100644 --- a/p2p/conn/connection_test.go +++ b/p2p/conn/connection_test.go @@ -15,7 +15,7 @@ import ( "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/protoio" - ocproto "github.com/line/ostracon/proto/ostracon/types" + "github.com/line/ostracon/proto/ostracon/types" ) const maxPingPongPacketSize = 1024 // bytes @@ -533,7 +533,7 @@ func TestMConnectionReadErrorUnknownMsgType(t *testing.T) { defer mconnServer.Stop() // nolint:errcheck // ignore for tests // send msg with unknown msg type - _, err := protoio.NewDelimitedWriter(mconnClient.conn).WriteMsg(&ocproto.Header{ChainID: "x"}) + _, err := protoio.NewDelimitedWriter(mconnClient.conn).WriteMsg(&types.Header{ChainID: "x"}) require.NoError(t, err) assert.True(t, expectSend(chOnErr), "unknown msg type") } diff --git a/privval/msgs_test.go b/privval/msgs_test.go index 240843ada..c12df2297 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -6,7 +6,7 @@ import ( "time" cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" - tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/gogo/protobuf/proto" @@ -73,24 +73,24 @@ func TestPrivvalVectors(t *testing.T) { proposalpb := proposal.ToProto() // Create a Reuseable remote error - remoteError := &tmprivvalproto.RemoteSignerError{Code: 1, Description: "it's a error"} + remoteError := &privvalproto.RemoteSignerError{Code: 1, Description: "it's a error"} testCases := []struct { testName string msg proto.Message expBytes string }{ - {"ping request", &tmprivvalproto.PingRequest{}, "3a00"}, - {"ping response", &tmprivvalproto.PingResponse{}, "4200"}, - {"pubKey request", &tmprivvalproto.PubKeyRequest{}, "0a00"}, - {"pubKey response", &tmprivvalproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, - {"pubKey response with error", &tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, - {"Vote Request", &tmprivvalproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, - {"Vote Response", &tmprivvalproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, - {"Vote Response with error", &tmprivvalproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, - {"Proposal Request", &tmprivvalproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, - {"Proposal Response", &tmprivvalproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, - {"Proposal Response with error", &tmprivvalproto.SignedProposalResponse{Proposal: tmproto.Proposal{}, Error: remoteError}, "32250a112a021200320b088092b8c398feffffff0112100801120c697427732061206572726f72"}, + {"ping request", &privvalproto.PingRequest{}, "3a00"}, + {"ping response", &privvalproto.PingResponse{}, "4200"}, + {"pubKey request", &privvalproto.PubKeyRequest{}, "0a00"}, + {"pubKey response", &privvalproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, + {"pubKey response with error", &privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, + {"Vote Request", &privvalproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, + {"Vote Response", &privvalproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, + {"Vote Response with error", &privvalproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, + {"Proposal Request", &privvalproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, + {"Proposal Response", &privvalproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, + {"Proposal Response with error", &privvalproto.SignedProposalResponse{Proposal: tmproto.Proposal{}, Error: remoteError}, "32250a112a021200320b088092b8c398feffffff0112100801120c697427732061206572726f72"}, } for _, tc := range testCases { diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 36792a2da..6d4d44170 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -1,7 +1,7 @@ package proxy import ( - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" ocabci "github.com/line/ostracon/abci/types" @@ -17,34 +17,34 @@ type AppConnConsensus interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - InitChainSync(abci.RequestInitChain) (*abci.ResponseInitChain, error) + InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error) - BeginBlockSync(ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) - DeliverTxAsync(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes - EndBlockSync(abci.RequestEndBlock) (*abci.ResponseEndBlock, error) - CommitSync() (*abci.ResponseCommit, error) + BeginBlockSync(ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) + DeliverTxAsync(types.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes + EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error) + CommitSync() (*types.ResponseCommit, error) } type AppConnMempool interface { SetGlobalCallback(abcicli.GlobalCallback) Error() error - CheckTxAsync(abci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes - CheckTxSync(abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) + CheckTxAsync(types.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes + CheckTxSync(types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) BeginRecheckTxSync(ocabci.RequestBeginRecheckTx) (*ocabci.ResponseBeginRecheckTx, error) EndRecheckTxSync(ocabci.RequestEndRecheckTx) (*ocabci.ResponseEndRecheckTx, error) FlushAsync(abcicli.ResponseCallback) *abcicli.ReqRes - FlushSync() (*abci.ResponseFlush, error) + FlushSync() (*types.ResponseFlush, error) } type AppConnQuery interface { Error() error - EchoSync(string) (*abci.ResponseEcho, error) - InfoSync(abci.RequestInfo) (*abci.ResponseInfo, error) - QuerySync(abci.RequestQuery) (*abci.ResponseQuery, error) + EchoSync(string) (*types.ResponseEcho, error) + InfoSync(types.RequestInfo) (*types.ResponseInfo, error) + QuerySync(types.RequestQuery) (*types.ResponseQuery, error) // SetOptionSync(key string, value string) (res ocabci.Result) } @@ -52,10 +52,10 @@ type AppConnQuery interface { type AppConnSnapshot interface { Error() error - ListSnapshotsSync(abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) - OfferSnapshotSync(abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) - LoadSnapshotChunkSync(abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) - ApplySnapshotChunkSync(abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) + ListSnapshotsSync(types.RequestListSnapshots) (*types.ResponseListSnapshots, error) + OfferSnapshotSync(types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) + LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) + ApplySnapshotChunkSync(types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) } //----------------------------------------------------------------------------------------- @@ -79,23 +79,23 @@ func (app *appConnConsensus) Error() error { return app.appConn.Error() } -func (app *appConnConsensus) InitChainSync(req abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (app *appConnConsensus) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { return app.appConn.InitChainSync(req) } -func (app *appConnConsensus) BeginBlockSync(req ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { +func (app *appConnConsensus) BeginBlockSync(req ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) { return app.appConn.BeginBlockSync(req) } -func (app *appConnConsensus) DeliverTxAsync(req abci.RequestDeliverTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { +func (app *appConnConsensus) DeliverTxAsync(req types.RequestDeliverTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { return app.appConn.DeliverTxAsync(req, cb) } -func (app *appConnConsensus) EndBlockSync(req abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (app *appConnConsensus) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { return app.appConn.EndBlockSync(req) } -func (app *appConnConsensus) CommitSync() (*abci.ResponseCommit, error) { +func (app *appConnConsensus) CommitSync() (*types.ResponseCommit, error) { return app.appConn.CommitSync() } @@ -124,15 +124,15 @@ func (app *appConnMempool) FlushAsync(cb abcicli.ResponseCallback) *abcicli.ReqR return app.appConn.FlushAsync(cb) } -func (app *appConnMempool) FlushSync() (*abci.ResponseFlush, error) { +func (app *appConnMempool) FlushSync() (*types.ResponseFlush, error) { return app.appConn.FlushSync() } -func (app *appConnMempool) CheckTxAsync(req abci.RequestCheckTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { +func (app *appConnMempool) CheckTxAsync(req types.RequestCheckTx, cb abcicli.ResponseCallback) *abcicli.ReqRes { return app.appConn.CheckTxAsync(req, cb) } -func (app *appConnMempool) CheckTxSync(req abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (app *appConnMempool) CheckTxSync(req types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { return app.appConn.CheckTxSync(req) } @@ -161,15 +161,15 @@ func (app *appConnQuery) Error() error { return app.appConn.Error() } -func (app *appConnQuery) EchoSync(msg string) (*abci.ResponseEcho, error) { +func (app *appConnQuery) EchoSync(msg string) (*types.ResponseEcho, error) { return app.appConn.EchoSync(msg) } -func (app *appConnQuery) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { +func (app *appConnQuery) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { return app.appConn.InfoSync(req) } -func (app *appConnQuery) QuerySync(reqQuery abci.RequestQuery) (*abci.ResponseQuery, error) { +func (app *appConnQuery) QuerySync(reqQuery types.RequestQuery) (*types.ResponseQuery, error) { return app.appConn.QuerySync(reqQuery) } @@ -190,20 +190,20 @@ func (app *appConnSnapshot) Error() error { return app.appConn.Error() } -func (app *appConnSnapshot) ListSnapshotsSync(req abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { +func (app *appConnSnapshot) ListSnapshotsSync(req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { return app.appConn.ListSnapshotsSync(req) } -func (app *appConnSnapshot) OfferSnapshotSync(req abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { +func (app *appConnSnapshot) OfferSnapshotSync(req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { return app.appConn.OfferSnapshotSync(req) } func (app *appConnSnapshot) LoadSnapshotChunkSync( - req abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { + req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { return app.appConn.LoadSnapshotChunkSync(req) } func (app *appConnSnapshot) ApplySnapshotChunkSync( - req abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { + req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { return app.appConn.ApplySnapshotChunkSync(req) } diff --git a/proxy/app_conn_test.go b/proxy/app_conn_test.go index 62ce14148..149ed88f5 100644 --- a/proxy/app_conn_test.go +++ b/proxy/app_conn_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/kvstore" @@ -17,9 +17,9 @@ import ( //---------------------------------------- type AppConnTest interface { - FlushSync() (*abci.ResponseFlush, error) + FlushSync() (*types.ResponseFlush, error) EchoAsync(string, abcicli.ResponseCallback) *abcicli.ReqRes - InfoSync(abci.RequestInfo) (*abci.ResponseInfo, error) + InfoSync(types.RequestInfo) (*types.ResponseInfo, error) } type appConnTest struct { @@ -34,11 +34,11 @@ func (app *appConnTest) EchoAsync(msg string, cb abcicli.ResponseCallback) *abci return app.appConn.EchoAsync(msg, cb) } -func (app *appConnTest) FlushSync() (*abci.ResponseFlush, error) { +func (app *appConnTest) FlushSync() (*types.ResponseFlush, error) { return app.appConn.FlushSync() } -func (app *appConnTest) InfoSync(req abci.RequestInfo) (*abci.ResponseInfo, error) { +func (app *appConnTest) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { return app.appConn.InfoSync(req) } diff --git a/proxy/client.go b/proxy/client.go index e7d2b770b..59f1d73fe 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -6,7 +6,7 @@ import ( abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/counter" "github.com/line/ostracon/abci/example/kvstore" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/abci/types" tmsync "github.com/line/ostracon/libs/sync" e2e "github.com/line/ostracon/test/e2e/app" ) @@ -22,12 +22,12 @@ type ClientCreator interface { type localClientCreator struct { mtx *tmsync.Mutex - app ocabci.Application + app types.Application } // NewLocalClientCreator returns a ClientCreator for the given app, // which will be running locally. -func NewLocalClientCreator(app ocabci.Application) ClientCreator { +func NewLocalClientCreator(app types.Application) ClientCreator { return &localClientCreator{ mtx: new(tmsync.Mutex), app: app, @@ -87,7 +87,7 @@ func DefaultClientCreator(addr, transport, dbDir string) ClientCreator { } return NewLocalClientCreator(app) case "noop": - return NewLocalClientCreator(ocabci.NewBaseApplication()) + return NewLocalClientCreator(types.NewBaseApplication()) default: mustConnect := false // loop retrying return NewRemoteClientCreator(addr, transport, mustConnect) diff --git a/proxy/mocks/app_conn_consensus.go b/proxy/mocks/app_conn_consensus.go index 801bda651..dbd0a90e0 100644 --- a/proxy/mocks/app_conn_consensus.go +++ b/proxy/mocks/app_conn_consensus.go @@ -3,7 +3,7 @@ package mocks import ( - abci "github.com/tendermint/tendermint/abci/types" + types "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" ocabci "github.com/line/ostracon/abci/types" @@ -16,15 +16,15 @@ type AppConnConsensus struct { } // BeginBlockSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) BeginBlockSync(_a0 ocabci.RequestBeginBlock) (*abci.ResponseBeginBlock, error) { +func (_m *AppConnConsensus) BeginBlockSync(_a0 ocabci.RequestBeginBlock) (*types.ResponseBeginBlock, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseBeginBlock - if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) *abci.ResponseBeginBlock); ok { + var r0 *types.ResponseBeginBlock + if rf, ok := ret.Get(0).(func(ocabci.RequestBeginBlock) *types.ResponseBeginBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseBeginBlock) + r0 = ret.Get(0).(*types.ResponseBeginBlock) } } @@ -39,15 +39,15 @@ func (_m *AppConnConsensus) BeginBlockSync(_a0 ocabci.RequestBeginBlock) (*abci. } // CommitSync provides a mock function with given fields: -func (_m *AppConnConsensus) CommitSync() (*abci.ResponseCommit, error) { +func (_m *AppConnConsensus) CommitSync() (*types.ResponseCommit, error) { ret := _m.Called() - var r0 *abci.ResponseCommit - if rf, ok := ret.Get(0).(func() *abci.ResponseCommit); ok { + var r0 *types.ResponseCommit + if rf, ok := ret.Get(0).(func() *types.ResponseCommit); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseCommit) + r0 = ret.Get(0).(*types.ResponseCommit) } } @@ -62,11 +62,11 @@ func (_m *AppConnConsensus) CommitSync() (*abci.ResponseCommit, error) { } // DeliverTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *AppConnConsensus) DeliverTxAsync(_a0 abci.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *AppConnConsensus) DeliverTxAsync(_a0 types.RequestDeliverTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestDeliverTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -78,20 +78,20 @@ func (_m *AppConnConsensus) DeliverTxAsync(_a0 abci.RequestDeliverTx, _a1 abcicl } // EndBlockSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) EndBlockSync(_a0 abci.RequestEndBlock) (*abci.ResponseEndBlock, error) { +func (_m *AppConnConsensus) EndBlockSync(_a0 types.RequestEndBlock) (*types.ResponseEndBlock, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseEndBlock - if rf, ok := ret.Get(0).(func(abci.RequestEndBlock) *abci.ResponseEndBlock); ok { + var r0 *types.ResponseEndBlock + if rf, ok := ret.Get(0).(func(types.RequestEndBlock) *types.ResponseEndBlock); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseEndBlock) + r0 = ret.Get(0).(*types.ResponseEndBlock) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestEndBlock) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestEndBlock) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -115,20 +115,20 @@ func (_m *AppConnConsensus) Error() error { } // InitChainSync provides a mock function with given fields: _a0 -func (_m *AppConnConsensus) InitChainSync(_a0 abci.RequestInitChain) (*abci.ResponseInitChain, error) { +func (_m *AppConnConsensus) InitChainSync(_a0 types.RequestInitChain) (*types.ResponseInitChain, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseInitChain - if rf, ok := ret.Get(0).(func(abci.RequestInitChain) *abci.ResponseInitChain); ok { + var r0 *types.ResponseInitChain + if rf, ok := ret.Get(0).(func(types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseInitChain) + r0 = ret.Get(0).(*types.ResponseInitChain) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestInitChain) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestInitChain) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_mempool.go b/proxy/mocks/app_conn_mempool.go index 5e955a480..11fecf0e9 100644 --- a/proxy/mocks/app_conn_mempool.go +++ b/proxy/mocks/app_conn_mempool.go @@ -4,7 +4,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - abci "github.com/tendermint/tendermint/abci/types" + types "github.com/tendermint/tendermint/abci/types" abcicli "github.com/line/ostracon/abci/client" ocabci "github.com/line/ostracon/abci/types" @@ -39,11 +39,11 @@ func (_m *AppConnMempool) BeginRecheckTxSync(_a0 ocabci.RequestBeginRecheckTx) ( } // CheckTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *AppConnMempool) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { +func (_m *AppConnMempool) CheckTxAsync(_a0 types.RequestCheckTx, _a1 abcicli.ResponseCallback) *abcicli.ReqRes { ret := _m.Called(_a0, _a1) var r0 *abcicli.ReqRes - if rf, ok := ret.Get(0).(func(abci.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { + if rf, ok := ret.Get(0).(func(types.RequestCheckTx, abcicli.ResponseCallback) *abcicli.ReqRes); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -55,11 +55,11 @@ func (_m *AppConnMempool) CheckTxAsync(_a0 abci.RequestCheckTx, _a1 abcicli.Resp } // CheckTxSync provides a mock function with given fields: _a0 -func (_m *AppConnMempool) CheckTxSync(_a0 abci.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { +func (_m *AppConnMempool) CheckTxSync(_a0 types.RequestCheckTx) (*ocabci.ResponseCheckTx, error) { ret := _m.Called(_a0) var r0 *ocabci.ResponseCheckTx - if rf, ok := ret.Get(0).(func(abci.RequestCheckTx) *ocabci.ResponseCheckTx); ok { + if rf, ok := ret.Get(0).(func(types.RequestCheckTx) *ocabci.ResponseCheckTx); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { @@ -68,7 +68,7 @@ func (_m *AppConnMempool) CheckTxSync(_a0 abci.RequestCheckTx) (*ocabci.Response } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestCheckTx) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestCheckTx) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -131,15 +131,15 @@ func (_m *AppConnMempool) FlushAsync(_a0 abcicli.ResponseCallback) *abcicli.ReqR } // FlushSync provides a mock function with given fields: -func (_m *AppConnMempool) FlushSync() (*abci.ResponseFlush, error) { +func (_m *AppConnMempool) FlushSync() (*types.ResponseFlush, error) { ret := _m.Called() - var r0 *abci.ResponseFlush - if rf, ok := ret.Get(0).(func() *abci.ResponseFlush); ok { + var r0 *types.ResponseFlush + if rf, ok := ret.Get(0).(func() *types.ResponseFlush); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseFlush) + r0 = ret.Get(0).(*types.ResponseFlush) } } diff --git a/proxy/mocks/app_conn_query.go b/proxy/mocks/app_conn_query.go index f1b137279..942311e02 100644 --- a/proxy/mocks/app_conn_query.go +++ b/proxy/mocks/app_conn_query.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - abci "github.com/tendermint/tendermint/abci/types" + types "github.com/tendermint/tendermint/abci/types" ) // AppConnQuery is an autogenerated mock type for the AppConnQuery type @@ -14,15 +14,15 @@ type AppConnQuery struct { } // EchoSync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) EchoSync(_a0 string) (*abci.ResponseEcho, error) { +func (_m *AppConnQuery) EchoSync(_a0 string) (*types.ResponseEcho, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseEcho - if rf, ok := ret.Get(0).(func(string) *abci.ResponseEcho); ok { + var r0 *types.ResponseEcho + if rf, ok := ret.Get(0).(func(string) *types.ResponseEcho); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseEcho) + r0 = ret.Get(0).(*types.ResponseEcho) } } @@ -51,20 +51,20 @@ func (_m *AppConnQuery) Error() error { } // InfoSync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) InfoSync(_a0 abci.RequestInfo) (*abci.ResponseInfo, error) { +func (_m *AppConnQuery) InfoSync(_a0 types.RequestInfo) (*types.ResponseInfo, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseInfo - if rf, ok := ret.Get(0).(func(abci.RequestInfo) *abci.ResponseInfo); ok { + var r0 *types.ResponseInfo + if rf, ok := ret.Get(0).(func(types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseInfo) + r0 = ret.Get(0).(*types.ResponseInfo) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestInfo) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestInfo) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -74,20 +74,20 @@ func (_m *AppConnQuery) InfoSync(_a0 abci.RequestInfo) (*abci.ResponseInfo, erro } // QuerySync provides a mock function with given fields: _a0 -func (_m *AppConnQuery) QuerySync(_a0 abci.RequestQuery) (*abci.ResponseQuery, error) { +func (_m *AppConnQuery) QuerySync(_a0 types.RequestQuery) (*types.ResponseQuery, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseQuery - if rf, ok := ret.Get(0).(func(abci.RequestQuery) *abci.ResponseQuery); ok { + var r0 *types.ResponseQuery + if rf, ok := ret.Get(0).(func(types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseQuery) + r0 = ret.Get(0).(*types.ResponseQuery) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestQuery) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestQuery) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/proxy/mocks/app_conn_snapshot.go b/proxy/mocks/app_conn_snapshot.go index e7779077d..d77f6a16b 100644 --- a/proxy/mocks/app_conn_snapshot.go +++ b/proxy/mocks/app_conn_snapshot.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - abci "github.com/tendermint/tendermint/abci/types" + types "github.com/tendermint/tendermint/abci/types" ) // AppConnSnapshot is an autogenerated mock type for the AppConnSnapshot type @@ -14,20 +14,20 @@ type AppConnSnapshot struct { } // ApplySnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) ApplySnapshotChunkSync(_a0 abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) { +func (_m *AppConnSnapshot) ApplySnapshotChunkSync(_a0 types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(abci.RequestApplySnapshotChunk) *abci.ResponseApplySnapshotChunk); ok { + var r0 *types.ResponseApplySnapshotChunk + if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseApplySnapshotChunk) + r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestApplySnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -51,20 +51,20 @@ func (_m *AppConnSnapshot) Error() error { } // ListSnapshotsSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) { +func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(abci.RequestListSnapshots) *abci.ResponseListSnapshots); ok { + var r0 *types.ResponseListSnapshots + if rf, ok := ret.Get(0).(func(types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseListSnapshots) + r0 = ret.Get(0).(*types.ResponseListSnapshots) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestListSnapshots) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestListSnapshots) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -74,20 +74,20 @@ func (_m *AppConnSnapshot) ListSnapshotsSync(_a0 abci.RequestListSnapshots) (*ab } // LoadSnapshotChunkSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) { +func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(abci.RequestLoadSnapshotChunk) *abci.ResponseLoadSnapshotChunk); ok { + var r0 *types.ResponseLoadSnapshotChunk + if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseLoadSnapshotChunk) + r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestLoadSnapshotChunk) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -97,20 +97,20 @@ func (_m *AppConnSnapshot) LoadSnapshotChunkSync(_a0 abci.RequestLoadSnapshotChu } // OfferSnapshotSync provides a mock function with given fields: _a0 -func (_m *AppConnSnapshot) OfferSnapshotSync(_a0 abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) { +func (_m *AppConnSnapshot) OfferSnapshotSync(_a0 types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { ret := _m.Called(_a0) - var r0 *abci.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(abci.RequestOfferSnapshot) *abci.ResponseOfferSnapshot); ok { + var r0 *types.ResponseOfferSnapshot + if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*abci.ResponseOfferSnapshot) + r0 = ret.Get(0).(*types.ResponseOfferSnapshot) } } var r1 error - if rf, ok := ret.Get(1).(func(abci.RequestOfferSnapshot) error); ok { + if rf, ok := ret.Get(1).(func(types.RequestOfferSnapshot) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) diff --git a/rpc/client/event_test.go b/rpc/client/event_test.go index df48f9fd4..43b97477a 100644 --- a/rpc/client/event_test.go +++ b/rpc/client/event_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" tmrand "github.com/line/ostracon/libs/rand" "github.com/line/ostracon/rpc/client" ctypes "github.com/line/ostracon/rpc/core/types" @@ -137,7 +137,7 @@ func testTxEventsSent(t *testing.T, broadcastMethod string) { panic(fmt.Sprintf("Unknown broadcastMethod %s", broadcastMethod)) } if assert.NoError(t, err) { - assert.Equal(t, txres.Code, ocabci.CodeTypeOK) + assert.Equal(t, txres.Code, abci.CodeTypeOK) } }() diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index b73e871d4..a8b2baadc 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" tmjson "github.com/line/ostracon/libs/json" "github.com/line/ostracon/libs/log" tmmath "github.com/line/ostracon/libs/math" @@ -340,7 +340,7 @@ func TestBroadcastTxSync(t *testing.T) { _, _, tx := MakeTxKV() bres, err := c.BroadcastTxSync(context.Background(), tx) require.Nil(err, "%d: %+v", i, err) - require.Equal(bres.Code, ocabci.CodeTypeOK) // FIXME + require.Equal(bres.Code, abci.CodeTypeOK) // FIXME require.Equal(initMempoolSize+1, mempool.Size()) @@ -368,11 +368,11 @@ func TestBroadcastTxCommit(t *testing.T) { func TestUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *ocabci.Response, 1) + ch := make(chan *abci.Response, 1) mempool := node.Mempool() mempool.CheckTxAsync(tx, mempl.TxInfo{}, func(err error) { require.NoError(t, err) - }, func(resp *ocabci.Response) { + }, func(resp *abci.Response) { ch <- resp }) @@ -401,11 +401,11 @@ func TestUnconfirmedTxs(t *testing.T) { func TestNumUnconfirmedTxs(t *testing.T) { _, _, tx := MakeTxKV() - ch := make(chan *ocabci.Response, 1) + ch := make(chan *abci.Response, 1) mempool := node.Mempool() mempool.CheckTxAsync(tx, mempl.TxInfo{}, func(err error) { require.NoError(t, err) - }, func(resp *ocabci.Response) { + }, func(resp *abci.Response) { ch <- resp }) @@ -439,7 +439,7 @@ func TestCheckTx(t *testing.T) { res, err := c.CheckTx(context.Background(), tx) require.NoError(t, err) - assert.Equal(t, ocabci.CodeTypeOK, res.Code) + assert.Equal(t, abci.CodeTypeOK, res.Code) assert.Equal(t, 0, mempool.Size(), "mempool must be empty") } diff --git a/rpc/core/blocks_test.go b/rpc/core/blocks_test.go index 61653f2de..cd13f8b01 100644 --- a/rpc/core/blocks_test.go +++ b/rpc/core/blocks_test.go @@ -22,7 +22,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" ctypes "github.com/line/ostracon/rpc/core/types" rpctypes "github.com/line/ostracon/rpc/jsonrpc/types" sm "github.com/line/ostracon/state" @@ -82,7 +82,7 @@ func TestBlockchainInfo(t *testing.T) { } func TestBlockResults(t *testing.T) { - results := &ocstate.ABCIResponses{ + results := &tmstate.ABCIResponses{ DeliverTxs: []*abci.ResponseDeliverTx{ {Code: 0, Data: []byte{0x01}, Log: "ok"}, {Code: 0, Data: []byte{0x02}, Log: "ok"}, diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index b54ea8d3f..0ffd114ef 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -222,12 +222,12 @@ type ResultUnconfirmedTxs struct { Txs []types.Tx `json:"txs"` } -// Info ocabci msg +// Info abci msg type ResultABCIInfo struct { Response abci.ResponseInfo `json:"response"` } -// Query ocabci msg +// Query abci msg type ResultABCIQuery struct { Response abci.ResponseQuery `json:"response"` } diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index dd5f71e9f..6e86195fb 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -8,7 +8,7 @@ import ( "strings" "time" - ocabci "github.com/line/ostracon/abci/types" + abci "github.com/line/ostracon/abci/types" cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" @@ -116,7 +116,7 @@ func GetGRPCClient() core_grpc.BroadcastAPIClient { } // StartOstracon starts a test ostracon server in a go routine and returns when it is initialized -func StartOstracon(app ocabci.Application, opts ...func(*Options)) *nm.Node { +func StartOstracon(app abci.Application, opts ...func(*Options)) *nm.Node { nodeOpts := defaultOptions for _, opt := range opts { opt(&nodeOpts) @@ -149,7 +149,7 @@ func StopOstracon(node *nm.Node) { } // NewOstracon creates a new ostracon server and sleeps forever -func NewOstracon(app ocabci.Application, opts *Options) *nm.Node { +func NewOstracon(app abci.Application, opts *Options) *nm.Node { // Create & start node config := GetConfig(opts.recreateConfig) var logger log.Logger diff --git a/state/execution.go b/state/execution.go index 5f9280382..1e7f7e5cb 100644 --- a/state/execution.go +++ b/state/execution.go @@ -17,7 +17,7 @@ import ( "github.com/line/ostracon/libs/fail" "github.com/line/ostracon/libs/log" mempl "github.com/line/ostracon/mempool" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" ) @@ -344,11 +344,11 @@ func execBlockOnProxyApp( block *types.Block, store Store, initialHeight int64, -) (*ocstate.ABCIResponses, error) { +) (*tmstate.ABCIResponses, error) { var validTxs, invalidTxs = 0, 0 txIndex := 0 - abciResponses := new(ocstate.ABCIResponses) + abciResponses := new(tmstate.ABCIResponses) dtxs := make([]*abci.ResponseDeliverTx, len(block.Txs)) abciResponses.DeliverTxs = dtxs @@ -494,7 +494,7 @@ func updateState( state State, blockID types.BlockID, header *types.Header, - abciResponses *ocstate.ABCIResponses, + abciResponses *tmstate.ABCIResponses, validatorUpdates []*types.Validator, ) (State, error) { @@ -569,7 +569,7 @@ func fireEvents( logger log.Logger, eventBus types.BlockEventPublisher, block *types.Block, - abciResponses *ocstate.ABCIResponses, + abciResponses *tmstate.ABCIResponses, validatorUpdates []*types.Validator, ) { if err := eventBus.PublishEventNewBlock(types.EventDataNewBlock{ diff --git a/state/export_test.go b/state/export_test.go index cfb9c5a33..bdfe7e7fd 100644 --- a/state/export_test.go +++ b/state/export_test.go @@ -5,7 +5,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/types" ) @@ -28,7 +28,7 @@ func UpdateState( state State, blockID types.BlockID, header *types.Header, - abciResponses *ocstate.ABCIResponses, + abciResponses *tmstate.ABCIResponses, validatorUpdates []*types.Validator, ) (State, error) { return updateState(state, blockID, header, abciResponses, validatorUpdates) diff --git a/state/helpers_test.go b/state/helpers_test.go index b2f7dc484..a3515774e 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -13,7 +13,7 @@ import ( "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" tmrand "github.com/line/ostracon/libs/rand" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" @@ -172,10 +172,10 @@ func genValSet(size int) *types.ValidatorSet { func makeHeaderPartsResponsesValPubKeyChange( state sm.State, pubkey crypto.PubKey, -) (types.Header, types.BlockID, *ocstate.ABCIResponses) { +) (types.Header, types.BlockID, *tmstate.ABCIResponses) { block := makeBlock(state, state.LastBlockHeight+1) - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -196,10 +196,10 @@ func makeHeaderPartsResponsesValPubKeyChange( func makeHeaderPartsResponsesValPowerChange( state sm.State, power int64, -) (types.Header, types.BlockID, *ocstate.ABCIResponses) { +) (types.Header, types.BlockID, *tmstate.ABCIResponses) { block := makeBlock(state, state.LastBlockHeight+1) - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -220,10 +220,10 @@ func makeHeaderPartsResponsesValPowerChange( func makeHeaderPartsResponsesParams( state sm.State, params tmproto.ConsensusParams, -) (types.Header, types.BlockID, *ocstate.ABCIResponses) { +) (types.Header, types.BlockID, *tmstate.ABCIResponses) { block := makeBlock(state, state.LastBlockHeight+1) - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ConsensusParamUpdates: types.OC2PB.ConsensusParams(¶ms)}, } diff --git a/state/mocks/store.go b/state/mocks/store.go index cc3282bc8..7fc3bcbbc 100644 --- a/state/mocks/store.go +++ b/state/mocks/store.go @@ -3,10 +3,10 @@ package mocks import ( - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + types "github.com/tendermint/tendermint/proto/tendermint/types" mock "github.com/stretchr/testify/mock" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" state "github.com/line/ostracon/state" ostracontypes "github.com/line/ostracon/types" ) @@ -66,15 +66,15 @@ func (_m *Store) Load() (state.State, error) { } // LoadABCIResponses provides a mock function with given fields: _a0 -func (_m *Store) LoadABCIResponses(_a0 int64) (*ocstate.ABCIResponses, error) { +func (_m *Store) LoadABCIResponses(_a0 int64) (*tmstate.ABCIResponses, error) { ret := _m.Called(_a0) - var r0 *ocstate.ABCIResponses - if rf, ok := ret.Get(0).(func(int64) *ocstate.ABCIResponses); ok { + var r0 *tmstate.ABCIResponses + if rf, ok := ret.Get(0).(func(int64) *tmstate.ABCIResponses); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ocstate.ABCIResponses) + r0 = ret.Get(0).(*tmstate.ABCIResponses) } } @@ -89,14 +89,14 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*ocstate.ABCIResponses, error) { } // LoadConsensusParams provides a mock function with given fields: _a0 -func (_m *Store) LoadConsensusParams(_a0 int64) (tmproto.ConsensusParams, error) { +func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { ret := _m.Called(_a0) - var r0 tmproto.ConsensusParams - if rf, ok := ret.Get(0).(func(int64) tmproto.ConsensusParams); ok { + var r0 types.ConsensusParams + if rf, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(tmproto.ConsensusParams) + r0 = ret.Get(0).(types.ConsensusParams) } var r1 error @@ -226,11 +226,11 @@ func (_m *Store) Save(_a0 state.State) error { } // SaveABCIResponses provides a mock function with given fields: _a0, _a1 -func (_m *Store) SaveABCIResponses(_a0 int64, _a1 *ocstate.ABCIResponses) error { +func (_m *Store) SaveABCIResponses(_a0 int64, _a1 *tmstate.ABCIResponses) error { ret := _m.Called(_a0, _a1) var r0 error - if rf, ok := ret.Get(0).(func(int64, *ocstate.ABCIResponses) error); ok { + if rf, ok := ret.Get(0).(func(int64, *tmstate.ABCIResponses) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) diff --git a/state/state_test.go b/state/state_test.go index 9ffb71765..fd4aa3807 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -21,7 +21,7 @@ import ( "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" tmrand "github.com/line/ostracon/libs/rand" - ocstate "github.com/line/ostracon/proto/ostracon/state" + tmstate "github.com/line/ostracon/proto/ostracon/state" sm "github.com/line/ostracon/state" "github.com/line/ostracon/types" tmtime "github.com/line/ostracon/types/time" @@ -106,7 +106,7 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { // Build mock responses. block := makeBlock(state, 2) - abciResponses := new(ocstate.ABCIResponses) + abciResponses := new(tmstate.ABCIResponses) dtxs := make([]*abci.ResponseDeliverTx, 2) abciResponses.DeliverTxs = dtxs @@ -188,7 +188,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { // Add all cases. for i, tc := range cases { h := int64(i + 1) // last block height, one below what we save - responses := &ocstate.ABCIResponses{ + responses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.added, EndBlock: &abci.ResponseEndBlock{}, @@ -203,7 +203,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { res, err := stateStore.LoadABCIResponses(h) if assert.NoError(err, "%d", i) { t.Log(res) - responses := &ocstate.ABCIResponses{ + responses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, DeliverTxs: tc.expected, EndBlock: &abci.ResponseEndBlock{}, @@ -490,7 +490,7 @@ func TestProposerPriorityDoesNotGetResetToZero(t *testing.T) { block := makeBlock(state, state.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -607,7 +607,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { block := makeBlock(state, state.LastBlockHeight+1) blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} // no updates: - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -710,7 +710,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { // no changes in voting power and both validators have same voting power // -> proposers should alternate: oldState := updatedState3 - abciResponses = &ocstate.ABCIResponses{ + abciResponses = &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -726,7 +726,7 @@ func TestProposerPriorityProposerAlternates(t *testing.T) { for i := 0; i < 1000; i++ { // no validator updates: - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -785,7 +785,7 @@ func TestLargeGenesisValidator(t *testing.T) { oldState := state for i := 0; i < 10; i++ { // no updates: - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -818,7 +818,7 @@ func TestLargeGenesisValidator(t *testing.T) { firstAddedVal := abci.ValidatorUpdate{PubKey: fvp, Power: firstAddedValVotingPower} validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{firstAddedVal}) assert.NoError(t, err) - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{firstAddedVal}}, } @@ -830,7 +830,7 @@ func TestLargeGenesisValidator(t *testing.T) { lastState := updatedState for i := 0; i < 200; i++ { // no updates: - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -866,7 +866,7 @@ func TestLargeGenesisValidator(t *testing.T) { validatorUpdates, err := types.PB2OC.ValidatorUpdates([]abci.ValidatorUpdate{addedVal}) assert.NoError(t, err) - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{addedVal}}, } @@ -881,7 +881,7 @@ func TestLargeGenesisValidator(t *testing.T) { gp, err := cryptoenc.PubKeyToProto(genesisPubKey) require.NoError(t, err) removeGenesisVal := abci.ValidatorUpdate{PubKey: gp, Power: 0} - abciResponses = &ocstate.ABCIResponses{ + abciResponses = &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{removeGenesisVal}}, } @@ -900,7 +900,7 @@ func TestLargeGenesisValidator(t *testing.T) { count := 0 isProposerUnchanged := true for isProposerUnchanged { - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } @@ -925,7 +925,7 @@ func TestLargeGenesisValidator(t *testing.T) { proposers := make([]*types.Validator, numVals) for i := 0; i < 100; i++ { // no updates: - abciResponses := &ocstate.ABCIResponses{ + abciResponses := &tmstate.ABCIResponses{ BeginBlock: &abci.ResponseBeginBlock{}, EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } diff --git a/statesync/messages_test.go b/statesync/messages_test.go index 221e2c2da..3f7d713ae 100644 --- a/statesync/messages_test.go +++ b/statesync/messages_test.go @@ -9,7 +9,7 @@ import ( ssproto "github.com/tendermint/tendermint/proto/tendermint/statesync" - ocproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/line/ostracon/proto/ostracon/types" ) func TestValidateMsg(t *testing.T) { @@ -18,7 +18,7 @@ func TestValidateMsg(t *testing.T) { valid bool }{ "nil": {nil, false}, - "unrelated": {&ocproto.Block{}, false}, + "unrelated": {&tmproto.Block{}, false}, "ChunkRequest valid": {&ssproto.ChunkRequest{Height: 1, Format: 1, Index: 1}, true}, "ChunkRequest 0 height": {&ssproto.ChunkRequest{Height: 0, Format: 1, Index: 1}, false}, diff --git a/statesync/stateprovider_test.go b/statesync/stateprovider_test.go index 6cfb78c00..3d344505f 100644 --- a/statesync/stateprovider_test.go +++ b/statesync/stateprovider_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmstate "github.com/tendermint/tendermint/proto/tendermint/state" + "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" @@ -38,7 +38,7 @@ func TestNewLightClientStateProvider(t *testing.T) { type args struct { ctx context.Context chainID string - version tmstate.Version + version state.Version initialHeight int64 servers []string trustOptions light.TrustOptions diff --git a/test/kms/bench_test.go b/test/kms/bench_test.go index f00800713..3ab39b4d0 100644 --- a/test/kms/bench_test.go +++ b/test/kms/bench_test.go @@ -3,7 +3,6 @@ // // $ cd test/kms // $ go test -tags libsodium -bench . -benchmem -// package main import ( @@ -15,7 +14,7 @@ import ( "github.com/stretchr/testify/require" tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + types2 "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/config" "github.com/line/ostracon/crypto" @@ -102,7 +101,7 @@ func benchmarkSignVote(b *testing.B, pv types.PrivValidator, pubKey crypto.PubKe }, } vote := types.Vote{ - Type: tmproto.PrevoteType, + Type: types2.PrevoteType, Height: 1, Round: 0, BlockID: blockID, @@ -138,7 +137,7 @@ func benchmarkSignProposal(b *testing.B, pv types.PrivValidator, pubKey crypto.P }, } proposal := types.Proposal{ - Type: tmproto.ProposalType, + Type: types2.ProposalType, Height: 2, Round: 0, POLRound: -1, diff --git a/types/block_meta.go b/types/block_meta.go index 6aeb136a0..709803187 100644 --- a/types/block_meta.go +++ b/types/block_meta.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - ocproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/line/ostracon/proto/ostracon/types" ) // BlockMeta contains meta information. @@ -26,12 +26,12 @@ func NewBlockMeta(block *Block, blockParts *PartSet) *BlockMeta { } } -func (bm *BlockMeta) ToProto() *ocproto.BlockMeta { +func (bm *BlockMeta) ToProto() *tmproto.BlockMeta { if bm == nil { return nil } - pb := &ocproto.BlockMeta{ + pb := &tmproto.BlockMeta{ BlockID: bm.BlockID.ToProto(), BlockSize: int64(bm.BlockSize), Header: *bm.Header.ToProto(), @@ -40,7 +40,7 @@ func (bm *BlockMeta) ToProto() *ocproto.BlockMeta { return pb } -func BlockMetaFromProto(pb *ocproto.BlockMeta) (*BlockMeta, error) { +func BlockMetaFromProto(pb *tmproto.BlockMeta) (*BlockMeta, error) { if pb == nil { return nil, errors.New("blockmeta is empty") } diff --git a/types/event_bus.go b/types/event_bus.go index d876c454e..f294dc0b6 100644 --- a/types/event_bus.go +++ b/types/event_bus.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/abci/types" "github.com/line/ostracon/libs/log" tmpubsub "github.com/line/ostracon/libs/pubsub" @@ -30,7 +30,7 @@ type Subscription interface { // EventBus is a common bus for all events going through the system. All calls // are proxied to underlying pubsub server. All events must be published using -// EventBus to ensure correct data abci. +// EventBus to ensure correct data types. type EventBus struct { service.BaseService pubsub *tmpubsub.Server @@ -110,7 +110,7 @@ func (b *EventBus) Publish(eventType string, eventData OCEventData) error { // map of stringified events where each key is composed of the event // type and each of the event's attributes keys in the form of // "{event.Type}.{attribute.Key}" and the value is each attribute's value. -func (b *EventBus) validateAndStringifyEvents(events []abci.Event, logger log.Logger) map[string][]string { +func (b *EventBus) validateAndStringifyEvents(events []types.Event, logger log.Logger) map[string][]string { result := make(map[string][]string) for _, event := range events { if len(event.Type) == 0 { @@ -228,7 +228,7 @@ func (b *EventBus) PublishEventValidatorSetUpdates(data EventDataValidatorSetUpd return b.Publish(EventValidatorSetUpdates, data) } -//----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- type NopEventBus struct{} func (NopEventBus) Subscribe( diff --git a/types/light.go b/types/light.go index 2e67ef82c..a30c636f1 100644 --- a/types/light.go +++ b/types/light.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - ocproto "github.com/line/ostracon/proto/ostracon/types" + tmproto "github.com/line/ostracon/proto/ostracon/types" ) // LightBlock is a SignedHeader and a ValidatorSet. @@ -63,12 +63,12 @@ func (lb LightBlock) StringIndented(indent string) string { } // ToProto converts the LightBlock to protobuf -func (lb *LightBlock) ToProto() (*ocproto.LightBlock, error) { +func (lb *LightBlock) ToProto() (*tmproto.LightBlock, error) { if lb == nil { return nil, nil } - lbp := new(ocproto.LightBlock) + lbp := new(tmproto.LightBlock) var err error if lb.SignedHeader != nil { lbp.SignedHeader = lb.SignedHeader.ToProto() @@ -85,7 +85,7 @@ func (lb *LightBlock) ToProto() (*ocproto.LightBlock, error) { // LightBlockFromProto converts from protobuf back into the Lightblock. // An error is returned if either the validator set or signed header are invalid -func LightBlockFromProto(pb *ocproto.LightBlock) (*LightBlock, error) { +func LightBlockFromProto(pb *tmproto.LightBlock) (*LightBlock, error) { if pb == nil { return nil, errors.New("nil light block") } @@ -176,12 +176,12 @@ func (sh SignedHeader) StringIndented(indent string) string { } // ToProto converts SignedHeader to protobuf -func (sh *SignedHeader) ToProto() *ocproto.SignedHeader { +func (sh *SignedHeader) ToProto() *tmproto.SignedHeader { if sh == nil { return nil } - psh := new(ocproto.SignedHeader) + psh := new(tmproto.SignedHeader) if sh.Header != nil { psh.Header = sh.Header.ToProto() } @@ -194,7 +194,7 @@ func (sh *SignedHeader) ToProto() *ocproto.SignedHeader { // FromProto sets a protobuf SignedHeader to the given pointer. // It returns an error if the header or the commit is invalid. -func SignedHeaderFromProto(shp *ocproto.SignedHeader) (*SignedHeader, error) { +func SignedHeaderFromProto(shp *tmproto.SignedHeader) (*SignedHeader, error) { if shp == nil { return nil, errors.New("nil SignedHeader") } diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 6fd798c72..e5bdaa82c 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/go-amino" abci "github.com/tendermint/tendermint/abci/types" - tmversion "github.com/tendermint/tendermint/proto/tendermint/version" + "github.com/tendermint/tendermint/proto/tendermint/version" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" @@ -83,7 +83,7 @@ func TestABCIHeader(t *testing.T) { // build a full header var height int64 = 5 header := newHeader(height, []byte("lastCommitHash"), []byte("dataHash"), []byte("evidenceHash")) - protocolVersion := tmversion.Consensus{Block: 7, App: 8} + protocolVersion := version.Consensus{Block: 7, App: 8} timestamp := time.Now() lastBlockID := BlockID{ Hash: []byte("hash"), From 6228cf2da5cca48195fafa9b0a4dfeba26a73626 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 27 Jan 2023 14:59:09 +0900 Subject: [PATCH 22/25] chore: modify import alias to reduce the difference previous codes. --- abci/cmd/abci-cli/abci-cli.go | 4 ++-- privval/msgs_test.go | 26 +++++++++++++------------- proxy/app_conn_test.go | 2 +- rpc/test/helpers.go | 1 - 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 4112932c2..9dff748f2 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -14,7 +14,7 @@ import ( "github.com/spf13/cobra" "github.com/tendermint/tendermint/abci/types" - tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + "github.com/tendermint/tendermint/proto/tendermint/crypto" abcicli "github.com/line/ostracon/abci/client" "github.com/line/ostracon/abci/example/code" @@ -109,7 +109,7 @@ type queryResponse struct { Key []byte Value []byte Height int64 - ProofOps *tmcrypto.ProofOps + ProofOps *crypto.ProofOps } func Execute() error { diff --git a/privval/msgs_test.go b/privval/msgs_test.go index c12df2297..c8d9577a7 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -6,7 +6,7 @@ import ( "time" cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" - privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/gogo/protobuf/proto" @@ -73,24 +73,24 @@ func TestPrivvalVectors(t *testing.T) { proposalpb := proposal.ToProto() // Create a Reuseable remote error - remoteError := &privvalproto.RemoteSignerError{Code: 1, Description: "it's a error"} + remoteError := &privproto.RemoteSignerError{Code: 1, Description: "it's a error"} testCases := []struct { testName string msg proto.Message expBytes string }{ - {"ping request", &privvalproto.PingRequest{}, "3a00"}, - {"ping response", &privvalproto.PingResponse{}, "4200"}, - {"pubKey request", &privvalproto.PubKeyRequest{}, "0a00"}, - {"pubKey response", &privvalproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, - {"pubKey response with error", &privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, - {"Vote Request", &privvalproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, - {"Vote Response", &privvalproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, - {"Vote Response with error", &privvalproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, - {"Proposal Request", &privvalproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, - {"Proposal Response", &privvalproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, - {"Proposal Response with error", &privvalproto.SignedProposalResponse{Proposal: tmproto.Proposal{}, Error: remoteError}, "32250a112a021200320b088092b8c398feffffff0112100801120c697427732061206572726f72"}, + {"ping request", &privproto.PingRequest{}, "3a00"}, + {"ping response", &privproto.PingResponse{}, "4200"}, + {"pubKey request", &privproto.PubKeyRequest{}, "0a00"}, + {"pubKey response", &privproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12240a220a20556a436f1218d30942efe798420f51dc9b6a311b929c578257457d05c5fcf230"}, + {"pubKey response with error", &privproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, + {"Vote Request", &privproto.SignVoteRequest{Vote: votepb}, "1a760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, + {"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22760a74080110031802224a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a2a0608f49a8ded0532146af1f4111082efb388211bc72c55bcd61e9ac3d538d5bb03"}, + {"Vote Response with error", &privproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22250a11220212002a0b088092b8c398feffffff0112100801120c697427732061206572726f72"}, + {"Proposal Request", &privproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, + {"Proposal Response", &privproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, + {"Proposal Response with error", &privproto.SignedProposalResponse{Proposal: tmproto.Proposal{}, Error: remoteError}, "32250a112a021200320b088092b8c398feffffff0112100801120c697427732061206572726f72"}, } for _, tc := range testCases { diff --git a/proxy/app_conn_test.go b/proxy/app_conn_test.go index 149ed88f5..7177ebd11 100644 --- a/proxy/app_conn_test.go +++ b/proxy/app_conn_test.go @@ -125,7 +125,7 @@ func BenchmarkEcho(b *testing.B) { } b.StopTimer() - // info := proxy.InfoSync(abci.RequestInfo{""}) + // info := proxy.InfoSync(types.RequestInfo{""}) // b.Log("N: ", b.N, info) } diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index 6e86195fb..88391dea8 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -9,7 +9,6 @@ import ( "time" abci "github.com/line/ostracon/abci/types" - cfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" tmnet "github.com/line/ostracon/libs/net" From 167616bc56b20e9b498fded7f48d26a86f64266c Mon Sep 17 00:00:00 2001 From: zemyblue Date: Mon, 30 Jan 2023 20:15:50 +0900 Subject: [PATCH 23/25] Update abci/client/local_client.go Apply feed-back Co-authored-by: Toshimasa Nasu --- abci/client/local_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abci/client/local_client.go b/abci/client/local_client.go index 7180897ac..a26436f80 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -19,7 +19,7 @@ type localClient struct { // TODO: remove `mtx` to increase concurrency. We could remove it because the app should protect itself. mtx *tmsync.Mutex - // CONTRACT: The application should protect itself from concurrency as an ocabci server. + // CONTRACT: The application should protect itself from concurrency as an abci server. ocabci.Application globalCbMtx tmsync.Mutex From ad02e74bda67bf3abcce89253f191688670a0d8b Mon Sep 17 00:00:00 2001 From: zemyblue Date: Mon, 30 Jan 2023 20:16:21 +0900 Subject: [PATCH 24/25] Update mempool/clist_mempool_test.go chore: apply feed-back Co-authored-by: Toshimasa Nasu --- mempool/clist_mempool_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mempool/clist_mempool_test.go b/mempool/clist_mempool_test.go index 872ed27c8..091202c1b 100644 --- a/mempool/clist_mempool_test.go +++ b/mempool/clist_mempool_test.go @@ -677,7 +677,7 @@ func newRemoteApp( // Start server server = abciserver.NewSocketServer(addr, app) - server.SetLogger(log.TestingLogger().With("module", "ocabci-server")) + server.SetLogger(log.TestingLogger().With("module", "abci-server")) if err := server.Start(); err != nil { t.Fatalf("Error starting socket server: %v", err.Error()) } From 2b1fa41ba0d23c3bea6e39bb2baa5fac743a232e Mon Sep 17 00:00:00 2001 From: zemyblue Date: Tue, 31 Jan 2023 17:13:38 +0900 Subject: [PATCH 25/25] chore: change import alias of `ocprivvalproto` and `tmprivvalproto` --- privval/msgs.go | 50 ++++++++++++------------- privval/signer_client.go | 14 +++---- privval/signer_client_test.go | 26 ++++++------- privval/signer_endpoint.go | 6 +-- privval/signer_listener_endpoint.go | 8 ++-- privval/signer_requestHandler.go | 58 ++++++++++++++--------------- privval/signer_server.go | 8 ++-- rpc/client/evidence_test.go | 5 +-- state/execution.go | 5 +-- test/kms/bench_test.go | 10 ++--- 10 files changed, 94 insertions(+), 96 deletions(-) diff --git a/privval/msgs.go b/privval/msgs.go index d124d0153..1c894608f 100644 --- a/privval/msgs.go +++ b/privval/msgs.go @@ -5,39 +5,39 @@ import ( "github.com/gogo/protobuf/proto" - tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" ) // TODO: Add ChainIDRequest -func mustWrapMsg(pb proto.Message) privvalproto.Message { - msg := privvalproto.Message{} +func mustWrapMsg(pb proto.Message) ocprivvalproto.Message { + msg := ocprivvalproto.Message{} switch pb := pb.(type) { - case *privvalproto.Message: + case *ocprivvalproto.Message: msg = *pb - case *tmprivvalproto.PubKeyRequest: - msg.Sum = &privvalproto.Message_PubKeyRequest{PubKeyRequest: pb} - case *tmprivvalproto.PubKeyResponse: - msg.Sum = &privvalproto.Message_PubKeyResponse{PubKeyResponse: pb} - case *tmprivvalproto.SignVoteRequest: - msg.Sum = &privvalproto.Message_SignVoteRequest{SignVoteRequest: pb} - case *tmprivvalproto.SignedVoteResponse: - msg.Sum = &privvalproto.Message_SignedVoteResponse{SignedVoteResponse: pb} - case *tmprivvalproto.SignedProposalResponse: - msg.Sum = &privvalproto.Message_SignedProposalResponse{SignedProposalResponse: pb} - case *tmprivvalproto.SignProposalRequest: - msg.Sum = &privvalproto.Message_SignProposalRequest{SignProposalRequest: pb} - case *privvalproto.VRFProofRequest: - msg.Sum = &privvalproto.Message_VrfProofRequest{VrfProofRequest: pb} - case *privvalproto.VRFProofResponse: - msg.Sum = &privvalproto.Message_VrfProofResponse{VrfProofResponse: pb} - case *tmprivvalproto.PingRequest: - msg.Sum = &privvalproto.Message_PingRequest{PingRequest: pb} - case *tmprivvalproto.PingResponse: - msg.Sum = &privvalproto.Message_PingResponse{PingResponse: pb} + case *privvalproto.PubKeyRequest: + msg.Sum = &ocprivvalproto.Message_PubKeyRequest{PubKeyRequest: pb} + case *privvalproto.PubKeyResponse: + msg.Sum = &ocprivvalproto.Message_PubKeyResponse{PubKeyResponse: pb} + case *privvalproto.SignVoteRequest: + msg.Sum = &ocprivvalproto.Message_SignVoteRequest{SignVoteRequest: pb} + case *privvalproto.SignedVoteResponse: + msg.Sum = &ocprivvalproto.Message_SignedVoteResponse{SignedVoteResponse: pb} + case *privvalproto.SignedProposalResponse: + msg.Sum = &ocprivvalproto.Message_SignedProposalResponse{SignedProposalResponse: pb} + case *privvalproto.SignProposalRequest: + msg.Sum = &ocprivvalproto.Message_SignProposalRequest{SignProposalRequest: pb} + case *ocprivvalproto.VRFProofRequest: + msg.Sum = &ocprivvalproto.Message_VrfProofRequest{VrfProofRequest: pb} + case *ocprivvalproto.VRFProofResponse: + msg.Sum = &ocprivvalproto.Message_VrfProofResponse{VrfProofResponse: pb} + case *privvalproto.PingRequest: + msg.Sum = &ocprivvalproto.Message_PingRequest{PingRequest: pb} + case *privvalproto.PingResponse: + msg.Sum = &ocprivvalproto.Message_PingResponse{PingResponse: pb} default: panic(fmt.Errorf("unknown message type %T", pb)) } diff --git a/privval/signer_client.go b/privval/signer_client.go index 44c529176..83ff7c170 100644 --- a/privval/signer_client.go +++ b/privval/signer_client.go @@ -4,12 +4,12 @@ import ( "fmt" "time" - tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) @@ -55,7 +55,7 @@ func (sc *SignerClient) WaitForConnection(maxWait time.Duration) error { // GetPubKey retrieves a public key from a remote signer // returns an error if client is not able to provide the key func (sc *SignerClient) GetPubKey() (crypto.PubKey, error) { - response, err := sc.endpoint.SendRequest(mustWrapMsg(&tmprivvalproto.PubKeyRequest{ChainId: sc.chainID})) + response, err := sc.endpoint.SendRequest(mustWrapMsg(&privvalproto.PubKeyRequest{ChainId: sc.chainID})) if err != nil { return nil, fmt.Errorf("send: %w", err) } @@ -78,7 +78,7 @@ func (sc *SignerClient) GetPubKey() (crypto.PubKey, error) { // SignVote requests a remote signer to sign a vote func (sc *SignerClient) SignVote(chainID string, vote *tmproto.Vote) error { - response, err := sc.endpoint.SendRequest(mustWrapMsg(&tmprivvalproto.SignVoteRequest{Vote: vote, ChainId: chainID})) + response, err := sc.endpoint.SendRequest(mustWrapMsg(&privvalproto.SignVoteRequest{Vote: vote, ChainId: chainID})) if err != nil { return err } @@ -99,7 +99,7 @@ func (sc *SignerClient) SignVote(chainID string, vote *tmproto.Vote) error { // SignProposal requests a remote signer to sign a proposal func (sc *SignerClient) SignProposal(chainID string, proposal *tmproto.Proposal) error { response, err := sc.endpoint.SendRequest(mustWrapMsg( - &tmprivvalproto.SignProposalRequest{Proposal: proposal, ChainId: chainID}, + &privvalproto.SignProposalRequest{Proposal: proposal, ChainId: chainID}, )) if err != nil { return err @@ -120,7 +120,7 @@ func (sc *SignerClient) SignProposal(chainID string, proposal *tmproto.Proposal) // GenerateVRFProof requests a remote signer to generate a VRF proof func (sc *SignerClient) GenerateVRFProof(message []byte) (crypto.Proof, error) { - msg := &privvalproto.VRFProofRequest{Message: message} + msg := &ocprivvalproto.VRFProofRequest{Message: message} response, err := sc.endpoint.SendRequest(mustWrapMsg(msg)) if err != nil { sc.endpoint.Logger.Error("SignerClient::GenerateVRFProof", "err", err) @@ -128,7 +128,7 @@ func (sc *SignerClient) GenerateVRFProof(message []byte) (crypto.Proof, error) { } switch r := response.Sum.(type) { - case *privvalproto.Message_VrfProofResponse: + case *ocprivvalproto.Message_VrfProofResponse: if r.VrfProofResponse.Error != nil { return nil, fmt.Errorf(r.VrfProofResponse.Error.Description) } diff --git a/privval/signer_client_test.go b/privval/signer_client_test.go index cdc4edc19..02a3aafd4 100644 --- a/privval/signer_client_test.go +++ b/privval/signer_client_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" - tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" @@ -17,7 +17,7 @@ import ( "github.com/line/ostracon/crypto/tmhash" "github.com/line/ostracon/crypto/vrf" tmrand "github.com/line/ostracon/libs/rand" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) @@ -409,21 +409,21 @@ func TestSignerSignVoteErrors(t *testing.T) { } } -func brokenHandler(privVal types.PrivValidator, request privvalproto.Message, - chainID string) (privvalproto.Message, error) { - var res privvalproto.Message +func brokenHandler(privVal types.PrivValidator, request ocprivvalproto.Message, + chainID string) (ocprivvalproto.Message, error) { + var res ocprivvalproto.Message var err error switch r := request.Sum.(type) { // This is broken and will answer most requests with a pubkey response - case *privvalproto.Message_PubKeyRequest: - res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) - case *privvalproto.Message_SignVoteRequest: - res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) - case *privvalproto.Message_SignProposalRequest: - res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) - case *privvalproto.Message_PingRequest: - err, res = nil, mustWrapMsg(&tmprivvalproto.PingResponse{}) + case *ocprivvalproto.Message_PubKeyRequest: + res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) + case *ocprivvalproto.Message_SignVoteRequest: + res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) + case *ocprivvalproto.Message_SignProposalRequest: + res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: nil}) + case *ocprivvalproto.Message_PingRequest: + err, res = nil, mustWrapMsg(&privvalproto.PingResponse{}) default: err = fmt.Errorf("unknown msg: %v", r) } diff --git a/privval/signer_endpoint.go b/privval/signer_endpoint.go index 509f273c3..de5328baf 100644 --- a/privval/signer_endpoint.go +++ b/privval/signer_endpoint.go @@ -8,7 +8,7 @@ import ( "github.com/line/ostracon/libs/protoio" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" ) const ( @@ -80,7 +80,7 @@ func (se *signerEndpoint) DropConnection() { } // ReadMessage reads a message from the endpoint -func (se *signerEndpoint) ReadMessage() (msg privvalproto.Message, err error) { +func (se *signerEndpoint) ReadMessage() (msg ocprivvalproto.Message, err error) { se.connMtx.Lock() defer se.connMtx.Unlock() @@ -112,7 +112,7 @@ func (se *signerEndpoint) ReadMessage() (msg privvalproto.Message, err error) { } // WriteMessage writes a message from the endpoint -func (se *signerEndpoint) WriteMessage(msg privvalproto.Message) (err error) { +func (se *signerEndpoint) WriteMessage(msg ocprivvalproto.Message) (err error) { se.connMtx.Lock() defer se.connMtx.Unlock() diff --git a/privval/signer_listener_endpoint.go b/privval/signer_listener_endpoint.go index 00b13fa3d..55be54b3e 100644 --- a/privval/signer_listener_endpoint.go +++ b/privval/signer_listener_endpoint.go @@ -5,12 +5,12 @@ import ( "net" "time" - tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" ) // SignerListenerEndpointOption sets an optional parameter on the SignerListenerEndpoint. @@ -106,7 +106,7 @@ func (sl *SignerListenerEndpoint) WaitForConnection(maxWait time.Duration) error } // SendRequest ensures there is a connection, sends a request and waits for a response -func (sl *SignerListenerEndpoint) SendRequest(request privvalproto.Message) (*privvalproto.Message, error) { +func (sl *SignerListenerEndpoint) SendRequest(request ocprivvalproto.Message) (*ocprivvalproto.Message, error) { sl.instanceMtx.Lock() defer sl.instanceMtx.Unlock() @@ -212,7 +212,7 @@ func (sl *SignerListenerEndpoint) pingLoop() { select { case <-sl.pingTimer.C: { - _, err := sl.SendRequest(mustWrapMsg(&tmprivvalproto.PingRequest{})) + _, err := sl.SendRequest(mustWrapMsg(&privvalproto.PingRequest{})) if err != nil { sl.Logger.Error("SignerListener: Ping timeout") sl.triggerReconnect() diff --git a/privval/signer_requestHandler.go b/privval/signer_requestHandler.go index d65b5bf6f..14dba7d43 100644 --- a/privval/signer_requestHandler.go +++ b/privval/signer_requestHandler.go @@ -4,30 +4,30 @@ import ( "fmt" cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto" - tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) func DefaultValidationRequestHandler( privVal types.PrivValidator, - req privvalproto.Message, + req ocprivvalproto.Message, chainID string, -) (privvalproto.Message, error) { +) (ocprivvalproto.Message, error) { var ( - res privvalproto.Message + res ocprivvalproto.Message err error ) switch r := req.Sum.(type) { - case *privvalproto.Message_PubKeyRequest: + case *ocprivvalproto.Message_PubKeyRequest: if r.PubKeyRequest.GetChainId() != chainID { - res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{ - PubKey: cryptoproto.PublicKey{}, Error: &tmprivvalproto.RemoteSignerError{ + res = mustWrapMsg(&privvalproto.PubKeyResponse{ + PubKey: cryptoproto.PublicKey{}, Error: &privvalproto.RemoteSignerError{ Code: 0, Description: "unable to provide pubkey"}}) return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.PubKeyRequest.GetChainId(), chainID) } @@ -43,16 +43,16 @@ func DefaultValidationRequestHandler( } if err != nil { - res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{ - PubKey: cryptoproto.PublicKey{}, Error: &tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) + res = mustWrapMsg(&privvalproto.PubKeyResponse{ + PubKey: cryptoproto.PublicKey{}, Error: &privvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) } else { - res = mustWrapMsg(&tmprivvalproto.PubKeyResponse{PubKey: pk, Error: nil}) + res = mustWrapMsg(&privvalproto.PubKeyResponse{PubKey: pk, Error: nil}) } - case *privvalproto.Message_SignVoteRequest: + case *ocprivvalproto.Message_SignVoteRequest: if r.SignVoteRequest.ChainId != chainID { - res = mustWrapMsg(&tmprivvalproto.SignedVoteResponse{ - Vote: tmproto.Vote{}, Error: &tmprivvalproto.RemoteSignerError{ + res = mustWrapMsg(&privvalproto.SignedVoteResponse{ + Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{ Code: 0, Description: "unable to sign vote"}}) return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.SignVoteRequest.GetChainId(), chainID) } @@ -61,16 +61,16 @@ func DefaultValidationRequestHandler( err = privVal.SignVote(chainID, vote) if err != nil { - res = mustWrapMsg(&tmprivvalproto.SignedVoteResponse{ - Vote: tmproto.Vote{}, Error: &tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) + res = mustWrapMsg(&privvalproto.SignedVoteResponse{ + Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) } else { - res = mustWrapMsg(&tmprivvalproto.SignedVoteResponse{Vote: *vote, Error: nil}) + res = mustWrapMsg(&privvalproto.SignedVoteResponse{Vote: *vote, Error: nil}) } - case *privvalproto.Message_SignProposalRequest: + case *ocprivvalproto.Message_SignProposalRequest: if r.SignProposalRequest.GetChainId() != chainID { - res = mustWrapMsg(&tmprivvalproto.SignedProposalResponse{ - Proposal: tmproto.Proposal{}, Error: &tmprivvalproto.RemoteSignerError{ + res = mustWrapMsg(&privvalproto.SignedProposalResponse{ + Proposal: tmproto.Proposal{}, Error: &privvalproto.RemoteSignerError{ Code: 0, Description: "unable to sign proposal"}}) return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.SignProposalRequest.GetChainId(), chainID) @@ -80,21 +80,21 @@ func DefaultValidationRequestHandler( err = privVal.SignProposal(chainID, proposal) if err != nil { - res = mustWrapMsg(&tmprivvalproto.SignedProposalResponse{ - Proposal: tmproto.Proposal{}, Error: &tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) + res = mustWrapMsg(&privvalproto.SignedProposalResponse{ + Proposal: tmproto.Proposal{}, Error: &privvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) } else { - res = mustWrapMsg(&tmprivvalproto.SignedProposalResponse{Proposal: *proposal, Error: nil}) + res = mustWrapMsg(&privvalproto.SignedProposalResponse{Proposal: *proposal, Error: nil}) } - case *privvalproto.Message_PingRequest: - err, res = nil, mustWrapMsg(&tmprivvalproto.PingResponse{}) + case *ocprivvalproto.Message_PingRequest: + err, res = nil, mustWrapMsg(&privvalproto.PingResponse{}) - case *privvalproto.Message_VrfProofRequest: + case *ocprivvalproto.Message_VrfProofRequest: proof, err := privVal.GenerateVRFProof(r.VrfProofRequest.Message) if err != nil { - err := tmprivvalproto.RemoteSignerError{Code: 0, Description: err.Error()} - res = mustWrapMsg(&privvalproto.VRFProofResponse{Proof: nil, Error: &err}) + err := privvalproto.RemoteSignerError{Code: 0, Description: err.Error()} + res = mustWrapMsg(&ocprivvalproto.VRFProofResponse{Proof: nil, Error: &err}) } else { - res = mustWrapMsg(&privvalproto.VRFProofResponse{Proof: proof[:], Error: nil}) + res = mustWrapMsg(&ocprivvalproto.VRFProofResponse{Proof: proof[:], Error: nil}) } default: diff --git a/privval/signer_server.go b/privval/signer_server.go index 889595e01..3cabdcaab 100644 --- a/privval/signer_server.go +++ b/privval/signer_server.go @@ -5,15 +5,15 @@ import ( "github.com/line/ostracon/libs/service" tmsync "github.com/line/ostracon/libs/sync" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) // ValidationRequestHandlerFunc handles different remoteSigner requests type ValidationRequestHandlerFunc func( privVal types.PrivValidator, - requestMessage privvalproto.Message, - chainID string) (privvalproto.Message, error) + requestMessage ocprivvalproto.Message, + chainID string) (ocprivvalproto.Message, error) type SignerServer struct { service.BaseService @@ -71,7 +71,7 @@ func (ss *SignerServer) servicePendingRequest() { return } - var res privvalproto.Message + var res ocprivvalproto.Message { // limit the scope of the lock ss.handlerMtx.Lock() diff --git a/rpc/client/evidence_test.go b/rpc/client/evidence_test.go index 1617bbb68..b8bad4971 100644 --- a/rpc/client/evidence_test.go +++ b/rpc/client/evidence_test.go @@ -6,16 +6,15 @@ import ( "testing" "time" - "github.com/line/ostracon/abci/example/kvstore" - "github.com/line/ostracon/crypto/ed25519" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/ostracon/abci/example/kvstore" ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/crypto/ed25519" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/tmhash" tmrand "github.com/line/ostracon/libs/rand" diff --git a/state/execution.go b/state/execution.go index 1e7f7e5cb..a62bf1632 100644 --- a/state/execution.go +++ b/state/execution.go @@ -8,10 +8,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/line/ostracon/crypto" - canonictime "github.com/line/ostracon/types/time" - ocabci "github.com/line/ostracon/abci/types" + "github.com/line/ostracon/crypto" cryptoenc "github.com/line/ostracon/crypto/encoding" "github.com/line/ostracon/crypto/vrf" "github.com/line/ostracon/libs/fail" @@ -20,6 +18,7 @@ import ( tmstate "github.com/line/ostracon/proto/ostracon/state" "github.com/line/ostracon/proxy" "github.com/line/ostracon/types" + canonictime "github.com/line/ostracon/types/time" ) //----------------------------------------------------------------------------- diff --git a/test/kms/bench_test.go b/test/kms/bench_test.go index 3ab39b4d0..8b072bea9 100644 --- a/test/kms/bench_test.go +++ b/test/kms/bench_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" - tmprivvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" + privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval" types2 "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/line/ostracon/config" @@ -24,7 +24,7 @@ import ( tmnet "github.com/line/ostracon/libs/net" "github.com/line/ostracon/node" "github.com/line/ostracon/privval" - privvalproto "github.com/line/ostracon/proto/ostracon/privval" + ocprivvalproto "github.com/line/ostracon/proto/ostracon/privval" "github.com/line/ostracon/types" ) @@ -184,9 +184,9 @@ func benchmarkVRFProof(b *testing.B, pv types.PrivValidator, pubKey crypto.PubKe } func ping(sl *privval.SignerListenerEndpoint) { - msg := privvalproto.Message{ - Sum: &privvalproto.Message_PingRequest{ - PingRequest: &tmprivvalproto.PingRequest{}, + msg := ocprivvalproto.Message{ + Sum: &ocprivvalproto.Message_PingRequest{ + PingRequest: &privvalproto.PingRequest{}, }, } _, err := sl.SendRequest(msg)