Commit Graph

210 Commits

Author SHA1 Message Date
Sunny Aggarwal b7da2eaa33 Merge PR #2799: Account numbers and sequences to uint64 2018-11-26 12:29:21 +01:00
Alessio Treglia 3e68e44063 Merge PR #2874: gaiad gentx subcommands refactoring
* gaiad gentx subcommands refactoring

- Replace STDIN/STDOUT redirection in `gaiad gentx` with subcommands
  command line options to redirect streams to file since viper does
  not handle redirection well.
- Use `BuildCreateValidatorMsg` to build a `MsgCreateValidator` rather
  than redirecting to `gaiacli tx stake create-validator`.
- `PrintUnsignedStdTx` now takes an `io.Writer` object.
- Mark `--pubkey`, `--amount` and `--moniker` as required flags
  instead of validating them manually.
- Use stake.NewDescription() to make a new Description - ref #2835

* Refresh PENDING.md
2018-11-22 00:44:13 +01:00
Alexander Bezobchuk 41fc538ac7 Add Safety Measures to Coin/Coins (#2797) 2018-11-20 01:22:35 -08:00
Jack Zampolin f525717054
Standardize CLI Exports from Modules (#2840)
* Move query and tx commands to modules
* Move GetAccountDecoder to prevent import cycle and replace calls to it with one call in WithAccountDecoder
* Add moduleClients interface and implement in all applicable modules
* Use module clients in cli initialization
2018-11-19 09:02:34 -08:00
Christopher Goes fd968f7d8f R4R: Remove unused bank.MsgIssue (and prevent possible panic) (#2855)
* Remove all bank.MsgIssue code
2018-11-19 07:42:53 -08:00
Sunny Aggarwal 8d6b0929fb Codespaces as Strings (#2821) 2018-11-16 09:12:24 -08:00
Aleksandr Bezobchuk 845dd68de0 Address style comments 2018-11-07 14:46:09 -05:00
Aleksandr Bezobchuk 812784c940 Cleanup bank keeper 2018-11-07 09:27:20 -05: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
Alexander Bezobchuk 50926fffff Update to TM v0.26.0 - Part I (#2679)
* Update to TM v0.26.0
2018-11-04 18:28:38 -08:00
Dev Ojha 8e328c8706 Merge PR #2665: simulation: Remove header from Invariant
This got introduced recently, but wasn't actually needed, hence the reversion
2018-11-02 13:35:21 +01:00
Rigel d71f38bdac Merge PR #2597: Add distribution accum invariants 2018-10-26 13:42:53 +02:00
HaoyangLiu 9ee9e28439 Merge PR #2462: Add swagger-ui for gov, stake and slashing 2018-10-24 15:19:48 +02:00
Sunny Aggarwal d666658ca9 Merge PR #2553: Renamed msg.Name() and msg.Type() to msg.Type() and msg.Route() 2018-10-23 21:23:55 +02:00
Christopher Goes 3e22a36c5e
Merge PR #2545: Rename AccountMapper to AccountKeeper 2018-10-21 23:48:24 +02:00
Alessio Treglia a4c7faaa40
Mark --to and --amount flags required for gaiacli tx send
Closes: #2547
2018-10-20 23:55:29 -07:00
Alessio Treglia 6014089fa1
Rename AccountMapper to AccountKeeper
Closes: #2540
2018-10-20 23:22:48 -07:00
Alessio Treglia 593921d04d Merge PR #2524: Replace GenTx with StdTx
Rework the process of loading a genesis.json file to load a starting app state and set of initial transactions to process.

* New function to create genesis account from MsgCreateValidator
* Add arg to PrintUnsignedStdTx() to actually operate in offline mode
* New func processStdTxs()
* Remove gen-tx command
* Cleanup, return validators as they need to be written into genesis.json
* Modify gaiad init to allow auto-create of stdTx
* Remove server/testnet.go
* Don't load node_key.json, which might not be available
* Get the txs through DeliverTx
* Add app.slashingKeeper.AddValidators at the end of genesis
* On InitChain(), Signature's account number must be 0
* Add (tentative?) command to generate {node_key,priv_validator}.json files
* Reintroduce gaiad testnet
* Prompt user for passwords
* Update gaia to work with auth.StdTx
* Remove test_utils, NewTestGaiaAppGenState is now deprecated
* Combine --genesis-format and --generate-only
* Improve sign command's --offline flag documentation
* Moniker must be set
* Call app.slashingKeeper.AddValidators() even if len(txs) == 0
* Refactoring, introduce gaiad init --skip-genesis, code cleanup
* Drop unnecessary workaround to make lcd_tests pass
* Reintroduce gentx
* Simple name changes, GenesisState.Txs -> .GenTxs; OWK -> OverwriteKey; OverwriteKeys -> OverwriteKey
2018-10-19 20:00:27 +02:00
Alessio Treglia 0f4a03b44e Alessio/server refactor (#2472)
* Add arg to PrintUnsignedStdTx() to actually operate in offline mode
* WIP simplifying server module
* Expose ExternalIP()
* Move {GenTx,Init}Cmd into gaia's new init package
2018-10-10 15:45:41 -07:00
HaoyangLiu 9f67e8af20 Merge PR #2215: Add swagger-ui for gaiacli lite-server 2018-10-04 13:00:24 +02:00
Dev Ojha 9410b6287c Merge PR #2425: simulation: Make bank testing auth configurable 2018-10-02 14:01:18 +02:00
Jae Kwon 1e26ba2e0e
CLIContext.Logger -> .Output as it isn't a logger (#2420)
This changes .Logger to .Output, as it isn't used anywhere except as os.Stdout.
2018-09-28 21:45:54 -07:00
Dev Ojha 7d5bc459fa Merge PR #2413: Remove reflection from handlers 2018-09-27 05:04:06 +08:00
Alexander Bezobchuk 91cac96fea Merge PR #2391: LCD Cleanup and DRY Refactor 2018-09-26 21:29:39 +08:00
Alexander Bezobchuk 611e287375 Merge PR #2401: Remove remnants of gocyclo 2018-09-25 13:45:04 -04:00
ValarDragon bb624b36aa simulation: Use a simulation.Account struct
This removes privkeys and addresses from function signatures.
This comes with a 11% performance improvement to the simulator,
as we no longer keep recomputing the pubkeys.
Once we move the transient store clearing to endblock, we can
further raise the size of make test_sim_gaia_fast

concretely, `make test_sim_gaia_fast` went from 16.8 seconds to 13.5 seconds on my system.
2018-09-22 20:33:32 -07:00
Dev Ojha 65137f6331 Merge PR #2343: Add a name field to the message type
This is to facillitate ease of implementing #1406. (Tags for messages
could then be added dynamically)

Ultimately once we make the router support hiearchical routing, (#770)
we can then remove the name field and just the parse info for tags from that.

Until then, we can parse the tag name as
`fmt.Sprintf("%s %s", msg.Type(), msg.Name())`
2018-09-17 22:34:06 +08:00
Dev Ojha 6b55093c75 Merge PR #2324: rename wire to codec
* rename wire to codec

* fix formatting and cli

* fix the docs
2018-09-13 14:17:32 -04:00
Rigel 5bf9401e87
Merge PR #2310: staking transient store for Tendermint Updates
* working

* non-tests compile

* fix mounting error, working on testing

* stumped using transient store

* joon comments

* remove old comments

* resolve ibc error

* lint/sim_test

* fix determinism sim test

* sim enable commit

* docs and pending
2018-09-13 00:53:55 -04:00
Dev Ojha e5e7c4fa0f Merge PR #2303: simulation: Add weighted operation 2018-09-12 15:16:52 +08:00
Alessio Treglia fb0cc0b078 Merge PR #2306: Change --gas=0 semantic and introduce --gas=simulate
* Change --gas=0 semantic and introduce --gas=simulate

Make --gas flag accept a conventional "simulate" string value in addition
to integers. Passing --gas=simulate would trigger the tx simulation and
set the gas according to the gas estimate returned by the simulation.
Any other integer value passed to --gas would be interpreted as-is and
and set as gas wanted value.

Closes: #2300

* Add test cases with gas=0

* ACK suggestion from @alexanderbez

* s/GasFlagSimulateString/GasFlagSimulate/

* Drop TODO comment on Gas type

* Enrich TODO with ref
2018-09-11 20:31:30 -04:00
Alexander Bezobchuk e13cdc0260 Merge PR #2146: x/bank: Keeper Interfaces
* Update banking module to implement and use keeper interfaces

* Cleanup/consolidate x/bank keeper interface
2018-09-10 14:25:34 -04:00
Dev Ojha 173ed6a63d Merge PR #2282: simulation: Switch the log method from a single string to string builders 2018-09-09 23:34:09 +08:00
Alessio Treglia 4448d175ad Merge PR #2240: New broadcast command
Implement broadcast command/REST endpoint to submit transactions
generated offline with --generated-only and the sign command.
2018-09-08 17:26:20 +08:00
ValarDragon e812919649 Rename coinKeeper -> bankKeeper
Closes #2267
2018-09-07 22:34:32 -07:00
Jae Kwon 6325441861 txBld -> txBldr 2018-09-07 10:15:49 -07:00
Jae Kwon acd125029d x/auth/client/context -> x/auth/client/txbuilder 2018-09-07 10:04:58 -07:00
Alessio Treglia 54b3b5c028
sed -i 's/txCtx/txBld/g' 2018-09-07 14:39:23 +01:00
Alessio Treglia 3b6da7af18
TxContext -> TxBuilder 2018-09-07 14:36:21 +01:00
Alessio Treglia 86395809cb
Implement generate-only option for commands that create txs
The new CLI flag builds an unsigned transaction and writes it to STDOUT.
Likewise, REST clients can now append generate_only=true to a request's
query arguments list and expect a JSON response carrying the unsigned
transaction.

Closes: #966
2018-09-04 02:32:05 +02:00
Dev Ojha 5643c0801b Merge branch 'develop' into dev/benchmark_simulation 2018-09-01 12:37:50 -07:00
Alessio Treglia d84885ca49
No need to create a fake slice of signatures nor skip account no./sequence check 2018-08-31 19:09:39 +02:00
Alessio Treglia 122ed3a900
Don't use pointers when you need them not! 2018-08-31 19:04:45 +02:00
Alessio Treglia 1370ca611b
Set GasAdjustment in CLIContext when handling HTTP requests
This is to address @alexanderbez's comments
2018-08-31 19:04:42 +02:00
Alessio Treglia 599923fb99
Introduce simulate mode
Add a simulate only flag '--dry-run' to both CLI tx commands
and RESTful endpoints to trigger the simulation of unsigned
transactions.

* Turning --dry-run on causes the --gas flag to be ignored.
  The simulation will return the estimate of the gas required
  to actually run the transaction.
* Adjustment is no longer required. It now defaults to 1.0.
* In some test cases accounts retrieved from the state do not
  come with a PubKey. In such cases, a fake secp256k1 key is
  generated and gas consumption calculated accordingly.

Closes: #2110
2018-08-31 19:04:11 +02:00
Alexander Bezobchuk 2d92803b9f Merge PR #2040: Refactor Validator Account Types/Bech32 Prefixing
* Add new account bech32 prefixes with godocs

* Restructure spacing of existing account code

* Update account godocs

* More account godoc updates + new tm pub/addr helpers

* Update validator type to use new account types/bech32 prefixes

* Fix account documentation errors

* Update Bech32 prefix for consensus nodes

* Update Bech32 spec doc

* Fix account type tests

* Add missing account consensus functions, clear up godocs, and fix tests

* Add to TestRandBech32PubkeyConsistency check

* Update initialization of validator public keys

* Update query signing info command

* Implement new ConsAddress type with associated unit tests

* [WIP] Update stake and slashing parameters

* Update all calls to MustBech32ifyValPub

* [WIP] Validator operator API updates

* [WIP] Fix and update unit tests

* Fix gov logs (helping to debug failing tests)

* Fix gov tally

* Fix all broken x/ unit tests

* Update gaia app genesis address logic

* Fix linting errors

* Fix broken LCD tests

* Fix broken CLI tests

* Implement command to get validator address and pubkey from key name

* Add support for getting validator key information via REST endpoint

* Update PENDING log

* Update docs

* Revert GaiaGenTx.PubKey bech32 prefix

* Fix broken docs and cli tests

* Update genesis to use correct Bech32 (cons) prefix for pubkeys

* Update docs and unit tests to reflect new cosmos account bech32 prefix

* minor formatting
2018-08-31 00:06:44 -04:00
ValarDragon 46bbada4ee simulation: Add benchmarking 2018-08-29 23:02:15 -07:00
Christopher Goes 5f347e0d9a
Merge PR #2166: simulation: Allow operations to specify future operations 2018-08-28 14:53:45 +02:00
Christopher Goes 73f90e8f92
Merge PR #2047: Simulate transactions by default to set gas automatically 2018-08-28 13:53:29 +02:00
ValarDragon 855222e8c3 simulation: Allow operations to specify future operations
The intent of this is to allow for simulating things like slashing for not
voting on a governance proposal. To test this, you would queue all the validator votes
in future blocks, and keep track of which ones you didn't slash. Then you could add queue a
"check governance slashing operation" after the voting period is over.
2018-08-27 14:27:00 -07:00