Commit Graph

137 Commits

Author SHA1 Message Date
Emmanuel Odeke f52d92a40e modules/coin/rest: implemented CreateRole
* Note: Role must be a hex string, as enforced in tests/rest/cli.sh

```shell
$ curl -X POST http://localhost:8998/build/create_role --data \
'{
  "role":"DEADBEEF", "seq": 1,
  "min_sigs": 1,
  "signers": [{
    "addr": "4FF759D47C81754D8F553DCCAC8651D0AF74C7F9", "app": "role"
  }]
}'
```

```HTTP
HTTP/1.1 200 OK
Content-Type: application/json
Date: Tue, 08 Aug 2017 19:15:13 GMT
Content-Length: 387

{
  "type": "chain/tx",
  "data": {
    "chain_id": "test_chain_id",
    "expires_at": 0,
    "tx": {
      "type": "role/create",
      "data": {
        "role": "DEADBEEF",
        "min_sigs": 1,
        "signers": [
          {
            "chain": "",
            "app": "role",
            "addr": "4FF759D47C81754D8F553DCCAC8651D0AF74C7F9"
          }
        ]
      }
    }
  }
}
```

Updates #200
2017-08-18 22:32:04 +01:00
Alexis Sellier cedb66066c Fix return args 2017-08-08 12:21:18 +02:00
Ethan Frey 2b1c4dd8b9 Really renames etc -> eyes... finish the job 2017-08-07 19:21:07 +02:00
Ethan Frey ade9d4527b Rename module/etc to eyes as well 2017-08-07 18:50:34 +02:00
Ethan Frey 0133723aca Clean up comments 2017-08-07 18:50:33 +02:00
Ethan Frey 6bc5fa3876 Add eyes and eyescli main commands
Note how the all framework commands can be reused with a bit of configurations.
And one can add the custom query and tx commands.
2017-08-07 18:50:33 +02:00
Ethan Frey 6e38609e3f Add CLI commands as sub-package 2017-08-07 18:50:33 +02:00
Ethan Frey 464ea226f5 Test the handlers and fix type byte for no conflicts 2017-08-07 18:50:33 +02:00
Ethan Frey 4c663d5551 Add handler and store
Notice that everything has json tags and that we check price in CheckTx,
while we run real code in DeliverTx.  Return values are meant for the client.
2017-08-07 18:50:33 +02:00
Ethan Frey 9fe2f6b365 Setup first tx, error code 2017-08-07 18:50:33 +02:00
Ethan Frey d6d6b75736 Renamed client/commands/proofs to client/commands/query 2017-08-04 20:50:36 +02:00
Ethan Frey 0de3ecc741 Compiles and all tests pass - even IBC with new proofs 2017-08-04 20:02:23 +02:00
Alexis Sellier 831c9ae3ec Use Get/GetParsed everywhere 2017-08-04 19:21:40 +02:00
Ethan Frey f2adf3645a role cli uses hex for consistency 2017-08-04 14:44:28 +02:00
Ethan Frey 640f06998a Moved all gas and payment values to uint64 to make sure we are safe here 2017-08-04 14:11:01 +02:00
Ethan Frey 2f4f875dd4 Cleanup from PR comments 2017-08-04 13:50:55 +02:00
Ethan Frey 21e2399fc4 Tested and fixed multiplexer, add more helpers 2017-08-03 21:41:24 +02:00
Ethan Frey 74070f1cac Add module tests for checktx return values 2017-08-03 21:41:24 +02:00
Ethan Frey 1715c0aeba Handlers and middlewares add gas prices 2017-08-03 21:41:24 +02:00
Ethan Frey ff658f0326 Reenable multiplexer 2017-08-03 21:41:24 +02:00
Ethan Frey 37550ca91d Add InitValidate method for setup 2017-08-03 21:41:23 +02:00
Ethan Frey 4b69f1d5ba Rename SetOption to InitState 2017-08-03 21:41:23 +02:00
Ethan Frey eb08136104 Fix all tests for CheckTx/DeliverTx split 2017-08-03 21:41:23 +02:00
Ethan Frey cbfd2cd611 Make it all compile with new Deliver/CheckTx 2017-08-03 21:41:23 +02:00
Emmanuel Odeke ee5d22010a
cmd/baseserver, */rest: allow baseserver to choose which handlers to use
Make handlers easily configurable to use in cmd/baseserver/main.go.
This way client users can trivially change what functionality they'd
like.
It involves moving ServeCmd out of client/rest to */main.go
and lets client/rest become a bazaar for available mux.Router
registrars.

Updates #200
2017-08-03 11:41:51 -06:00
Emmanuel Odeke 1a45755027 client/rest, modules/coin/rest: moved code around
After offline emails and a video call with @ethanfrey,
a goal was decided to move things around i.e:
- [X] Move /build/send and /query/account to modules/coin/rest

Due to that move, there is a lot of overlap between needed
code and utils so extracted common code to make
https://github.com/tendermint/tmlibs/pull/33
so make sure to pull in that commit into your tmlibs tree.

After code review feedback:
client/rest, modules/coin/rest: FoutputProof, PrepareSendTx helper

* Extract OutputProof to FoutputProof helper that can
be used in modules/coin/rest/handlers.go as proofs.FoutputProof
* Revert r.HandleFunc("/tx", doPostTx).Methods("POST") which
was erraneously deleted
* Use function signatures from "tendermint/tmblibs/common"
2017-08-02 12:57:29 -06:00
Ethan Frey 6632d88b3d IBC post packet test passes 2017-07-27 16:41:37 -04:00
Ethan Frey f32e6c9b7d Updated light-client 2017-07-27 16:41:36 -04:00
Ethan Frey e90d6db516 Update seed to a given height 2017-07-27 16:41:13 -04:00
Ethan Frey d0920ac1cf Add post packet to cli and test... bug 2017-07-27 16:41:13 -04:00
Ethan Frey b7abee64f0 Test creating packet and query via cli 2017-07-27 16:41:12 -04:00
Ethan Frey 9640547c01 Expose credit tx to cli and test 2017-07-27 16:41:12 -04:00
Ethan Frey 3027eeb3c3 Add CreditTx and tests 2017-07-27 16:41:12 -04:00
Ethan Frey 6135345af8 Add issuer position to grant credit 2017-07-27 16:36:47 -04:00
Ethan Frey b7f31ad70a Test sendtx with foreign addr creates proper ibc packet 2017-07-27 16:36:15 -04:00
Ethan Frey aad5a0f3a0 Test query ibc status and fix bugs 2017-07-27 16:30:20 -04:00
Ethan Frey de537c34ac Add cli support for register/update ibc 2017-07-27 16:27:06 -04:00
Ethan Frey 746ae28eaa Add ibc query commands 2017-07-27 16:27:06 -04:00
Ethan Frey 374f078b79 IBC test just rawtx, coin ibc in that module 2017-07-27 16:27:06 -04:00
Ethan Frey a925c8545c Refactored ibc test packet gen 2017-07-27 16:27:06 -04:00
Ethan Frey 0c5f0bdf77 Test outgoing ibc packets add to the chain credit properly 2017-07-27 16:27:06 -04:00
Ethan Frey 555e0d8ec8 test receiving and verifying incoming ibc packets 2017-07-27 16:26:00 -04:00
Ethan Frey 06492fa212 testing ibc post packet 2017-07-27 16:25:05 -04:00
Ethan Frey 9b099a2f36 Fix up ibc to work with new cli reorg 2017-07-27 16:25:05 -04:00
Ethan Frey 8659c4db68 Cleanup ibc handler per bucky 2017-07-27 16:25:05 -04:00
Ethan Frey 272a65a2c7 Add tests for creating packets 2017-07-27 16:25:05 -04:00
Ethan Frey 883b983611 Test ibc header updates with dynamic sets 2017-07-27 16:25:05 -04:00
Ethan Frey 3ddcf91303 Test ibc registration permissions 2017-07-27 16:25:04 -04:00
Ethan Frey f1c9697720 First ibc registration tests 2017-07-27 16:25:04 -04:00
Ethan Frey 5da2b75fa0 Clean up ibc PostPacket handling 2017-07-27 16:25:04 -04:00