Commit Graph

210 Commits

Author SHA1 Message Date
ValarDragon 4451755600 simulation: rename TestAndRunTx to Operation, make timestamp randomized 2018-08-26 19:40:53 -07:00
Alessio Treglia 7e8feec738
Incorporating @cwgoes comments 2018-08-24 15:20:53 +01:00
Alessio Treglia f36f749818
Incorporating @ValarDragon's comments 2018-08-24 10:16:51 +01:00
Alessio Treglia f432c0c383
Simulate transactions before actual execution
* Change --gas=0 semantic in order to enable gas auto estimate.
* REST clients have been modified to simulate the execution of
  the tx first to then populate the context with the estimated
  gas amount returned by the simulation.
* The simulation returns both an unadjusted gas estimate and an
  adjusted one. The adjustment is required to ensure that the
  ensuing execution doesn't fail due to state changes that might
  have occurred. Gas adjustment can be controlled via the CLI's
  --gas-adjustment flag.
* Tiny refactorig of REST endpoints error handling.

Closes: #1246
2018-08-24 10:16:51 +01:00
Dev Ojha 8bb79d12ca Fix non-deterministic map iteration in fuzzer (#2069)
* This demonstrates that the state machine is non-deterministic if there
are more than two txs in a block.

* fix non-deterministic map iteration

* (squash this) fix build errors

* (squash this) iterate using range
2018-08-16 23:45:07 +02:00
Christopher Goes 3d50567034
Merge PR #1783: Slashing, validator set, and governance simulation 2018-08-16 17:36:15 +02: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
Alexander Bezobchuk 12c2c236c2 Merge PR #1741: CoreContext Refactor 2018-08-06 20:11:30 +02:00
Joon 19b0781e60 Merge PR #1811: NewCoin takes sdk.Int 2018-07-31 02:09:50 +02:00
Dev Ojha 5d02a743fb Update to tendermint v0.22.6-rc0 (#1798)
* Update to tendermint v0.22.6-rc0

This is comprised of updating the crypto imports / API

* (squash this) switch to v0.22.6

If this passes tests, I'll squash this commit and update the PR.
2018-07-25 16:43:37 -04:00
Alexander Bezobchuk f437f36c4a Merge PR #1764: Table-Driven Bank Module Unit Tests 2018-07-21 00:46:51 +02:00
Christopher Goes ee29e10068 RandomKey, RandomAmount 2018-07-19 08:48:43 +02:00
Christopher Goes 05ceff5212 Deterministic 'make test_sim' on CircleCI; bank test fix 2018-07-18 09:37:14 +02:00
Christopher Goes 8bd54f0701 Refactor bank tests 2018-07-18 09:05:48 +02:00
mossid bc12880394 Merge pull request #1379: Account constructor in AccountMaper
fix

fix democoin

fix tests

pass lint

last fix

apply requests

fix build failing

fix docs
2018-07-09 20:29:14 -07:00
Sunny Aggarwal 896cd333f0 address comments 2018-07-09 16:06:05 -07:00
Sunny Aggarwal 25d976feb4 works? 2018-07-09 01:47:38 -07:00
Sunny Aggarwal d87c9ebc74 fixed lcd errors 2018-07-09 01:01:29 -07:00
sunnya97 7ac220beb6 asdf 2018-07-09 00:59:51 -07:00
Sunny Aggarwal 50ed0fa1ae asdf 2018-07-09 00:35:28 -07:00
Dev Ojha 6f8f222ef6 Merge pull request #1175: Randomized Module Testing
* WIP, ammend this later

* Add randomized testing suite

* Fix linting

* Auth invariant check, method to take in seed, way to run invariant check less frequently

* Fix merge conflicts

* Update bank

* Fix error on zero input by skipping it

* Add PeriodicInvariant Function

* Abstract verification / send functionality

* Fix liniting errors (PeriodicInvariant godoc)

* Update formatting and docs of randomization

* Minor refactor, update godocs

* Update godoc for mock

* Export TestAndRunTx

* fix cyclic dependencies

* Address PR most pr comments

* Fix merge conflict: Bring back codec.seal

* remove debug code, fix linting

* Fix merge conflicts
2018-07-06 16:19:11 -04:00
ValarDragon c708c799fd Add print-response flag 2018-07-05 22:19:50 -07:00
ValarDragon 2197a9598b Merge branch 'dev/add_async_flag' of github.com:cosmos/cosmos-sdk into dev/add_async_flag 2018-07-05 20:19:39 -07:00
ValarDragon 8857b69d02 Use async flag directly from context 2018-07-05 20:15:40 -07:00
Dev Ojha be9ae47b0a
Merge branch 'develop' into dev/add_async_flag 2018-07-05 20:06:52 -07:00
ValarDragon 27a31cae44 add Async to context 2018-07-05 20:05:17 -07:00
Christopher Goes 0c47e6ffdf
Merge PR #1568: cli: deprecate --name in favor of --from 2018-07-06 04:37:45 +02:00
ValarDragon 6f94dd64c0 cli: Add async flag to all broadcasting txs
closes #1436
2018-07-05 19:15:37 -07:00
Ismail Khoffi abce54ea60
Merge branch 'develop' into sort_getsignbytes 2018-07-06 01:31:34 +01:00
ValarDragon bf8cde1d3a cli: deprecate --name in favor of --from 2018-07-05 17:24:02 -07:00
Liamsi b7f902fba5 sort *all* GetSignBytes:
- call MustSortJSON before return JSON bytes to guarantee alphabetic
ordering

- moved SortJSON and MustSortJSON to types package to avoid cyclic
package dep
2018-07-06 01:12:57 +01:00
Liamsi 0f1ceb073e sort all relevant GetSignBytes:
- call SortJSON before return JSON bytes to guarantee alphabetic
ordering
2018-07-06 00:23:12 +01:00
Ethan Buchman 586ab68b2a
Merge pull request #1490 from cosmos/dev/improve_send_error_msgs
gaiacli: Improve error messages for `send` command
2018-07-05 17:22:16 -04:00
Alexander Bezobchuk 0b9e0f2afc Merge PR #1492: Improve Module Test Coverage
* Merge pull request #1492: Improve Module Test Coverage
* Revert renaming of SignCheckDeliver [#1492]
* Remove named fields from stake unit tests & fix comments [#1492]
* update for tmlibs->tendermint/libs
* Remove tmlibs dependency
2018-07-04 06:21:36 +02:00
Ethan Buchman f78f30c67a update for tm v0.22.0. tmlibs->tendermint/libs 2018-07-02 16:34:06 -04:00
ValarDragon 819eedd281 gaiacli: Improve error messages for `send` command
Now provides better error messages when the account you're sending
from has no money, or it has insufficient funds. (Avoids making
the user interpret ABCI errors)

closes #1489
2018-06-30 01:32:01 -07:00
Dev Ojha 955a0c9af7 Switch asserts to require (#1483)
* meta: Switch the majority of asserts to require

Switch most assert statements to require, to ease debugging.
Closes #1418

* Fix imports
2018-06-30 03:10:15 +02:00
Christopher Goes 59aadf42aa
Ledger integration (#931)
Merges the keybase and Ledger code from go-crypto (which is no more) into the SDK
Adds support for Ledger into gaiacli
Cherry-picks updated error handling from #1158
2018-06-29 02:54:47 +02:00
Dev Ojha ac3adff1e8 Merge PR #1438: Tools: Add errcheck linter
This linter ensures that all errors are checked.
This is disabled in the client directories, since its not needed on
those writes
2018-06-29 00:52:10 +02:00
David Kajpust 090aaf8137 Merge #1412: Add async flag and functionality to gaiacli send
* added async functionality to gaiacli
* addressed requested changes, updated changelog
2018-06-28 21:23:47 +02:00
Dev Ojha 49f421db19 Merge PR #1332: benchmarks: Add benchmark for block time to bank module
* benchmarks: Add benchmark folder, and single benchmark for block time
* Move benchmark into module
* Fix merge conflict errors
* Fix spelling
* Add instructions to run benchmark
* Update auth_app_test.go
2018-06-28 00:33:56 +02:00
Dev Ojha 2e97baabf6 Merge PR #1358: Fix typos and gofmt files
* Fix typos
* gofmt -s files
* Add mispellings and gofmt checks to circle CI
* circleci: Install misspell in the linting step
2018-06-25 20:23:17 +02:00
Joon ec6acda6a4 Merge PR #1331: Remove TxBytes from NewContext 2018-06-22 03:03:05 +02:00
Aditya f049a56376 Merge PR #1266: Multiple messages
* Started work on multiple msgs, types and x/auth tests pass
* Fix issues in x, examples, and baseapp
* Added baseapp tests for multiple msgs
* Documentation fixes
* Fix baseapp tests with sdk.Int
* Modify test
* Transaction handling is now atomic
* Fix test comment
* Minor doc fixes and code cleanup
* Added baseapp result changes
* Use address in validator update accumulation
* Started work on multiple msgs, types and x/auth tests pass
* Fix issues in x, examples, and baseapp
* Added baseapp tests for multiple msgs
* Documentation fixes
* Fix baseapp tests with sdk.Int
* Modify test
* Transaction handling is now atomic
* Fix test comment
* Minor doc fixes and code cleanup
* Added baseapp result changes
* Use address in validator update accumulation
* Added ante tests for multisigner
* Remove validatorUpdates from tx result
* Better error logs
* Put Memo in StdSignBytes and formatting
* Updated changelog
2018-06-22 00:05:25 +02:00
Dev Ojha e2d23040a8 Merge PR #1325: Refactor Complete Setup to not take in a testing parameter
* Refactor Complete Setup to not take in a testing parameter
* Update changelog
2018-06-21 18:55:08 +02:00
Christopher Goes 2a9bc2153a Merge pull request #1310: Fix x/bank REST handler
* Update sendtx.go

* Pass chain_id through in LCD tests

* Update changelog
2018-06-20 10:34:12 -07:00
Joon 314b5a854d Merge PR #1218: sdk.Int in sdk.Coin
implement Int, Int256, Uint256
pass ci
pass ci
add to changelog, add boundcheck to test
add comments, fix cli_test.go
fix errors
apply requested changes
panics on New*WithDecimal
fix Int.BigInt()
fix stake tests
* Panic on uint division-by-zero
* Set ok=false on NewIntFromString, NewUintFromString failure
* Nuke CircleCI caches
2018-06-15 23:16:45 +02:00
David Kajpust ec2fedd36c Merge PR #1227: Set all Error strings 1st letters to lowercase. Fixes issue #1154 2018-06-13 21:13:22 +02:00
Sunny Aggarwal 161cb474d4 Account Numbers for Replay Protection with Account Pruning (#1077)
* in progress
* passes current tests
* added tests and got working
* changelog and docs
* removed prints
* oops
* works!
* issue in test_cli
* number 9 number 9 number 9
* at least it does only the 9 issue now
* hallelujah it works!
* removed print statement
* rebased
* gah
2018-06-12 04:30:54 +02:00
Rigel 1b20adcd22 Merge PR #1191: LCD cleanup / add LCD gas field
* remove global variables from lcd
* added make race, fix lcd race condition
* cleanup
* Five-character changelog update
2018-06-12 03:12:37 +02:00
Fabian 8ece807301 Merge PR #1085: Re-enable tx history in LCD
* reenable tx search
* removed not needed argument
* register types for decoding
* trying to fix indexing tests
* added tx hash query test
* Fix x/bank tagging
* remove dead code
* remove print
* extended tests for tx querying
* changelog
* added txs address querying
* linted
* rename
* use prefix for bech32 addresses in tags
* changed error message
* Fix tiny linter issue
2018-06-11 22:09:29 +02:00
Rigel 0b9751ac98
Merge pull request #1170 from cosmos/rigel/test_framework
mock test framework for modules
2018-06-08 13:30:24 -07:00
rigelrozanski 17948ccf04 auth-mock simulate block now commits, stake app_test cleanup 2018-06-08 11:28:07 -07:00
rigelrozanski abab7c2e42 modules test within mock application 2018-06-07 20:55:14 -07:00
rigelrozanski 1e67768485 ported ibc tests 2018-06-07 17:20:35 -07:00
rigelrozanski f58b454985 mock application framework compiling 2018-06-07 16:13:11 -07:00
Christopher Goes b166cc237f
Testcase/linter fixes 2018-06-08 00:35:13 +02:00
Christopher Goes a6c0db71e5
Bech32ify GetSignBytes() for x/bank 2018-06-08 00:32:14 +02:00
Christopher Goes f8896ee7aa
Fix x/bank Msg testcases 2018-06-07 23:47:23 +02:00
Christopher Goes cabb6e68fc
bech32ify x/bank/MsgSend 2018-06-07 23:42:37 +02:00
Fabian 5f409ce832 Merge PR #1086: Bech32Cosmos output/input for the LCD
* refactored bech32ization
* updated keys endpoints for bech32
* bech32 for sending and querying
* trying to change output of validator addresses
* fixed validator output
* linted
* fixed merge conflict
* added bech32 to staking endpoints
* removed some logging statements
* added GetAccPubKeyBech32Cosmos
* fixed cli tests
* updated swagger
* merged standard bech32 change
* renamed bech32cosmos to bech32
* bech32ify json output for key add
* readded changelog
* fixed changelog merge issue
* Update CHANGELOG.md
2018-06-06 06:53:04 +02:00
Zaki Manian ce850dca3b Switch from bech32cosmos to bech32 2018-06-01 16:23:58 +02:00
Christopher Goes 12a7c0373a
Merge pull request #1072 from ValarDragon/dev/tx_encoding
Change to go-wire UnmarshalJSON for bank transactions
2018-05-31 23:51:27 +02:00
ValarDragon e9545d69ed Switch the default modules to use wire.codec's MarshalJSON instead of json.Marshal 2018-05-31 11:51:15 -07:00
ValarDragon 2d87563856 Change to go-wire UnmarshalJSON for bank transactions
The bank module now uses it's own codec to encode and decode Bank Msgs
into JSON.
2018-05-28 11:26:43 -07:00
Zaki Manian f33f49a840 Almost from scratch reimplementation of bech32cosmos integration. 2018-05-27 13:47:23 +02:00
sunnya97 cb52712660 in progress 2018-05-23 19:49:35 -07:00
Ethan Buchman 4bdcad572b remove gasLimit from NewContext 2018-05-15 22:19:09 -04:00
Christopher Goes 4134bf922c
Address PR comments 2018-05-16 02:06:17 +02:00
Christopher Goes 702ffafa06
Rebase 2018-05-16 01:14:30 +02:00
Christopher Goes 1f8ef62d28
Swap to panic/recover version 2018-05-16 01:13:48 +02:00
Christopher Goes f0e4d24ea3
Basic gas impl, quick testcase 2018-05-16 01:13:47 +02:00
Christopher Goes efc7843fb9
Changes to bank keeper for gas 2018-05-16 01:13:47 +02:00
Christopher Goes 26991803ee
GasMeter & context updates 2018-05-16 01:13:47 +02:00
Rigel 64f445ed22
Merge pull request #985 from LLLeon/master
modify bad syntax for struct tag value
2018-05-14 10:29:11 -04:00
LLLeon f1e441346a x/bank: fix typo 2018-05-13 20:47:26 +08:00
Christopher Goes 2b707f6b0a
AppendTags a function of Tags 2018-05-10 17:37:12 +02:00
Christopher Goes 60b56f9b1c
Slight tags API changes (Jae comments) 2018-05-10 17:36:55 +02:00
Christopher Goes bef7e44f6d
Example tag implementation for CoinKeeper 2018-05-10 17:36:55 +02:00
Christopher Goes 62fc3e2c49
Context-accessible logger field 2018-05-01 13:52:49 +02:00
Sunny Aggarwal af0e71fa0d
got rid of Get on Msg interface 2018-05-01 00:15:15 +02:00
Christopher Goes 5b4fb85f7e
Fn suffix & http.HandlerFunc 2018-04-25 22:32:22 +02:00
Christopher Goes fd40d39556
Only one CoreContext for all REST commands 2018-04-25 16:49:31 +02:00
Christopher Goes 56ac948dc6
REST folder restructure & cleanup 2018-04-25 16:18:06 +02:00
rigelrozanski d28efaac27 many renames / golint compliance 2018-04-19 00:49:24 -04:00
rigelrozanski 996cafe972 register wire, stake changelog, stake genesis update 2018-04-18 12:19:35 -04:00
Christopher Goes f8e44b5b00 Error codespacing (#809)
* Initial codespacing layout (ref #766)
* Add codespace to Router (ref #766)
* Implement Codespacer and update modules
* Default codespaces, testcases
* Update error formatting, codespacer tests
* Add RegisterOrPanic testcase
* Update CHANGELOG
2018-04-17 19:16:21 -07:00
Sunny Aggarwal d2013ec2a0
added state change revert comment 2018-04-17 23:39:57 +02:00
Sunny Aggarwal fcc164fab1
rebase and switch test to amino 2018-04-17 23:39:57 +02:00
Sunny Aggarwal c7bd05f0b8
hard reset 2018-04-17 23:39:52 +02:00
Christopher Goes c7b680a545
Address PR comments 2018-04-10 11:16:30 +02:00
Christopher Goes bd626ba94e
Helper function 2018-04-10 11:16:30 +02:00
Christopher Goes ec98545a1b
Default to next sequence number (closes #807) 2018-04-10 11:16:30 +02:00
Adrian Brink 13521b3f77
Remove deadcode 2018-04-09 17:33:53 +02:00
Ethan Buchman 4bee8c6865 update for tendermint v0.18.0-rc1 2018-04-05 16:31:06 +03:00
Christopher Goes 12f4a21d03
Reuse Tendermint client instance (closes #671) 2018-04-03 22:16:03 +02:00
Christopher Goes 8412215c16
Additional module cleanup 2018-04-03 22:16:03 +02:00
Christopher Goes 7214149f1d
Move client context initialization from viper to separate package 2018-04-03 22:16:03 +02:00
Christopher Goes f5322fa25f
Remove unused imports 2018-04-03 22:15:51 +02:00
Christopher Goes 7a8e00dbb9
Change CoreContext parameters instead of using viper.Set 2018-04-03 22:15:27 +02:00