Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: protoreflect based amino json encoder #14877

Merged
merged 146 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 140 commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
d953587
notes
kocubinski Jan 26, 2023
5485fca
test proto gen
kocubinski Jan 26, 2023
95fc572
Fix gen
kocubinski Jan 26, 2023
ca06ede
Add failing test case
kocubinski Jan 26, 2023
ca1e8c3
assert legacy behavior parity in test
kocubinski Jan 26, 2023
35bb289
fix test to fail in the proper way
kocubinski Jan 26, 2023
ebec2a7
structurally sound, just handing marshal cases
kocubinski Jan 29, 2023
6c6d4fe
Turning out pretty well
kocubinski Jan 29, 2023
a222053
initial test is now passing
kocubinski Jan 30, 2023
9412ed0
some rapid tests failing
kocubinski Jan 30, 2023
fa13aff
rename
kocubinski Jan 30, 2023
93b2a8d
rm rapid fail
kocubinski Jan 30, 2023
0ab2d36
add test
kocubinski Jan 30, 2023
6b79609
clean up test case
kocubinski Jan 30, 2023
71382c7
test cleanup
kocubinski Jan 30, 2023
ee6f705
clean up commented code
kocubinski Jan 30, 2023
b1ac5e4
do not treat maps in generative tests
kocubinski Jan 31, 2023
b9ca7c4
rename files
kocubinski Jan 31, 2023
76ae6a3
error on map marshal
kocubinski Jan 31, 2023
6cf89b2
remove unused code
kocubinski Jan 31, 2023
5170ce6
clean up
kocubinski Jan 31, 2023
a63eaca
clean up
kocubinski Jan 31, 2023
d59fd1c
create failing test case
kocubinski Jan 31, 2023
f341c67
handle amino.name option
kocubinski Feb 1, 2023
0eedf02
begin annotation audit
kocubinski Feb 1, 2023
164e26a
support more annotations
kocubinski Feb 1, 2023
a651645
Support more annotations, add one to distribution.proto
kocubinski Feb 1, 2023
f984ea8
handle amino.message_encoding
kocubinski Feb 1, 2023
a8d2dc2
refactor, clean up
kocubinski Feb 1, 2023
2f18d53
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 1, 2023
c39f381
thank you linter
kocubinski Feb 1, 2023
ef4e87d
remove println
kocubinski Feb 1, 2023
6947b3d
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 1, 2023
befbb6c
move package to x/tx/
kocubinski Feb 2, 2023
1b0f2b1
refactor: fixing tests
kocubinski Feb 2, 2023
ef5f006
use pulsar for codegen
kocubinski Feb 2, 2023
75008d8
clean up
kocubinski Feb 2, 2023
ca28ffc
Add one test case
kocubinski Feb 2, 2023
a1d7561
refactor: err handling and clean up
kocubinski Feb 2, 2023
cf060ed
fix any creation
kocubinski Feb 2, 2023
a2b4be3
check point, type index infra
kocubinski Feb 3, 2023
c19d317
deep copy working for some messages
kocubinski Feb 6, 2023
b699ec6
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 6, 2023
2ba8367
cd tx/tx && go mod tidy
kocubinski Feb 6, 2023
98a12f1
Add amino annotation
kocubinski Feb 6, 2023
afea254
ModuleAccount parity achieved through annotations
kocubinski Feb 6, 2023
5717b4a
progress
kocubinski Feb 7, 2023
9671f17
auth finished
kocubinski Feb 7, 2023
149816e
amino wip
kocubinski Feb 7, 2023
2104382
gut cloning, in favor of proto round tripping
kocubinski Feb 7, 2023
1520f3d
found parity with any types
kocubinski Feb 8, 2023
100781f
a good tack
kocubinski Feb 8, 2023
e22421f
critical generator fixes for playing nicely with gogoproto dsz
kocubinski Feb 8, 2023
0321a7f
bank passing
kocubinski Feb 8, 2023
79b9626
wip
kocubinski Feb 9, 2023
5b69d9b
fix json_marshal_test.go
kocubinski Feb 9, 2023
d2f7ae4
null_slice_as_empty encoding
kocubinski Feb 10, 2023
c0ef319
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 11, 2023
ee137a5
add requires back
kocubinski Feb 11, 2023
9911efa
remove empty list tests
kocubinski Feb 11, 2023
bee2310
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 12, 2023
501cb90
incorporate changes from #14994 so that x/tx compiles with x/auth
kocubinski Feb 12, 2023
94bcc46
bank annotations of null_slice_as_empty
kocubinski Feb 12, 2023
612dfb3
refactor, cleanup
kocubinski Feb 12, 2023
ca9bfd0
all parity and gen tests passing for so far included modules
kocubinski Feb 12, 2023
f841fb9
rm confusion
kocubinski Feb 12, 2023
41c9791
add distribution
kocubinski Feb 12, 2023
bb2b03d
evidence
kocubinski Feb 12, 2023
a62d3f7
add feegrant
kocubinski Feb 12, 2023
25e64ea
gov v1beta1
kocubinski Feb 12, 2023
e7fa027
gov v1
kocubinski Feb 12, 2023
338687f
group module
kocubinski Feb 12, 2023
80684a5
nft module
kocubinski Feb 13, 2023
e5076f5
params module
kocubinski Feb 13, 2023
583181c
slashing module
kocubinski Feb 13, 2023
ff86798
WIP staking
kocubinski Feb 13, 2023
9f0f51a
test clean up
kocubinski Feb 13, 2023
8b04d2f
add breaking oneof tests
kocubinski Feb 13, 2023
5946320
oneof tests passing, trying a refactor though
kocubinski Feb 13, 2023
30930d9
upgrade module
kocubinski Feb 13, 2023
5f0db4d
vesting module
kocubinski Feb 13, 2023
732bcaf
remove embedded handling
kocubinski Feb 13, 2023
54ee03d
rm defunct tests
kocubinski Feb 13, 2023
1a23420
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 13, 2023
a6c49dd
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 13, 2023
144df31
merge, go.mod
kocubinski Feb 13, 2023
8960d43
rm defunct option
kocubinski Feb 13, 2023
721d30a
clean up module account proto
kocubinski Feb 13, 2023
dabfb48
add comments
kocubinski Feb 13, 2023
67bb9af
demonstration of repeated field complexity
kocubinski Feb 14, 2023
5670e89
add comment
kocubinski Feb 14, 2023
6da5d25
add another message case
kocubinski Feb 14, 2023
283bbdd
clarify cases
kocubinski Feb 14, 2023
b8fd077
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 14, 2023
ebf3283
coins by convention.
kocubinski Feb 14, 2023
4fc10c9
Revert "coins by convention."
kocubinski Feb 15, 2023
b33fa59
change field encoder name
kocubinski Feb 15, 2023
019e230
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 15, 2023
53e36f9
use convention for oneof field names
kocubinski Feb 15, 2023
51f0e2d
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 16, 2023
81c1d5a
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 16, 2023
b12b678
a little cleanup on the test suite
kocubinski Feb 16, 2023
5a48d89
comments and clean up
kocubinski Feb 16, 2023
a1898b3
revert line
kocubinski Feb 16, 2023
0702382
clean up
kocubinski Feb 16, 2023
83a6f05
go mod tidy
kocubinski Feb 16, 2023
058479d
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 20, 2023
82382e3
use api v0.3.1
kocubinski Feb 20, 2023
8bcc725
update test seeds
kocubinski Feb 20, 2023
298b6ea
Merge branch 'main' into kocubinski/amino-json
JeancarloBarrios Feb 20, 2023
2a77cc6
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 20, 2023
8f6cec9
update rapidproto test seeds
kocubinski Feb 20, 2023
f971768
use rapidproto package from cosmos-proto
kocubinski Feb 20, 2023
60180b3
use replace directive instead of go.work
kocubinski Feb 20, 2023
036d428
replace directive for client/v2 in tests
kocubinski Feb 20, 2023
f6473d3
refactor to support custom field mapping
kocubinski Feb 21, 2023
49543ec
update cosmos-proto version
kocubinski Feb 21, 2023
c55648a
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 21, 2023
35bc669
wip docs, refactor, clean up
kocubinski Feb 21, 2023
9e0ae46
break out options.go
kocubinski Feb 21, 2023
cbb277e
Update x/tx/aminojson/any.go
kocubinski Feb 21, 2023
c7a7e4c
return err if not nil
kocubinski Feb 21, 2023
c6b1de9
add docs
kocubinski Feb 21, 2023
8533753
refactor marshalAny a bit
kocubinski Feb 21, 2023
21e7d77
fix error message
kocubinski Feb 21, 2023
fad3130
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 21, 2023
9ffbf76
refactor byte array case
kocubinski Feb 21, 2023
11d45af
Merge branch 'main' into kocubinski/amino-json
kocubinski Feb 21, 2023
be04a65
support math.Int as bytes
kocubinski Feb 22, 2023
5d66060
reverse mistaken change
kocubinski Feb 22, 2023
b0486f5
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 22, 2023
588ff72
Update x/tx/aminojson/json_marshal.go
kocubinski Feb 22, 2023
97bcc1a
implement special handling for LegacyAminoPubKey
kocubinski Feb 22, 2023
405a076
Merge branch 'kocubinski/amino-json' of github.com:cosmos/cosmos-sdk …
kocubinski Feb 22, 2023
73207ae
revert to struct receiver methods
kocubinski Feb 23, 2023
daa5cf5
Merge branch 'main' into kocubinski/amino-json
kocubinski Feb 23, 2023
9c98673
Merge branch 'main' into kocubinski/amino-json
kocubinski Feb 23, 2023
5769996
rm replace directive
kocubinski Feb 23, 2023
a5d45bd
rename AminoJSON struct -> Encoder
kocubinski Feb 23, 2023
60feafc
Rename Encoder.MarshalAmino -> Encoder.Marshal
kocubinski Feb 23, 2023
9cb66d0
fix name collision
kocubinski Feb 23, 2023
e100fdd
change signature of message encoders to include encoder struct
kocubinski Feb 23, 2023
90fa320
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/a…
kocubinski Feb 23, 2023
14ac34a
go mod tidy
kocubinski Feb 23, 2023
8481613
Merge branch 'main' into kocubinski/amino-json
kocubinski Feb 23, 2023
c1a6aa2
Merge branch 'main' into kocubinski/amino-json
kocubinski Feb 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ require (
cosmossdk.io/x/evidence v0.1.0
cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff
cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc
cosmossdk.io/x/tx v0.2.0
cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335
github.com/cometbft/cometbft v0.37.0-alpha.3
github.com/cosmos/cosmos-db v1.0.0-rc.1
github.com/cosmos/cosmos-proto v1.0.0-beta.2
// this version is not used as it is always replaced by the latest Cosmos SDK version
github.com/cosmos/cosmos-sdk v0.48.0
github.com/cosmos/gogoproto v1.4.6
Expand All @@ -37,7 +39,6 @@ require (
cosmossdk.io/client/v2 v2.0.0-20230220152935-67f04e629623 // indirect
cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/x/tx v0.2.0 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand All @@ -61,7 +62,6 @@ require (
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v0.21.0-alpha.1 // indirect
Expand Down Expand Up @@ -113,6 +113,7 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
github.com/huandu/skiplist v1.2.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand Down Expand Up @@ -191,9 +192,11 @@ require (
// It must be in sync with SimApp temporary replaces
replace (
// TODO tag all extracted modules after SDK refactor
cosmossdk.io/client/v2 => ../client/v2
cosmossdk.io/x/evidence => ../x/evidence
cosmossdk.io/x/feegrant => ../x/feegrant
cosmossdk.io/x/nft => ../x/nft
cosmossdk.io/x/tx => ../x/tx
cosmossdk.io/x/upgrade => ../x/upgrade
// This can be deleted after the CometBFT PR is merged
github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d
Expand Down
6 changes: 2 additions & 4 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE=
cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw=
cosmossdk.io/client/v2 v2.0.0-20230220152935-67f04e629623 h1:QzZA1P+twvj10ylCVXzHodLge+RvrwoNIlWpU+MrRa0=
cosmossdk.io/client/v2 v2.0.0-20230220152935-67f04e629623/go.mod h1:Yo6R3XSXKxi+G642kK7+ZOh2czNTwTO1b8ywOvwaFQo=
cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 h1:At2M0aYQKEAWqr6JtZrJPOlfhdvENiGwJg2NCNHwIdc=
cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177/go.mod h1:uqCi8FG+Bh2vv/qf5xZ8iab0E0c/DMA/cwafbp8dkcU=
cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI=
Expand All @@ -206,8 +204,6 @@ cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8
cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8=
cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE=
cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk=
cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg=
cosmossdk.io/x/tx v0.2.0/go.mod h1:CTko7wgt7aBdbxOesZ+Wo1uO/03ueKzIQ0iI323Rqgk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
Expand Down Expand Up @@ -682,6 +678,8 @@ github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw
github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w=
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE=
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
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/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
Expand Down
1 change: 1 addition & 0 deletions tests/integration/aminojson/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testdata/rapid
Loading