Commit Graph
27 Commits
Author SHA1 Message Date
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
Alessio Treglia f68e5a7542 Merge PR #2266: Fix CLI commands JSON output
When running with --json, commands should produce
correctly JSON-encoded output.
2018-09-08 16:33:55 +08:00
Alessio Treglia 8378f3ea86 Drop note in PENDING.md about generate_only=true query arg 2018-09-04 17:35:35 +02:00
Alessio Treglia 89b3ab9e51 Don't skip basic validation 2018-09-04 17:29:33 +02:00
Alessio Treglia 8c32a8f229 Check generate_only's output is actually unsigned 2018-09-04 15:06:55 +02: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
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 1ed76565f2 Remove obsolete comments 2018-08-31 19:04:45 +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
Alessio Treglia 76a16ab288 Modify AnteHandler to take a simulate boolean parameter 2018-08-25 20:12:14 +01: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 fb5fe9914d simplify json handling in LCD tests 2018-08-24 10:16:51 +01:00
Alessio Treglia 2dea46779c TestCoinSend: test success case when setting gas by hand 2018-08-24 10:16:51 +01:00
Alessio Treglia 7e9ceb452d clarifyy that adjustment is a multiplicative factor 2018-08-24 10:16:51 +01:00
Alessio Treglia e959478e61 comment getContextForAnte(), rename applyTxMode() 2018-08-24 10:16:51 +01:00
Alessio Treglia 47d55bd572 Add/refresh docs 2018-08-24 10:16:51 +01:00
Alessio Treglia 323fac3bf7 Update PENDING.md 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
Alessio Treglia c02456b8a1 Update PENDING.md 2018-08-23 12:37:01 +01:00
Alessio Treglia ceb33ca464 Rename test_cli to integration_tests
Move `make test_examples` into integraton_tests.
2018-08-23 08:55:05 +01:00
Alessio Treglia 56a98cb047 Simple integration tests for {base,demo}coind
Closes: #1632
2018-08-22 18:17:15 +01:00
Alessio Treglia 187bc1972a Merge PR #1950: Validator.Owner -> .Operator
* Rename --address-validator flag to --validator

See #1901

* Update PENDING.md

* Rename Validator.Owner -> Validator.Operator

See #1901
2018-08-16 16:47:59 -04:00
Alessio Treglia 4fbaee205f Merge pull request #1997: Handle unmarshalling failures gracefully in x/stake commands
* Handle panic gracefully when unbond begin fails

See #1831

* Handle failure to query delegation gracefully.

Closes #1907

* Update PENDING.md

* Reuse stake's error functions

* New ErrBadValidatorAddr error

UnmarshalValidator() checks the address length first;
it does not make sense to attempt unmarshalling if the
address is wrong.

* New ErrBadDelegationAddr error

* Introduce ErrBad{Redelegation,UnbondingDelegation}Addr custom errors to replace errors.New() calls

* Replace ErrBadUnbondingDelegationAddr with ErrBadDelegationAddr to avoid duplication

Thanks: @melekes for pointing this out

* Use sdk.AddrLen instead of hardcoded address length

* s/triple/tuple/ ## mention PR id in PENDING.md
2018-08-15 15:49:06 -04:00
Alessio Treglia 831435ccc0 Merge PR #1948: enable indexing of all tags by default 2018-08-10 15:40:21 +02:00