* Clean Any interface
+ removed Any.Pack method. This method is not needed, because we have specialized
functions for createing new Any values. It could be used inappropriately with existing
Any objects.
* removed deprecated PackAny function
* fix linter issue
* update nil handling
* NewAnyWithValue returns error on nil instead of panic
* NewMsgCreateValidator: handle nil pubkey
* Remove AsAny and tx builder workarounds
* fix linter issue
* Add AsAny methods to TxBuilder and StdTxConfig, but keep intoAny interface private
* remove tx.PubKeyToAny
* cosmetic updates
* fix method interface
* move ProtoTxProvider to x/auth/tx
* start on MBT for ICS20: setting and checking bank balances
* add bank struct for subtracting banks
* reconstruct ibc denominations in the bank
* add some static tests with bank changes tracking
* small fixes
* better error handling
* add Jsonatr transform from Apalache conterexample into OnRecvPacket test
* add example Apalache CE and transformed test
* changed apalache-to-recv-test.json to output arrays instead of records
* add datastructures for parsing TLA+ tests
* remove accidentally committed code
* add conversion from TLA+ structs to Go structs
* encode abstract ids into addresses via hashes
* first run of auto-generated MBT tests
* first run of auto-generated MBT tests: fix ports and channels
* fix small inconsistencies
* fix mbt_relay_test by not setting the bank balances in every iteration
* add test for onTimeoutPacket
* add handling of OnRecvAcknowledgement to mbt relay test
* add handling of SendTransfer
* add relay-test.json
* revert manual changes in relay-test.json
* fix handling of denominations for SendTransfer
* setup two test channels A-B, B-C; fix escrow address encoding
* a test for all handlers passing
* generalize denom handling to arbitrary length + failing denom test
* rename test function
* MBT test for unsecrow tokens
* add model-based generated tests
* add model-based tests (prev commit: addded model)
* transformed json tests with jsonatr
* modify mbt_relay_test.go to execute all MBT tests
* cleanup
* move jsonatr transforms into another dir
* add MBT_README.md
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Files returned by WriteToNewTempFile are cleaned up
automatically at the end of a test case execution.
WriteToNewTempFile now relies on the TB.TempDir()
function provided by the testing std package.
TempFile returns a temporary file that can be used
within a test case and is automatically removed
at the end of the test execution.
* add test case for decoding & re-encoding a full transaction using amino
* drop equal assertion for tx and txRequest
* Fix BroadcastReq UnpackInterfaces
* Remove unrelated files
* order imports
* sort imports again
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Recover private validator key
Added the ability to recover the private validator key from a given mnemonic when initializing the node
* Added CHANGELOG entry
* Reverted dependencies
* Added tests
* Fixed mnemonic checking as suggested and added tests
* Run make format and fixed go.sum checksum
* Run make format
* fix imports
* fix TestInitializeNodeValidatorFilesFromMnemonic
* Update CHANGELOG.md
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
The prior code that tried to get the newest/larger time
between the too performed:
* 2 time.Time.UnixNano() retrievals: 2 multiplications, 2 additions
* 1 math.Max comparison
* 1 time.Unix(0, minTime) creation
but really this code could just use native operations on:
time.Time.After() simply.
This now becomes a single operation, single comparison for the same effect.
* 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>
* x/ibc/core/23-commitment/types: fix MerkleProof.Empty comparisons
Fixes invalid pointer creation, reduces on unnecessary allocations
inside MerkleProof.Empty, and changes the method to a pointer; the
invalid pointer creation was symptomatic of broad use of values.
With this change we have improvements whose benchmarks produce:
```shell
name old time/op new time/op delta
Empty-8 311ns ± 5% 232ns ± 5% -25.49% (p=0.000 n=20+19)
name old alloc/op new alloc/op delta
Empty-8 56.0B ± 0% 8.0B ± 0% -85.71% (p=0.000 n=20+20)
name old allocs/op new allocs/op delta
Empty-8 3.00 ± 0% 1.00 ± 0% -66.67% (p=0.000 n=20+20)
```
Fixes#8091
* Move Empty godoc to right place + add comments for blank*
* x/bank/keeper: fix a missing gRPC error in AllBalances
Fixes an incoherent return which had:
(non-nil value, non-nil-non-grpc error)
to
(nil value, non-nil-gRPC error)
and it is a follow-up of PR #7814.
* types/query: fix pagination test (#8096)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* fix: Metadata is not initialized in x/bank InitGenesis #7951
* remove commented code
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
* Add test that panics
* Add panic in abci query
* Move proto gen files to correct place
* Add panic handler in grpc server
* Fix test
* Fix build
* Use %v
* Better panic message
* Fix tests
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
* add IBC prefix to escrow addresses
* use ADR 028 AddressHash construction
* remove extra space
* apply @AdityaSripal suggestion; prefix from ibc -> ibc-transfer-escrow-prefix
* Use alternative 1 proposed by @andrey-kuprianov
* anticpate necessary build fix
* add escrow address issue link into module.go
* Update x/ibc/applications/transfer/types/keys.go
Co-authored-by: Andrey Kuprianov <59489470+andrey-kuprianov@users.noreply.github.com>
* Update x/ibc/applications/transfer/types/keys.go
Co-authored-by: Andrey Kuprianov <59489470+andrey-kuprianov@users.noreply.github.com>
* apply @andrey-kuprianov review suggestions
Deduplicate code into a helper function as suggested. Add unit tests for max transfer channels test.
Co-authored-by: Andrey Kuprianov <59489470+andrey-kuprianov@users.noreply.github.com>