* Changelog update
* Rename codec.MarshalAny
* move codec.MarshalInterface to codec.Marshaler
* fix tests
* Update amino_codec for compliance with MarshalerInterface
* update tests and comments
* add tests
* change order of args in UnmarshalInterface to a canonical one
* uplift MarshalInterface to take ProtoMessage as an argument
* wip
* add nil check
* make tests working
* tests cleanup
* add support for *JSON methods
* Update changelog
* linter fixes
* fix test types
* update evidence genesis_test
* adding test
* review updates
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Make JSONMarshaler require proto.Message
* Use &msg with MarshalJSON
* Use *LegacyAmino in queriers instead of JSONMarshaler
* Revert ABCIMessageLogs String() and coins tests
* Use LegacyAmino in client/debug and fix subspace tests
* Use LegacyAmino in all legacy queriers and adapt simulation
* Make AminoCodec implement Marshaler and some godoc fixes
* Test fixes
* Remove unrelevant comment
* Use TxConfig.TxJSONEncoder
* Use encoding/json in genutil cli migrate/validate genesis cmds
* Address simulation related comments
* Use JSONMarshaler in cli tests
* Use proto.Message as respType in cli tests
* Use tmjson for tm GenesisDoc
* Update types/module/simulation.go
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
* Update types/module/module_test.go
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
* Add godoc comments
* Remove unused InsertKeyJSON
* Fix tests
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
* codec: remove unnecessary allocations in ProtoCodec.MarshalBinaryLengthPrefixed
Improve ProtoCodec.MarshalBinaryLengthPrefixed by removing the need
to use a *bytes.Buffer and instead use an array and invoke
binary.PutUvarint, and directly create the respective length prefixed
concatentation.
With this change we get the following improvement in all dimenions
of throughput, bytes allocated, number of allocations per operation.
```shell
$ benchstat before.txt after.txt
name old time/op new time/op delta
ProtoCodecMarshalBinaryLengthPrefixed-8 295ns ± 2% 177ns ± 3% -39.92% (p=0.000 n=20+20)
name old speed new speed delta
ProtoCodecMarshalBinaryLengthPrefixed-8 505MB/s ± 2% 841MB/s ± 3% +66.44% (p=0.000 n=20+20)
name old alloc/op new alloc/op delta
ProtoCodecMarshalBinaryLengthPrefixed-8 576B ± 0% 336B ± 0% -41.67% (p=0.000 n=20+20)
name old allocs/op new allocs/op delta
ProtoCodecMarshalBinaryLengthPrefixed-8 5.00 ± 0% 3.00 ± 0% -40.00% (p=0.000 n=20+20)
```
Fixes#6875
* Address @marbar3778's feedback
Use binary.MaxVarintLen64 instead of 10
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
* WIP: using encoding config
* Make it compile, test fails
* test should be okay
* Make tests pass
* Add comments
* Convert more tests
* Make TestAnteHandlerSigErrors work
* Make first 2 tests pass
* TestAnteHandlerAccountNumbers
* Use table tests
* Remove print
* Use test table
* TestAnteHandlerSigErrors
* TestAnteHandlerAccountNumbers
* TestAnteHandlerAccountNumbers
* Refactor TestAccount
* Refactor getSignBytes
* TestAnteHandlerAccountNumbersAtBlockHeightZero
* TestAnteHandlerSequences
* TestAnteHandlerFees
* TestAnteHandlerMultiSigner
* TestAnteHandlerBadSignBytes
* TestAnteHandlerSetPubKey
* TestAnteHandlerSigLimitExceeded
* TestCustomSignatureVerificationGasConsumer
* TestAnteHandlerReCheck
* Make all tests pass
* Refactor a little bit more
* Fee test
* SetupTest
* All tests pass
* Refactor to RunTestCase
* Don't use StdFee
* Revert some little stuff
* Finish up last couple of test cases
* Less verbose
* s/TxGenerator/TxConfig
* Add comments
* Indent
* Move KeyTestPubAddr to testdata
* Move testdata to /testutil
* Revert to use signature: nil step in signing
* Add comments
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
As part of an audit, adds as much visible coverage from
73.4% to about 84.2%, but after #6668 is merged, we'll
have it about 88.X% and the coverage report seems to show
only missing cases of not common scenarios, e.g. a case that'll
make jsonpb.Marshaling to fail, and which will return an error
anyways.
* Don't change proto files on make format
The format target does not need to depend on tools.
Thus remove dependency.
* Run make format
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>