tendermint / light-client

DEPRECATED: A light client for tendermint, supporting signatures, proofs, and validation (see github.com/tendermint/tendermint/lite)
Other
17 stars 9 forks source link

Ripped out tx style into helper fx, look at demo.go as an example #31

Closed ethanfrey closed 7 years ago

ethanfrey commented 7 years ago

Yeah, let's clean this up a bit, and I will post the basecoin tx nonsense to this format

ethanfrey commented 7 years ago

Addresses issue #22

ethanfrey commented 7 years ago

something like this...

# tmcli tx demo --age 13 --user john
ERROR: Sorry, dude, you're too young to blockchain!
# tmcli tx demo --age 20 --user john
{
  "check_tx": {
    "code": 102,
    "data": "",
    "log": "Error (base) encoding error;Error decoding tx: EOF"
  },
  "deliver_tx": {
    "code": 0,
    "data": "",
    "log": ""
  },
  "hash": "A610D9CAF21B5D660F5879C37FE5F579969D40A4",
  "height": 0
}

or with json input file:

# echo '{ "user": "bill", "age": 11}' > tx.json
# tmcli tx demo --input tx.json
ERROR: Sorry, dude, you're too young to blockchain!

#echo '{ "user": "bill", "age": 22}' > tx.json
# tmcli tx demo --input tx.json
{
  "check_tx": {
    "code": 102,
    "data": "",
    "log": "Error (base) encoding error;Error decoding tx: EOF"
  },
  "deliver_tx": {
    "code": 0,
    "data": "",
    "log": ""
  },
  "hash": "07793FAFBEBF89F784DA14BB01122423FC7C3287",
  "height": 0
}

And left to the reader... verify that the returned tx hash for tmcli tx demo --age 22 --user bill is the same as from the json version...

Of course, I was pushing garbage to the testnet... but it proves the code doesn't panic and actually posted binary data to the testnet.