Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Show EventType in CLI responses #41

Merged
merged 1 commit into from
Jul 10, 2018

Conversation

knkski
Copy link
Contributor

@knkski knkski commented Jul 3, 2018

Fixes STL-699. Go was ignoring the event_type JSON field due to the snake cased-name. This PR adds a struct tag that makes Go associate the EventType struct field with the event_type JSON field.

Signed-off-by: Kenneth Koski knkski@bitwise.io

@knkski
Copy link
Contributor Author

knkski commented Jul 3, 2018

Steps to reproduce (taken from Getting Started documentation):

#!/usr/bin/env bash

set -eux

function run() {
    docker exec -it seth-cli bash -c "$@"
}

run "openssl ecparam -genkey -name secp256k1 | openssl ec -out key-file.pem"
run "seth account import key-file.pem myalias"
run "seth account create --nonce=0 --wait myalias"
run "seth contract create --wait myalias 6060604052341561000f57600080fd5b6102108061001e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631ab06ee514610067578063812600df146100935780639507d39a146100b6578063c20efb90146100ed575b600080fd5b341561007257600080fd5b6100916004808035906020019091908035906020019091905050610110565b005b341561009e57600080fd5b6100b4600480803590602001909190505061016a565b005b34156100c157600080fd5b6100d76004808035906020019091905050610199565b6040518082815260200191505060405180910390f35b34156100f857600080fd5b61010e60048080359060200190919050506101b5565b005b80600080848152602001908152602001600020819055507f545b620a3000f6303b158b321f06b4e95e28a27d70aecac8c6bdac4f48a9f6b38282604051808381526020018281526020019250505060405180910390a15050565b600160008083815260200190815260200160002054016000808381526020019081526020016000208190555050565b6000806000838152602001908152602001600020549050919050565b6001600080838152602001908152602001600020540360008083815260200190815260200160002081905550505600a165627a7a7230582034e2a271c9cc73ba9a4d0763f9879aabec59ec08363fd5a2d5868c3459afcba60029"

ADDRESS=$(run "seth contract list myalias | tail -n +2 | cut -d' ' -f 2 | tr -d ' \t\n\r\f'")
run "seth contract call --wait myalias ${ADDRESS} 1ab06ee50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a"

Fixes STL-699. Go was ignoring the `event_type` JSON field due to the
snake cased-name. This PR adds a struct tag that makes Go associate the
`EventType` struct field with the `event_type` JSON field.

Signed-off-by: Kenneth Koski <knkski@bitwise.io>
@dplumb94 dplumb94 merged commit 6173ece into hyperledger-archives:master Jul 10, 2018
@knkski knkski deleted the fix-stl-699 branch July 10, 2018 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants