Emmanuel T Odeke
6344d626db
types/Coin: compile and reuse Regexps to reduce massive RAM+CPU burn ( #7989 )
...
* types/Coin: compile and reuse Regexps to reduce massive RAM+CPU burn
Fixes a resource (CPU+RAM) burn from recompiling Regexps which would
consume 1.2+MiB of RAM and 1.1ms per ParseCoin invocation, which means
that 1,000 invocations would consume 1.2GiB of RAM and >1second.
With the change, ParseCoin now takes 3.2us down from 1.1ms, with
dramatic results:
name old time/op new time/op delta
ParseCoin-8 1.04ms ± 4% 0.00ms ± 1% -99.69% (p=0.000 n=9+10)
name old alloc/op new alloc/op delta
ParseCoin-8 1.20MB ± 0% 0.00MB ± 0% -99.94% (p=0.000 n=10+10)
name old allocs/op new allocs/op delta
ParseCoin-8 17.8k ± 0% 0.0k ± 0% -99.89% (p=0.000 n=10+10)
Fixes #7986 .
* replace the CoinDenomRegex variable with SetCoinDenomRegex() (#7998 )
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-11-20 19:37:45 +00:00
yihuang
54201d11e6
cli: convert coins to smallest unit registered ( #7777 )
...
* cli: convert coins to smallest unit registered
fixes : #7623
- test order of decimal operations
- support both int and decimal coins, truncate when normalizing to
base unit
* Update types/coin_test.go
* Update types/coin_test.go
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Amaury <amaury.martiny@protonmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-16 11:34:54 +00:00
billy rennekamp
3e6089dc0e
R4R: Add custom validation for denom ( #6755 )
...
Allow ValidateDenom to be customized per application.
closes : #6744
2020-10-06 18:06:41 +01:00
Alessio Treglia
ddaa3c5176
types: tests -> test suites migration ( #7405 )
2020-09-29 13:29:10 +02:00
Alessio Treglia
8601dcdbb7
types: tests -> test suites migration ( #7400 )
...
Ref #7362
2020-09-28 12:46:49 +02:00
Alessio Treglia
04ff40a8df
types: start grouping tests in test suites ( #7395 )
...
Ref #7362
2020-09-27 23:51:14 +02:00
dauTT
30f9862b4b
Remove zero coins from ParseCoins and ParseDecCoins ( #7348 )
...
* Remove zero coins from ParseCoins and ParseDecCoins
* Implement requested changes
* Update types/coin_test.go
* Revert
* Align the behaviour of NewCoins and ParseCoins (respectively NewDecCoins and ParseDecCoins)
* Amend comments
* Update types/dec_coin.go
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-25 08:31:31 +00:00
Anil Kumar Kammari
64b6bb5270
rename RegisterCodec to RegisterLegacyAminoCodec ( #7243 )
...
* rename RegisterCodec to RegisterLegacyAminoCodec
* Add changelog
* gofmt
* rename codec.New() to codec.NewLegacyAmino()
* Add change log
* Update CHANGELOG.md
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
* Fix
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
2020-09-07 14:47:12 +00:00
Federico Kunze
3022fe9044
x/ibc-transfer: ADR001 source tracing implementation ( #6871 )
...
* x/ibc-transfer: ADR001 source tracing implementation
* gRPC proto file
* validation
* fix validation
* import export genesis
* relay.go updates
* gRPC service methods
* client CLI
* update implementation
* build
* trace test
* fix CLI tx args
* genesis import/export tests
* update comments
* update proto files
* GRPC tests
* remove field from packet
* fix coin validation bug
* more validations
* update comments
* minor refactor
* update relay.go
* try fix test
* minor updates
* fix tests
* fix test
* ADR updates and comments
* build
* Apply suggestions from code review
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
* address a few comments from review
* gRPC annotations
* update proto files
* Apply suggestions from code review
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
* address comments
* docs and changelog
* sort traces
* final changes to ADR
* client support for full path denom prefixes
* address @AdityaSripal comments
* address TODO
* increase test timeouts
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-14 17:46:26 -04:00
Federico Kunze
1b08e1032c
types: update coin regex ( #7027 )
...
* types: update coin regex
* more tests
* fix test case
* increase coverage
* changelog
* fix tests
* support unicode letters and numbers
* remove ToUpper
* Update types/coin.go
Co-authored-by: Aaron Craelius <aaron@regen.network>
* Validate function
* fix ICS20 test
* table tests and revert unicodes
* add test case
* add test cases and comment
Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-08-14 09:09:53 +00:00
Ira Miller
282afcdb12
Fix for 6786 removeZeroCoins mutates original slice ( #6811 )
...
* added test cases to show errors identified in 6786
* mods to fix remove zero coin mutation in slice
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-28 10:17:58 +00:00
Jonathan Gimeno
c44ca8ae34
add string test for coin and coins ( #6547 )
...
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-06-30 14:11:29 -04:00
Alexander Bezobchuk
26d6e49d6a
Merge PR #5491 : Protobuf Introduction + Types
2020-01-24 10:32:00 -05:00
Ferenc Fabian
066dd1114f
Merge PR #5449 : Add New constructor for the DecCoin
2020-01-03 15:44:53 -05:00
Marko
b9490f2d93
Merge PR #5203 : Add more linters
2019-10-17 09:47:35 -04:00
Federico Kunze
e85a734a57
update x/genaccounts to match module spec ( #4759 )
2019-07-22 16:26:42 +01:00
colin axner
314af42d92
Reintroduce Coin.IsValid() ( #4558 )
...
Closes #4556
2019-06-18 18:02:31 +02:00
Alexander Bezobchuk
dc84c99dee
Revert "Generalize auth/types.StdSignature ( #4507 )" ( #4512 )
...
This reverts commit a32d5a46d7
.
2019-06-08 11:04:52 +01:00
Alessio Treglia
a32d5a46d7
Generalize auth/types.StdSignature ( #4507 )
...
New Signature interface available in the top level types package.
auth.StdSignature implements such interface. User defined auth
module can now define their own custom signature types.
Work carried out in the context of the following issues:
- #4488
- #4487
2019-06-07 14:21:35 +01:00
Federico Kunze
9c65e47329
Merge PR #4485 : rename expected pkg to exported
...
* rename expected pkg to exported
* rename pkg
2019-06-05 13:42:25 -04:00
Alexander Bezobchuk
6ec9b26cef
Merge PR #4454 : Implement MarshalJSON for Coins Type
2019-05-31 11:16:08 -04:00
Alessio Treglia
04ed12dd2a
Merge PR #4303 : Fix coins findDup()
2019-05-08 09:51:30 -04:00
Alexander Bezobchuk
1bd70a238d
Merge PR #4281 : Fix addGenesisAccount
2019-05-07 13:10:35 -04:00
Frank Yang
7e53da86ee
Merge PR #3884 : steak to stake
2019-03-14 10:32:46 -04:00
Alessio Treglia
7af11ece92
Merge PR #3864 : Make IsAllGTE() more consistent
...
* Make IsAllGTE() more consistent
Co-Authored-By: alessio <quadrispro@ubuntu.com>
2019-03-12 19:13:36 +01:00
Alessio Treglia
862cc436f3
Fix tests
2019-03-08 01:09:26 +00:00
Alessio Treglia
714168f473
Merge branch 'develop' into sunny/coins-AllGT-test
2019-03-08 01:58:24 +01:00
Alessio Treglia
fbd79d0cad
Merge PR #3818 : Introduce sdk.NewCoins
2019-03-07 16:55:08 -08:00
Sunny Aggarwal
9ffe64dc1e
failing test
2019-03-07 09:02:40 +01:00
frog power 4000
a814e5ce66
Merge PR #3679 : Consistent Operators
...
* Minus->Sub Plus->Add Div->Quo
* pending
* Update PENDING.md
Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com>
* fix
* typo
2019-02-21 12:35:55 -05:00
Alexander Bezobchuk
26c13b28cd
Merge PR #3607 : Reconcile DecCoin/s API with Coin/s API
2019-02-15 16:33:23 +01:00
Alexander Bezobchuk
2216f4716e
Merge PR #3625 : Fix Fee Comparison
2019-02-12 16:22:04 +01:00
Alexander Bezobchuk
7bc837aa06
Merge PR #3555 : Reintroduce Fees OR Semantics
2019-02-07 18:14:54 -08:00
Alexander Bezobchuk
36d1736a08
Refactor Gas/Fee Model ( #3258 )
2019-01-18 08:45:20 -08:00
Alexander Bezobchuk
03bdd3f870
Fix IsAnyGTE ( #3265 )
2019-01-09 12:31:03 -08:00
Alessio Treglia
1040e3a8f5
Increase CLI test coverage ( #3254 )
2019-01-08 08:43:36 -08:00
Zaki Manian
ed2b6bd9a7
Multiple fees in min fees to OR instead of AND ( #3239 )
2019-01-08 08:21:54 -08:00
Dev Ojha
67a1e47c6e
Fix is_valid bug ( #3211 )
2019-01-02 11:14:12 -08:00
Christopher Goes
5ca8c5bb83
Merge PR #3207 : Fix token printing bug
...
* Add IsPositive, case check on coins[0]
* Link to correct PR
* Add testcase
2019-01-02 19:17:27 +01:00
Alessio Treglia
500fa2b694
Make coins denoms case insensitive ( #3092 )
2018-12-18 11:14:11 -08:00
Alexander Bezobchuk
41fc538ac7
Add Safety Measures to Coin/Coins ( #2797 )
2018-11-20 01:22:35 -08:00
Alessio Treglia
70826495b8
Merge PR #2752 : Don't hardcode bondable denom
2018-11-12 19:54:18 +01:00
Jae Kwon
2a3d1f1e87
Fix coins.IsLT() impl ( #2686 )
...
* Fix coins.IsLT() impl
* Fix coin.IsLT() impl
* Coins.IsLT -> Coins.IsAllLT etc
2018-11-07 00:14:48 -08:00
Christopher Goes
17983460b8
Merge PR #2219 : Update to Tendermint 0.24 (except NextValSet offsets)
2018-10-03 17:48:23 +02:00
Dev Ojha
9e27e4bac5
Merge PR #2386 : types/coins: Add benchmarks for coins addition
2018-09-26 21:15:37 +08:00
Alessio Treglia
b74a6a9066
Merge PR #2328 : Support min fees-based anti spam strategy
2018-09-19 23:25:52 +08:00
Christopher Goes
46382994a3
Merge PR #1925 : Fix develop from FF merge
...
* Update types/coin_test.go from FF merge
* 'make format'
2018-08-06 21:49:17 +02:00
Joon
93457aac33
Merge PR #1626 : Increase coverage of types/
2018-08-06 21:00:49 +02:00
Joon
19b0781e60
Merge PR #1811 : NewCoin takes sdk.Int
2018-07-31 02:09:50 +02:00
Dev Ojha
4b688992ba
Merge pull request #1691 : Table driven test indexes
...
* types: Switch table driven test error messages to new format
Make table driven tests in /types follow the format described in #1664
* typos / lower case errors
* lower case, not sentences
* lower case, not sentences
2018-07-16 14:42:28 -04:00