From fe5cfe5f4a73fa39c6b85ec7935814b0440346e5 Mon Sep 17 00:00:00 2001 From: noot Date: Wed, 4 Mar 2020 18:11:24 -0500 Subject: [PATCH 01/31] add some comments --- x/evm/types/statedb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index d58e89c83..7646be2fc 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -289,6 +289,10 @@ func (csdb *CommitStateDB) GetCommittedState(addr ethcmn.Address, hash ethcmn.Ha // GetLogs returns the current logs for a given hash in the state. func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) []*ethtypes.Log { + // TODO: if logs aren't in the cache, then reconstruct the logs + + // question: how to get transaction details and what block it was included in from the hash? assuming the input is a tx hash + return csdb.logs[hash] } From d00e3c65954d75262a89a27941390b104d4ea822 Mon Sep 17 00:00:00 2001 From: noot Date: Mon, 9 Mar 2020 11:59:24 -0400 Subject: [PATCH 02/31] begin log handler test --- x/evm/handler.go | 17 ++++++---- x/evm/handler_test.go | 60 +++++++++++++++++++++++++++++++++ x/evm/keeper.go | 1 + x/evm/types/state_transition.go | 11 +++--- 4 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 x/evm/handler_test.go diff --git a/x/evm/handler.go b/x/evm/handler.go index f521324c5..318d9e3a1 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -18,10 +18,10 @@ import ( func NewHandler(keeper Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) sdk.Result { switch msg := msg.(type) { - case types.EthereumTxMsg: + case *types.EthereumTxMsg: return handleETHTxMsg(ctx, keeper, msg) case *types.EmintMsg: - return handleEmintMsg(ctx, keeper, *msg) + return handleEmintMsg(ctx, keeper, msg) default: errMsg := fmt.Sprintf("Unrecognized ethermint Msg type: %v", msg.Type()) return sdk.ErrUnknownRequest(errMsg).Result() @@ -30,7 +30,7 @@ func NewHandler(keeper Keeper) sdk.Handler { } // Handle an Ethereum specific tx -func handleETHTxMsg(ctx sdk.Context, keeper Keeper, msg types.EthereumTxMsg) sdk.Result { +func handleETHTxMsg(ctx sdk.Context, keeper Keeper, msg *types.EthereumTxMsg) sdk.Result { if err := msg.ValidateBasic(); err != nil { return err.Result() } @@ -56,6 +56,10 @@ func handleETHTxMsg(ctx sdk.Context, keeper Keeper, msg types.EthereumTxMsg) sdk txHash := tm.Tx(txBytes).Hash() ethHash := common.BytesToHash(txHash) + if keeper.csdb == nil { + panic("keeper.csdb is nil") + } + st := types.StateTransition{ Sender: sender, AccountNonce: msg.Data.AccountNonce, @@ -73,14 +77,15 @@ func handleETHTxMsg(ctx sdk.Context, keeper Keeper, msg types.EthereumTxMsg) sdk keeper.csdb.Prepare(ethHash, common.Hash{}, keeper.txCount.get()) keeper.txCount.increment() - bloom, res := st.TransitionCSDB(ctx) + logs, bloom, res := st.TransitionCSDB(ctx) if res.IsOK() { keeper.bloom.Or(keeper.bloom, bloom) + keeper.logs = logs } return res } -func handleEmintMsg(ctx sdk.Context, keeper Keeper, msg types.EmintMsg) sdk.Result { +func handleEmintMsg(ctx sdk.Context, keeper Keeper, msg *types.EmintMsg) sdk.Result { if err := msg.ValidateBasic(); err != nil { return err.Result() } @@ -112,6 +117,6 @@ func handleEmintMsg(ctx sdk.Context, keeper Keeper, msg types.EmintMsg) sdk.Resu keeper.csdb.Prepare(common.Hash{}, common.Hash{}, keeper.txCount.get()) // Cannot provide tx hash keeper.txCount.increment() - _, res := st.TransitionCSDB(ctx) + _, _, res := st.TransitionCSDB(ctx) return res } diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go new file mode 100644 index 000000000..97f3091d6 --- /dev/null +++ b/x/evm/handler_test.go @@ -0,0 +1,60 @@ +package evm + +import ( + "math/big" + "testing" + + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/x/auth" + "github.com/cosmos/cosmos-sdk/x/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/ethermint/crypto" + "github.com/cosmos/ethermint/x/evm/types" + eminttypes "github.com/cosmos/ethermint/types" + ethcmn "github.com/ethereum/go-ethereum/common" + abci "github.com/tendermint/tendermint/abci/types" + dbm "github.com/tendermint/tm-db" +) + +func TestHandler_Logs(t *testing.T) { + // create logger, codec and root multi-store + cdc := newTestCodec() + + // The ParamsKeeper handles parameter storage for the application + keyParams := sdk.NewKVStoreKey(params.StoreKey) + tkeyParams := sdk.NewTransientStoreKey(params.TStoreKey) + paramsKeeper := params.NewKeeper(cdc, keyParams, tkeyParams, params.DefaultCodespace) + // Set specific supspaces + authSubspace := paramsKeeper.Subspace(auth.DefaultParamspace) + ak := auth.NewAccountKeeper(cdc, accKey, authSubspace, eminttypes.ProtoBaseAccount) + ek := NewKeeper(ak, storageKey, codeKey, blockKey, cdc) + + gasLimit := uint64(100000) + gasPrice := big.NewInt(1000000) + address := ethcmn.BytesToAddress([]byte{0}) + + priv1, _ := crypto.GenerateKey() + + tx := types.NewEthereumTxMsg(1, &address, big.NewInt(0), gasLimit, gasPrice, []byte{}) + tx.Sign(big.NewInt(1), priv1.ToECDSA()) + + db := dbm.NewMemDB() + cms := store.NewCommitMultiStore(db) + // mount stores + keys := []*sdk.KVStoreKey{accKey, storageKey, codeKey, blockKey} + for _, key := range keys { + cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, nil) + } + + err := cms.LoadLatestVersion() + if err != nil { + t.Fatal(err) + } + + ms := cms.CacheMultiStore() + ctx := sdk.NewContext(ms, abci.Header{}, false, logger) + ctx = ctx.WithBlockHeight(1).WithChainID("1") + + result := handleETHTxMsg(ctx, ek, tx) + t.Log(result) +} \ No newline at end of file diff --git a/x/evm/keeper.go b/x/evm/keeper.go index 1b964d2ac..dfba29d48 100644 --- a/x/evm/keeper.go +++ b/x/evm/keeper.go @@ -25,6 +25,7 @@ type Keeper struct { blockKey sdk.StoreKey txCount *count bloom *big.Int + logs []*ethtypes.Log } type count int diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index 79047f1f3..d2fa9ac5d 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -28,13 +28,13 @@ type StateTransition struct { } // TransitionCSDB performs an evm state transition from a transaction -func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*big.Int, sdk.Result) { +func (st StateTransition) TransitionCSDB(ctx sdk.Context) ([]*ethtypes.Log , *big.Int, sdk.Result) { contractCreation := st.Recipient == nil cost, err := core.IntrinsicGas(st.Payload, contractCreation, true) if err != nil { - return nil, sdk.ErrOutOfGas("invalid intrinsic gas for transaction").Result() + return nil, nil, sdk.ErrOutOfGas("invalid intrinsic gas for transaction").Result() } // This gas limit the the transaction gas limit with intrinsic gas subtracted @@ -106,8 +106,9 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*big.Int, sdk.Result) // Generate bloom filter to be saved in tx receipt data bloomInt := big.NewInt(0) var bloomFilter ethtypes.Bloom + var logs []*ethtypes.Log if st.THash != nil && !st.Simulate { - logs := csdb.GetLogs(*st.THash) + logs = csdb.GetLogs(*st.THash) bloomInt = ethtypes.LogsBloom(logs) bloomFilter = ethtypes.BytesToBloom(bloomInt.Bytes()) } @@ -124,7 +125,7 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*big.Int, sdk.Result) res.Data = returnData // Consume gas before returning ctx.GasMeter().ConsumeGas(gasLimit-leftOverGas, "EVM execution consumption") - return nil, res + return nil, nil, res } // TODO: Refund unused gas here, if intended in future @@ -138,5 +139,5 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*big.Int, sdk.Result) // Out of gas check does not need to be done here since it is done within the EVM execution ctx.WithGasMeter(currentGasMeter).GasMeter().ConsumeGas(gasLimit-leftOverGas, "EVM execution consumption") - return bloomInt, sdk.Result{Data: returnData, GasUsed: st.GasLimit - leftOverGas} + return logs, bloomInt, sdk.Result{Data: returnData, GasUsed: st.GasLimit - leftOverGas} } From 496edc25d0ac5757c1b7e177e491ed238127f4ab Mon Sep 17 00:00:00 2001 From: noot Date: Wed, 11 Mar 2020 12:30:01 -0400 Subject: [PATCH 03/31] update TransitionCSDB to return ReturnData --- utils/utils.go | 25 +++++++++++++ x/evm/handler.go | 14 ++++---- x/evm/handler_test.go | 43 +++++++++++++++++----- x/evm/keeper.go | 10 +++++- x/evm/types/msg_encoding.go | 2 +- x/evm/types/state_transition.go | 25 +++++++++---- x/evm/types/utils.go | 64 ++++++++++++++++++++++++++++++--- 7 files changed, 155 insertions(+), 28 deletions(-) create mode 100644 utils/utils.go diff --git a/utils/utils.go b/utils/utils.go new file mode 100644 index 000000000..d70c8af0b --- /dev/null +++ b/utils/utils.go @@ -0,0 +1,25 @@ +package utils + +import ( + "encoding/hex" + "errors" + "strings" +) + +// HexToBytes turns a 0x prefixed hex string into a byte slice +func HexToBytes(in string) ([]byte, error) { + if len(in) < 2 { + return nil, errors.New("invalid string") + } + + if strings.Compare(in[:2], "0x") != 0 { + return nil, errors.New("could not byteify non 0x prefixed string") + } + // Ensure we have an even length, otherwise hex.DecodeString will fail and return zero hash + if len(in)%2 != 0 { + return nil, errors.New("cannot decode a odd length string") + } + in = in[2:] + out, err := hex.DecodeString(in) + return out, err +} diff --git a/x/evm/handler.go b/x/evm/handler.go index 318d9e3a1..ca3cc0ccf 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -77,12 +77,12 @@ func handleETHTxMsg(ctx sdk.Context, keeper Keeper, msg *types.EthereumTxMsg) sd keeper.csdb.Prepare(ethHash, common.Hash{}, keeper.txCount.get()) keeper.txCount.increment() - logs, bloom, res := st.TransitionCSDB(ctx) - if res.IsOK() { - keeper.bloom.Or(keeper.bloom, bloom) - keeper.logs = logs + returnData := st.TransitionCSDB(ctx) + if returnData.Result.IsOK() { + keeper.bloom.Or(keeper.bloom, returnData.Bloom) + keeper.logs = returnData.Logs } - return res + return returnData.Result } func handleEmintMsg(ctx sdk.Context, keeper Keeper, msg *types.EmintMsg) sdk.Result { @@ -117,6 +117,6 @@ func handleEmintMsg(ctx sdk.Context, keeper Keeper, msg *types.EmintMsg) sdk.Res keeper.csdb.Prepare(common.Hash{}, common.Hash{}, keeper.txCount.get()) // Cannot provide tx hash keeper.txCount.increment() - _, _, res := st.TransitionCSDB(ctx) - return res + returnData := st.TransitionCSDB(ctx) + return returnData.Result } diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 97f3091d6..a83a423d4 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -5,17 +5,35 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/params" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ethermint/crypto" + eminttypes "github.com/cosmos/ethermint/types" + "github.com/cosmos/ethermint/utils" "github.com/cosmos/ethermint/x/evm/types" - eminttypes "github.com/cosmos/ethermint/types" - ethcmn "github.com/ethereum/go-ethereum/common" + //ethcmn "github.com/ethereum/go-ethereum/common" abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" ) +// pragma solidity ^0.5.1; + +// contract Test { +// event Hello(uint256 indexed world); + +// constructor() public { +// emit Hello(17); +// } +// } + +// { +// "linkReferences": {}, +// "object": "6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029", +// "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x11 PUSH32 0x775A94827B8FD9B519D36CD827093C664F93347070A554F65E4A6F56CD738898 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x35 DUP1 PUSH1 0x4B PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH13 0xAB665F0F557620554BB45ADF26 PUSH8 0x8D2BD349B8A4314 0xbd SELFDESTRUCT KECCAK256 0x5e 0xe8 DIFFICULTY 0xe EXTCODECOPY 0x24 STOP 0x29 ", +// "sourceMap": "25:119:0:-;;;90:52;8:9:-1;5:2;;;30:1;27;20:12;5:2;90:52:0;132:2;126:9;;;;;;;;;;25:119;;;;;;" +// } + func TestHandler_Logs(t *testing.T) { // create logger, codec and root multi-store cdc := newTestCodec() @@ -31,11 +49,16 @@ func TestHandler_Logs(t *testing.T) { gasLimit := uint64(100000) gasPrice := big.NewInt(1000000) - address := ethcmn.BytesToAddress([]byte{0}) + //address := ethcmn.BytesToAddress([]byte{0}) priv1, _ := crypto.GenerateKey() - tx := types.NewEthereumTxMsg(1, &address, big.NewInt(0), gasLimit, gasPrice, []byte{}) + bytecode, err := utils.HexToBytes("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029") + if err != nil { + t.Fatal(err) + } + + tx := types.NewEthereumTxMsg(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode) tx.Sign(big.NewInt(1), priv1.ToECDSA()) db := dbm.NewMemDB() @@ -46,15 +69,17 @@ func TestHandler_Logs(t *testing.T) { cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, nil) } - err := cms.LoadLatestVersion() + err = cms.LoadLatestVersion() if err != nil { t.Fatal(err) } - + ms := cms.CacheMultiStore() ctx := sdk.NewContext(ms, abci.Header{}, false, logger) ctx = ctx.WithBlockHeight(1).WithChainID("1") result := handleETHTxMsg(ctx, ek, tx) - t.Log(result) -} \ No newline at end of file + t.Log(result.Data) + t.Log(ek.bloom) + t.Log(ek.logs) +} diff --git a/x/evm/keeper.go b/x/evm/keeper.go index dfba29d48..1f80af7a4 100644 --- a/x/evm/keeper.go +++ b/x/evm/keeper.go @@ -25,7 +25,7 @@ type Keeper struct { blockKey sdk.StoreKey txCount *count bloom *big.Int - logs []*ethtypes.Log + logs []*ethtypes.Log } type count int @@ -103,6 +103,14 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) ethtypes.Bl return ethtypes.BytesToBloom(bloom) } +func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log) { + +} + +func (k *Keeper) GetBlockLogs(ctx sdk.Context) []*ethtypes.Log { + return nil +} + // ---------------------------------------------------------------------------- // Genesis // ---------------------------------------------------------------------------- diff --git a/x/evm/types/msg_encoding.go b/x/evm/types/msg_encoding.go index 5e62e4344..7fb83b7cb 100644 --- a/x/evm/types/msg_encoding.go +++ b/x/evm/types/msg_encoding.go @@ -47,7 +47,7 @@ func unmarshalAmino(td *EncodableTxData, text string) (err error) { } // MarshalAmino defines custom encoding scheme for TxData -func (td TxData) MarshalAmino() (string, error) { +func (td *TxData) MarshalAmino() (string, error) { e := EncodableTxData{ AccountNonce: td.AccountNonce, Price: utils.MarshalBigInt(td.Price), diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index d2fa9ac5d..3cafdd981 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -27,14 +27,23 @@ type StateTransition struct { Simulate bool } +// ReturnData represents what's returned from a transition +type ReturnData struct { + Logs []*ethtypes.Log + Bloom *big.Int + Result sdk.Result +} + // TransitionCSDB performs an evm state transition from a transaction -func (st StateTransition) TransitionCSDB(ctx sdk.Context) ([]*ethtypes.Log , *big.Int, sdk.Result) { +func (st StateTransition) TransitionCSDB(ctx sdk.Context) *ReturnData { + returnData := new(ReturnData) contractCreation := st.Recipient == nil cost, err := core.IntrinsicGas(st.Payload, contractCreation, true) if err != nil { - return nil, nil, sdk.ErrOutOfGas("invalid intrinsic gas for transaction").Result() + returnData.Result = sdk.ErrOutOfGas("invalid intrinsic gas for transaction").Result() + return returnData } // This gas limit the the transaction gas limit with intrinsic gas subtracted @@ -114,7 +123,7 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) ([]*ethtypes.Log , *bi } // Encode all necessary data into slice of bytes to return in sdk result - returnData := EncodeReturnData(addr, bloomFilter, ret) + resultData := EncodeResultData(addr, bloomFilter, logs, ret) // handle errors if vmerr != nil { @@ -122,10 +131,11 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) ([]*ethtypes.Log , *bi if vmerr == vm.ErrOutOfGas || vmerr == vm.ErrCodeStoreOutOfGas { res = sdk.ErrOutOfGas("EVM execution went out of gas").Result() } - res.Data = returnData + res.Data = resultData // Consume gas before returning ctx.GasMeter().ConsumeGas(gasLimit-leftOverGas, "EVM execution consumption") - return nil, nil, res + returnData.Result = res + return returnData } // TODO: Refund unused gas here, if intended in future @@ -139,5 +149,8 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) ([]*ethtypes.Log , *bi // Out of gas check does not need to be done here since it is done within the EVM execution ctx.WithGasMeter(currentGasMeter).GasMeter().ConsumeGas(gasLimit-leftOverGas, "EVM execution consumption") - return logs, bloomInt, sdk.Result{Data: returnData, GasUsed: st.GasLimit - leftOverGas} + returnData.Logs = logs + returnData.Bloom = bloomInt + returnData.Result = sdk.Result{Data: resultData, GasUsed: st.GasLimit - leftOverGas} + return returnData } diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index ab3822a1c..35c1fba5f 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -15,7 +15,7 @@ import ( const ( bloomIdx = ethcmn.AddressLength - returnIdx = bloomIdx + ethtypes.BloomByteLength + returnIdx = bloomIdx + ethtypes.BloomByteLength + 1 ) // GenerateEthAddress generates an Ethereum address. @@ -52,19 +52,27 @@ func rlpHash(x interface{}) (hash ethcmn.Hash) { return hash } +type ResultData struct { + addr ethcmn.Address + bloom ethtypes.Bloom + logs []*ethtypes.Log + ret []byte +} + // EncodeReturnData takes all of the necessary data from the EVM execution // and returns the data as a byte slice -func EncodeReturnData(addr ethcmn.Address, bloom ethtypes.Bloom, evmRet []byte) []byte { +func EncodeResultData(addr ethcmn.Address, bloom ethtypes.Bloom, logs []*ethtypes.Log, evmRet []byte) []byte { // Append address, bloom, evm return bytes in that order returnData := append(addr.Bytes(), bloom.Bytes()...) + returnData = append(returnData, byte(len(logs))) return append(returnData, evmRet...) } // DecodeReturnData decodes the byte slice of values to their respective types -func DecodeReturnData(bytes []byte) (addr ethcmn.Address, bloom ethtypes.Bloom, ret []byte, err error) { +func DecodeResultData(bytes []byte) (addr ethcmn.Address, bloom ethtypes.Bloom, ret []byte, err error) { if len(bytes) >= returnIdx { addr = ethcmn.BytesToAddress(bytes[:bloomIdx]) - bloom = ethtypes.BytesToBloom(bytes[bloomIdx:returnIdx]) + bloom = ethtypes.BytesToBloom(bytes[bloomIdx : bloomIdx+ethtypes.BloomByteLength]) ret = bytes[returnIdx:] } else { err = fmt.Errorf("Invalid format for encoded data, message must be an EVM state transition") @@ -72,3 +80,51 @@ func DecodeReturnData(bytes []byte) (addr ethcmn.Address, bloom ethtypes.Bloom, return } + +// func decodeResultData(r io.Reader) (ethcmn.Address, ethtypes.Bloom, []*ethtypes.Log, []byte, error) { +// addr := make([]byte, ethcmn.AddressLength) +// n, err := r.Read(addr) +// if err != nil { +// return nil, nil, nil, nil, err +// } else if n != ethcmn.AddressLength { +// return nil, nil, nil, nil, fmt.Errorf("could not read address") +// } + +// bloom := make([]byte, ethtypes.BloomByteLength) +// n, err = r.Read(bloom) +// if err != nil { +// return nil, nil, nil, nil, err +// } else if n != ethcmn.BloomByteLength { +// return nil, nil, nil, nil, fmt.Errorf("could not read bloom") +// } + +// logLen := make([]byte, 1) +// n, err = r.Read(logLen) +// if err != nil { +// return nil, nil, nil, nil, err +// } + +// topics := [][]byte{} + +// for i := range logLen[0] { +// topic := make([]byte, 32) +// n, err = r.Read(topic) +// if err != nil { +// return nil, nil, nil, nil, err +// } + +// topics = append(topics, topic) +// } + +// evmRet := []byte{} +// for { +// buf := make([]byte, 1) +// n, err = r.Read(topic) +// if err != nil || n == 0 { +// break +// } +// evmRet = append(evmRet, buf[0]) +// } + +// return +// } From 57eaae23f716061265920c8730c7c0654cf76d28 Mon Sep 17 00:00:00 2001 From: noot Date: Wed, 11 Mar 2020 12:36:42 -0400 Subject: [PATCH 04/31] use rlp for result data encode/decode --- x/evm/types/state_transition.go | 12 +++++- x/evm/types/utils.go | 69 +++------------------------------ 2 files changed, 17 insertions(+), 64 deletions(-) diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index 3cafdd981..c48402eaa 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -123,7 +123,17 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) *ReturnData { } // Encode all necessary data into slice of bytes to return in sdk result - resultData := EncodeResultData(addr, bloomFilter, logs, ret) + res := &ResultData{ + addr: addr, + bloom: bloomFilter, + logs: logs, + ret: ret, + } + resultData, err := EncodeResultData(res) + if err != nil { + //returnData.Result = sdk.Err() + return returnData + } // handle errors if vmerr != nil { diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 35c1fba5f..749498152 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -61,70 +61,13 @@ type ResultData struct { // EncodeReturnData takes all of the necessary data from the EVM execution // and returns the data as a byte slice -func EncodeResultData(addr ethcmn.Address, bloom ethtypes.Bloom, logs []*ethtypes.Log, evmRet []byte) []byte { - // Append address, bloom, evm return bytes in that order - returnData := append(addr.Bytes(), bloom.Bytes()...) - returnData = append(returnData, byte(len(logs))) - return append(returnData, evmRet...) +func EncodeResultData(data *ResultData) ([]byte, error) { + return rlp.EncodeToBytes(data) } // DecodeReturnData decodes the byte slice of values to their respective types -func DecodeResultData(bytes []byte) (addr ethcmn.Address, bloom ethtypes.Bloom, ret []byte, err error) { - if len(bytes) >= returnIdx { - addr = ethcmn.BytesToAddress(bytes[:bloomIdx]) - bloom = ethtypes.BytesToBloom(bytes[bloomIdx : bloomIdx+ethtypes.BloomByteLength]) - ret = bytes[returnIdx:] - } else { - err = fmt.Errorf("Invalid format for encoded data, message must be an EVM state transition") - } - - return +func DecodeResultData(in []byte) (*ResultData, error) { + data := new(ResultData) + err := rlp.DecodeBytes(in, data) + return data, err } - -// func decodeResultData(r io.Reader) (ethcmn.Address, ethtypes.Bloom, []*ethtypes.Log, []byte, error) { -// addr := make([]byte, ethcmn.AddressLength) -// n, err := r.Read(addr) -// if err != nil { -// return nil, nil, nil, nil, err -// } else if n != ethcmn.AddressLength { -// return nil, nil, nil, nil, fmt.Errorf("could not read address") -// } - -// bloom := make([]byte, ethtypes.BloomByteLength) -// n, err = r.Read(bloom) -// if err != nil { -// return nil, nil, nil, nil, err -// } else if n != ethcmn.BloomByteLength { -// return nil, nil, nil, nil, fmt.Errorf("could not read bloom") -// } - -// logLen := make([]byte, 1) -// n, err = r.Read(logLen) -// if err != nil { -// return nil, nil, nil, nil, err -// } - -// topics := [][]byte{} - -// for i := range logLen[0] { -// topic := make([]byte, 32) -// n, err = r.Read(topic) -// if err != nil { -// return nil, nil, nil, nil, err -// } - -// topics = append(topics, topic) -// } - -// evmRet := []byte{} -// for { -// buf := make([]byte, 1) -// n, err = r.Read(topic) -// if err != nil || n == 0 { -// break -// } -// evmRet = append(evmRet, buf[0]) -// } - -// return -// } From beaccb4bcb2eabe4148243ac3bd1e1aa8357c7b1 Mon Sep 17 00:00:00 2001 From: noot Date: Wed, 11 Mar 2020 12:50:33 -0400 Subject: [PATCH 05/31] update tests --- rpc/eth_api.go | 15 +++++++++------ x/evm/handler_test.go | 3 ++- x/evm/keeper.go | 2 ++ x/evm/types/state_transition.go | 9 +++++---- x/evm/types/utils.go | 9 +++++---- x/evm/types/utils_test.go | 24 +++++++++++++++++++----- 6 files changed, 42 insertions(+), 20 deletions(-) diff --git a/rpc/eth_api.go b/rpc/eth_api.go index 95ac3438e..781f0d79f 100644 --- a/rpc/eth_api.go +++ b/rpc/eth_api.go @@ -352,9 +352,9 @@ func (e *PublicEthAPI) Call(args CallArgs, blockNr rpc.BlockNumber, overrides *m return []byte{}, err } - _, _, ret, err := types.DecodeReturnData(result.Data) + data, err := types.DecodeResultData(result.Data) - return (hexutil.Bytes)(ret), err + return (hexutil.Bytes)(data.Ret), err } // account indicates the overriding fields of account during the execution of @@ -727,7 +727,10 @@ func (e *PublicEthAPI) GetTransactionReceipt(hash common.Hash) (map[string]inter e.cliCtx.Codec.MustUnmarshalJSON(res, &logs) txData := tx.TxResult.GetData() - contractAddress, bloomFilter, _, _ := types.DecodeReturnData(txData) + data, err := types.DecodeResultData(txData) + if err != nil { + return nil, err + } fields := map[string]interface{}{ "blockHash": blockHash, @@ -740,12 +743,12 @@ func (e *PublicEthAPI) GetTransactionReceipt(hash common.Hash) (map[string]inter "cumulativeGasUsed": nil, // ignore until needed "contractAddress": nil, "logs": logs.Logs, - "logsBloom": bloomFilter, + "logsBloom": data.Bloom, "status": status, } - if contractAddress != (common.Address{}) { - fields["contractAddress"] = contractAddress + if data.Address != (common.Address{}) { + fields["contractAddress"] = data.Address } return fields, nil diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index a83a423d4..6e3c9ff72 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -49,7 +49,6 @@ func TestHandler_Logs(t *testing.T) { gasLimit := uint64(100000) gasPrice := big.NewInt(1000000) - //address := ethcmn.BytesToAddress([]byte{0}) priv1, _ := crypto.GenerateKey() @@ -82,4 +81,6 @@ func TestHandler_Logs(t *testing.T) { t.Log(result.Data) t.Log(ek.bloom) t.Log(ek.logs) + + // TODO: assert that we can set/get logs from the keeper } diff --git a/x/evm/keeper.go b/x/evm/keeper.go index 1f80af7a4..b7c427f61 100644 --- a/x/evm/keeper.go +++ b/x/evm/keeper.go @@ -103,10 +103,12 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) ethtypes.Bl return ethtypes.BytesToBloom(bloom) } +// SetBlockLogs sets the block's logs in the KVStore func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log) { } +// GetBlockLogs gets the logs for a block from the KVStore func (k *Keeper) GetBlockLogs(ctx sdk.Context) []*ethtypes.Log { return nil } diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index c48402eaa..536a5f706 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -124,13 +124,14 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) *ReturnData { // Encode all necessary data into slice of bytes to return in sdk result res := &ResultData{ - addr: addr, - bloom: bloomFilter, - logs: logs, - ret: ret, + Address: addr, + Bloom: bloomFilter, + Logs: logs, + Ret: ret, } resultData, err := EncodeResultData(res) if err != nil { + // TODO: where are the ethermint error types? //returnData.Result = sdk.Err() return returnData } diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 749498152..43a3cc0ae 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -52,11 +52,12 @@ func rlpHash(x interface{}) (hash ethcmn.Hash) { return hash } +// ResultData represents the data returned in an comsos-sdk/types.Result type ResultData struct { - addr ethcmn.Address - bloom ethtypes.Bloom - logs []*ethtypes.Log - ret []byte + Address ethcmn.Address + Bloom ethtypes.Bloom + Logs []*ethtypes.Log + Ret []byte } // EncodeReturnData takes all of the necessary data from the EVM execution diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index 9611963a4..e71d1b3ab 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -13,12 +13,26 @@ func TestEvmDataEncoding(t *testing.T) { bloom := ethtypes.BytesToBloom([]byte{0x1, 0x3}) ret := []byte{0x5, 0x8} - encoded := EncodeReturnData(addr, bloom, ret) + data := &ResultData{ + Address: addr, + Bloom: bloom, + Logs: []*ethtypes.Log{}, + Ret: ret, + } - decAddr, decBloom, decRet, err := DecodeReturnData(encoded) + enc, err := EncodeResultData(data) + if err != nil { + t.Fatal(err) + } + + res, err := DecodeResultData(enc) + if err != nil { + t.Fatal(err) + } require.NoError(t, err) - require.Equal(t, addr, decAddr) - require.Equal(t, bloom, decBloom) - require.Equal(t, ret, decRet) + require.Equal(t, addr, res.Address) + require.Equal(t, bloom, res.Bloom) + require.Equal(t, data.Logs, res.Logs) + require.Equal(t, ret, res.Ret) } From b4df9f9cf876a6bf48d8e526b990d95a3911d7db Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 11:19:54 -0400 Subject: [PATCH 06/31] implement SetBlockLogs --- x/evm/handler.go | 2 +- x/evm/keeper/keeper.go | 19 ++++++++++++++++--- x/evm/types/utils.go | 10 ++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/x/evm/handler.go b/x/evm/handler.go index 5f074843b..f776c2943 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -80,7 +80,7 @@ func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Res returnData := st.TransitionCSDB(ctx) if returnData.Result.IsOK() { k.Bloom.Or(k.Bloom, returnData.Bloom) - k.CurrentLogs = returnData.Logs + k.CurrentLogs = append(k.CurrentLogs, returnData.Logs...) } return returnData.Result diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 15f918987..6cad5155b 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "bytes" + "errors" "fmt" "github.com/cosmos/cosmos-sdk/codec" @@ -108,13 +109,25 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) ethtypes.Bl } // SetBlockLogs sets the block's logs in the KVStore -func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log) { +func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, height int64) error { + store := ctx.KVStore(k.storeKey) + heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) + if len(heightHash) == 0 { + return errors.New("cannot set block logs") + } + encLogs, err := types.EncodeLogs(logs) + if err != nil { + return err + } + store.Set(heightHash, encLogs) + + return nil } // GetBlockLogs gets the logs for a block from the KVStore -func (k *Keeper) GetBlockLogs(ctx sdk.Context) []*ethtypes.Log { - return nil +func (k *Keeper) GetBlockLogs(ctx sdk.Context, height int64) ([]*ethtypes.Log, error) { + return nil, nil } // ---------------------------------------------------------------------------- diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 43a3cc0ae..deb6a5548 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -72,3 +72,13 @@ func DecodeResultData(in []byte) (*ResultData, error) { err := rlp.DecodeBytes(in, data) return data, err } + +func EncodeLogs(logs []*ethtypes.Log) ([]byte, error) { + return rlp.EncodeToBytes(logs) +} + +func DecodeLogs(in []byte) ([]*ethtypes.Log, error) { + logs := []*ethtypes.Log{} + err := rlp.DecodeBytes(in, logs) + return logs, err +} From 11d7addc892a715c54f67aabad2953adf5f9f040 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 13:33:55 -0400 Subject: [PATCH 07/31] implement GetBlockLogs --- x/evm/keeper/keeper.go | 41 +++++++++++++++++++++++++++++-------- x/evm/keeper/keeper_test.go | 6 +++++- x/evm/keeper/querier.go | 5 ++++- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 6cad5155b..1552404fd 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -88,24 +88,42 @@ func (k *Keeper) GetBlockHashMapping(ctx sdk.Context, hash []byte) (height int64 // May be removed when using only as module (only required by rpc api) // ---------------------------------------------------------------------------- +var bloomPrefix = []byte("bloom") +var logsPrefix = []byte("logs") + +func bloomKey(key []byte) []byte { + return append(bloomPrefix, key...) +} + +func logsKey(key []byte) []byte { + return append(logsPrefix, key...) +} + // SetBlockBloomMapping sets the mapping from block height to bloom bits -func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, height int64) { +func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, height int64) error { store := ctx.KVStore(k.storeKey) heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) - if !bytes.Equal(heightHash, []byte{}) { - store.Set(heightHash, bloom.Bytes()) + if bytes.Equal(heightHash, []byte{}) { + return fmt.Errorf("block with bloombits %s not found", bloom) } + store.Set(bloomKey(heightHash), bloom.Bytes()) + return nil } // GetBlockBloomMapping gets bloombits from block height -func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) ethtypes.Bloom { +func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) (ethtypes.Bloom, error) { store := ctx.KVStore(k.storeKey) heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) - bloom := store.Get(heightHash) if bytes.Equal(heightHash, []byte{}) { - panic(fmt.Errorf("block with bloombits %s not found", bloom)) + return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with height %d not found", height) } - return ethtypes.BytesToBloom(bloom) + + bloom := store.Get(bloomKey(heightHash)) + if bytes.Equal(bloom, []byte{}) { + return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with bloombits %s not found", bloom) + } + + return ethtypes.BytesToBloom(bloom), nil } // SetBlockLogs sets the block's logs in the KVStore @@ -127,7 +145,14 @@ func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, height int6 // GetBlockLogs gets the logs for a block from the KVStore func (k *Keeper) GetBlockLogs(ctx sdk.Context, height int64) ([]*ethtypes.Log, error) { - return nil, nil + store := ctx.KVStore(k.storeKey) + heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) + encLogs := store.Get(heightHash) + if len(encLogs) == 0 { + return nil, errors.New("cannot get block logs") + } + + return types.DecodeLogs(encLogs) } // ---------------------------------------------------------------------------- diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index f3eea05f5..206fea781 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -98,7 +98,11 @@ func TestDBStorage(t *testing.T) { require.Equal(t, ek.GetBlockHashMapping(ctx, ethcmn.FromHex("0x0d87a3a5f73140f46aac1bf419263e4e94e87c292f25007700ab7f2060e2af68")), int64(7)) require.Equal(t, ek.GetBlockHashMapping(ctx, []byte{0x43, 0x32}), int64(8)) - require.Equal(t, ek.GetBlockBloomMapping(ctx, 4), testBloom) + bloom, err := ek.GetBlockBloomMapping(ctx, 4) + if err != nil { + t.Fatal(err) + } + require.Equal(t, bloom, testBloom) // commit stateDB _, err = ek.Commit(ctx, false) diff --git a/x/evm/keeper/querier.go b/x/evm/keeper/querier.go index 1a77d5c32..865f3bb73 100644 --- a/x/evm/keeper/querier.go +++ b/x/evm/keeper/querier.go @@ -135,7 +135,10 @@ func queryBlockLogsBloom(ctx sdk.Context, path []string, keeper Keeper) ([]byte, panic("could not unmarshall block number: " + err.Error()) } - bloom := keeper.GetBlockBloomMapping(ctx, num) + bloom, err := keeper.GetBlockBloomMapping(ctx, num) + if err != nil { + panic("failed to get block bloom mapping: " + err.Error()) + } bRes := types.QueryBloomFilter{Bloom: bloom} res, err := codec.MarshalJSONIndent(keeper.cdc, bRes) From 5a6f4e12bdeffd91050698e24ec83c6525762011 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 13:48:42 -0400 Subject: [PATCH 08/31] test log set/get --- x/evm/handler.go | 1 - x/evm/handler_test.go | 30 +++++++++++++++++++++++------- x/evm/keeper/keeper.go | 7 +++---- x/evm/types/utils.go | 7 +------ 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/x/evm/handler.go b/x/evm/handler.go index f776c2943..be0dd25df 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -80,7 +80,6 @@ func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Res returnData := st.TransitionCSDB(ctx) if returnData.Result.IsOK() { k.Bloom.Or(k.Bloom, returnData.Bloom) - k.CurrentLogs = append(k.CurrentLogs, returnData.Logs...) } return returnData.Result diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 5c6ea819a..83d817481 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -2,6 +2,7 @@ package evm import ( "math/big" + "reflect" "testing" "github.com/cosmos/cosmos-sdk/codec" @@ -38,8 +39,6 @@ import ( // } var ( - address = ethcmn.HexToAddress("0x756F45E3FA69347A9A973A725E3C98bC4db0b4c1") - accKey = sdk.NewKVStoreKey("acc") storageKey = sdk.NewKVStoreKey(evmtypes.EvmStoreKey) codeKey = sdk.NewKVStoreKey(evmtypes.EvmCodeKey) @@ -88,7 +87,6 @@ func TestHandler_Logs(t *testing.T) { db := dbm.NewMemDB() cms := store.NewCommitMultiStore(db) - // mount stores keys := []*sdk.KVStoreKey{accKey, storageKey, codeKey, blockKey} for _, key := range keys { cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, nil) @@ -104,9 +102,27 @@ func TestHandler_Logs(t *testing.T) { ctx = ctx.WithBlockHeight(1).WithChainID("1") result := handleETHTxMsg(ctx, ek, tx) - t.Log(result.Data) - t.Log(ek.Bloom) - t.Log(ek.CurrentLogs) + resultData, err := evmtypes.DecodeResultData(result.Data) + if err != nil { + t.Fatal(err) + } + + if len(resultData.Logs) == 0 { + t.Fatal("Fail: expected 1 log") + } + + if len(resultData.Logs[0].Topics) != 2 { + t.Fatal("Fail: expected 2 topics") + } + + ek.SetBlockLogs(ctx, resultData.Logs, 1) - // TODO: assert that we can set/get logs from the keeper + logs, err := ek.GetBlockLogs(ctx, 1) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(logs, resultData.Logs) { + t.Fatalf("Fail: got %v expected %v", logs, resultData.Logs) + } } diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 1552404fd..1f292e318 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -29,7 +29,6 @@ type Keeper struct { CommitStateDB *types.CommitStateDB TxCount *count Bloom *big.Int - CurrentLogs []*ethtypes.Log } // TODO: move to types @@ -120,7 +119,7 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) (ethtypes.B bloom := store.Get(bloomKey(heightHash)) if bytes.Equal(bloom, []byte{}) { - return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with bloombits %s not found", bloom) + return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with bloombits %v not found", bloom) } return ethtypes.BytesToBloom(bloom), nil @@ -138,7 +137,7 @@ func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, height int6 if err != nil { return err } - store.Set(heightHash, encLogs) + store.Set(logsKey(heightHash), encLogs) return nil } @@ -147,7 +146,7 @@ func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, height int6 func (k *Keeper) GetBlockLogs(ctx sdk.Context, height int64) ([]*ethtypes.Log, error) { store := ctx.KVStore(k.storeKey) heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) - encLogs := store.Get(heightHash) + encLogs := store.Get(logsKey(heightHash)) if len(encLogs) == 0 { return nil, errors.New("cannot get block logs") } diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index deb6a5548..93207815d 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -13,11 +13,6 @@ import ( "golang.org/x/crypto/sha3" ) -const ( - bloomIdx = ethcmn.AddressLength - returnIdx = bloomIdx + ethtypes.BloomByteLength + 1 -) - // GenerateEthAddress generates an Ethereum address. func GenerateEthAddress() ethcmn.Address { priv, err := crypto.GenerateKey() @@ -79,6 +74,6 @@ func EncodeLogs(logs []*ethtypes.Log) ([]byte, error) { func DecodeLogs(in []byte) ([]*ethtypes.Log, error) { logs := []*ethtypes.Log{} - err := rlp.DecodeBytes(in, logs) + err := rlp.DecodeBytes(in, &logs) return logs, err } From 7b0d0bfdd7d072750bc01052912811f79eaf6f7b Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 14:53:46 -0400 Subject: [PATCH 09/31] update keeper get/set logs to use hash as key --- x/evm/handler_test.go | 6 +++--- x/evm/keeper/keeper.go | 21 ++++++++++----------- x/evm/types/state_transition.go | 6 +++++- x/evm/types/statedb.go | 26 ++++++++++++++++++++++---- x/evm/types/statedb_test.go | 3 ++- 5 files changed, 42 insertions(+), 20 deletions(-) diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 83d817481..87d317dfa 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -15,7 +15,6 @@ import ( eminttypes "github.com/cosmos/ethermint/types" "github.com/cosmos/ethermint/utils" evmtypes "github.com/cosmos/ethermint/x/evm/types" - ethcmn "github.com/ethereum/go-ethereum/common" abci "github.com/tendermint/tendermint/abci/types" tmlog "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" @@ -115,9 +114,10 @@ func TestHandler_Logs(t *testing.T) { t.Fatal("Fail: expected 2 topics") } - ek.SetBlockLogs(ctx, resultData.Logs, 1) + hash := []byte{1} + ek.SetBlockLogs(ctx, resultData.Logs, hash) - logs, err := ek.GetBlockLogs(ctx, 1) + logs, err := ek.GetBlockLogs(ctx, hash) if err != nil { t.Fatal(err) } diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 1f292e318..d5de2d02d 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -126,27 +126,21 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) (ethtypes.B } // SetBlockLogs sets the block's logs in the KVStore -func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, height int64) error { +func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, hash []byte) error { store := ctx.KVStore(k.storeKey) - heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) - if len(heightHash) == 0 { - return errors.New("cannot set block logs") - } - encLogs, err := types.EncodeLogs(logs) if err != nil { return err } - store.Set(logsKey(heightHash), encLogs) + store.Set(logsKey(hash), encLogs) return nil } // GetBlockLogs gets the logs for a block from the KVStore -func (k *Keeper) GetBlockLogs(ctx sdk.Context, height int64) ([]*ethtypes.Log, error) { +func (k *Keeper) GetBlockLogs(ctx sdk.Context, hash []byte) ([]*ethtypes.Log, error) { store := ctx.KVStore(k.storeKey) - heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) - encLogs := store.Get(logsKey(heightHash)) + encLogs := store.Get(logsKey(hash)) if len(encLogs) == 0 { return nil, errors.New("cannot get block logs") } @@ -274,7 +268,12 @@ func (k *Keeper) GetCommittedState(ctx sdk.Context, addr ethcmn.Address, hash et // GetLogs calls CommitStateDB.GetLogs using the passed in context func (k *Keeper) GetLogs(ctx sdk.Context, hash ethcmn.Hash) []*ethtypes.Log { - return k.CommitStateDB.WithContext(ctx).GetLogs(hash) + logs, err := k.CommitStateDB.WithContext(ctx).GetLogs(hash) + if err != nil { + panic(err) + } + + return logs } // Logs calls CommitStateDB.Logs using the passed in context diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index 536a5f706..3ba277dd1 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -117,7 +117,11 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) *ReturnData { var bloomFilter ethtypes.Bloom var logs []*ethtypes.Log if st.THash != nil && !st.Simulate { - logs = csdb.GetLogs(*st.THash) + logs, err = csdb.GetLogs(*st.THash) + if err != nil { + // TODO: handle error + logs = nil + } bloomInt = ethtypes.LogsBloom(logs) bloomFilter = ethtypes.BytesToBloom(bloomInt.Bytes()) } diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index 7646be2fc..eb90af02e 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -287,13 +287,31 @@ func (csdb *CommitStateDB) GetCommittedState(addr ethcmn.Address, hash ethcmn.Ha return ethcmn.Hash{} } +var logsPrefix = []byte("logs") + +func logsKey(key []byte) []byte { + return append(logsPrefix, key...) +} + // GetLogs returns the current logs for a given hash in the state. -func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) []*ethtypes.Log { - // TODO: if logs aren't in the cache, then reconstruct the logs +func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) ([]*ethtypes.Log, error) { + if csdb.logs[hash] != nil { + return csdb.logs[hash], nil + } - // question: how to get transaction details and what block it was included in from the hash? assuming the input is a tx hash + store := csdb.ctx.KVStore(csdb.storageKey) + + encLogs := store.Get(logsKey(hash[:])) + if len(encLogs) == 0 { + return nil, fmt.Errorf("no logs found") + } + + logs, err := DecodeLogs(encLogs) + if err != nil { + return nil, err + } - return csdb.logs[hash] + return logs, nil } // Logs returns all the current logs in the state. diff --git a/x/evm/types/statedb_test.go b/x/evm/types/statedb_test.go index c122f1e19..9dc46d76a 100644 --- a/x/evm/types/statedb_test.go +++ b/x/evm/types/statedb_test.go @@ -88,7 +88,8 @@ func TestBloomFilter(t *testing.T) { stateDB.AddLog(&log) // Get log from db - logs := stateDB.GetLogs(tHash) + logs, err := stateDB.GetLogs(tHash) + require.Nil(t, err) require.Equal(t, len(logs), 1) // get logs bloom from the log From 586947540d64d48f430cb40f2ac5387b7e7eeb67 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 14:55:25 -0400 Subject: [PATCH 10/31] fix test --- x/evm/types/msg_encoding.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/evm/types/msg_encoding.go b/x/evm/types/msg_encoding.go index 7fb83b7cb..5e62e4344 100644 --- a/x/evm/types/msg_encoding.go +++ b/x/evm/types/msg_encoding.go @@ -47,7 +47,7 @@ func unmarshalAmino(td *EncodableTxData, text string) (err error) { } // MarshalAmino defines custom encoding scheme for TxData -func (td *TxData) MarshalAmino() (string, error) { +func (td TxData) MarshalAmino() (string, error) { e := EncodableTxData{ AccountNonce: td.AccountNonce, Price: utils.MarshalBigInt(td.Price), From d668e7b2fc635d17eca7df82576675680a9b8e47 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:01:39 -0400 Subject: [PATCH 11/31] move logsKey to csdb --- x/evm/keeper/keeper.go | 19 ++++--------------- x/evm/types/statedb.go | 8 +------- x/evm/types/utils.go | 11 +++++++++++ 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index d5de2d02d..bcac2cece 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -87,17 +87,6 @@ func (k *Keeper) GetBlockHashMapping(ctx sdk.Context, hash []byte) (height int64 // May be removed when using only as module (only required by rpc api) // ---------------------------------------------------------------------------- -var bloomPrefix = []byte("bloom") -var logsPrefix = []byte("logs") - -func bloomKey(key []byte) []byte { - return append(bloomPrefix, key...) -} - -func logsKey(key []byte) []byte { - return append(logsPrefix, key...) -} - // SetBlockBloomMapping sets the mapping from block height to bloom bits func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, height int64) error { store := ctx.KVStore(k.storeKey) @@ -105,7 +94,7 @@ func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, hei if bytes.Equal(heightHash, []byte{}) { return fmt.Errorf("block with bloombits %s not found", bloom) } - store.Set(bloomKey(heightHash), bloom.Bytes()) + store.Set(types.BloomKey(heightHash), bloom.Bytes()) return nil } @@ -117,7 +106,7 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) (ethtypes.B return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with height %d not found", height) } - bloom := store.Get(bloomKey(heightHash)) + bloom := store.Get(types.BloomKey(heightHash)) if bytes.Equal(bloom, []byte{}) { return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with bloombits %v not found", bloom) } @@ -132,7 +121,7 @@ func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, hash []byte if err != nil { return err } - store.Set(logsKey(hash), encLogs) + store.Set(types.LogsKey(hash), encLogs) return nil } @@ -140,7 +129,7 @@ func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, hash []byte // GetBlockLogs gets the logs for a block from the KVStore func (k *Keeper) GetBlockLogs(ctx sdk.Context, hash []byte) ([]*ethtypes.Log, error) { store := ctx.KVStore(k.storeKey) - encLogs := store.Get(logsKey(hash)) + encLogs := store.Get(types.LogsKey(hash)) if len(encLogs) == 0 { return nil, errors.New("cannot get block logs") } diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index eb90af02e..f0d9aaf78 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -287,12 +287,6 @@ func (csdb *CommitStateDB) GetCommittedState(addr ethcmn.Address, hash ethcmn.Ha return ethcmn.Hash{} } -var logsPrefix = []byte("logs") - -func logsKey(key []byte) []byte { - return append(logsPrefix, key...) -} - // GetLogs returns the current logs for a given hash in the state. func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) ([]*ethtypes.Log, error) { if csdb.logs[hash] != nil { @@ -301,7 +295,7 @@ func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) ([]*ethtypes.Log, error) { store := csdb.ctx.KVStore(csdb.storageKey) - encLogs := store.Get(logsKey(hash[:])) + encLogs := store.Get(LogsKey(hash[:])) if len(encLogs) == 0 { return nil, fmt.Errorf("no logs found") } diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 93207815d..99a75a03a 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -13,6 +13,17 @@ import ( "golang.org/x/crypto/sha3" ) +var bloomPrefix = []byte("bloom") +var logsPrefix = []byte("logs") + +func BloomKey(key []byte) []byte { + return append(bloomPrefix, key...) +} + +func LogsKey(key []byte) []byte { + return append(logsPrefix, key...) +} + // GenerateEthAddress generates an Ethereum address. func GenerateEthAddress() ethcmn.Address { priv, err := crypto.GenerateKey() From 1ed2483fcf2c3f130d9be8ad00185d344eccc145 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:03:34 -0400 Subject: [PATCH 12/31] attempt to fix test --- importer/importer_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/importer/importer_test.go b/importer/importer_test.go index 26cd66564..05ee634ce 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -363,7 +363,10 @@ func applyTransaction(config *ethparams.ChainConfig, bc ethcore.ChainContext, au receipt.ContractAddress = ethcrypto.CreateAddress(vmenv.Context.Origin, tx.Nonce()) } // Set the receipt logs and create a bloom for filtering - receipt.Logs = statedb.GetLogs(tx.Hash()) + receipt.Logs, err = statedb.GetLogs(tx.Hash()) + if err != nil { + panic(err) + } receipt.Bloom = ethtypes.CreateBloom(ethtypes.Receipts{receipt}) receipt.BlockHash = statedb.BlockHash() receipt.BlockNumber = header.Number From a8fee1dfc290030acddf16509cbc6d87cc163a1d Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:05:43 -0400 Subject: [PATCH 13/31] attempt to fix test --- x/evm/types/statedb.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index f0d9aaf78..3c947074c 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -296,10 +296,6 @@ func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) ([]*ethtypes.Log, error) { store := csdb.ctx.KVStore(csdb.storageKey) encLogs := store.Get(LogsKey(hash[:])) - if len(encLogs) == 0 { - return nil, fmt.Errorf("no logs found") - } - logs, err := DecodeLogs(encLogs) if err != nil { return nil, err From b5cf0969402c28a394fc248261207a470892ead1 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:28:03 -0400 Subject: [PATCH 14/31] attempt to fix test --- x/evm/types/statedb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index 3c947074c..0b2aa33a8 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -296,6 +296,10 @@ func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) ([]*ethtypes.Log, error) { store := csdb.ctx.KVStore(csdb.storageKey) encLogs := store.Get(LogsKey(hash[:])) + if len(encLogs) == 0 { + return []*ethtypes.Log{}, nil + } + logs, err := DecodeLogs(encLogs) if err != nil { return nil, err From 9114d4769099df964cd7c52fd637c7eeffa0e683 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:28:35 -0400 Subject: [PATCH 15/31] lint --- x/evm/handler_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 87d317dfa..30ad05d5a 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -115,7 +115,10 @@ func TestHandler_Logs(t *testing.T) { } hash := []byte{1} - ek.SetBlockLogs(ctx, resultData.Logs, hash) + err = ek.SetBlockLogs(ctx, resultData.Logs, hash) + if err != nil { + t.Fatal(err) + } logs, err := ek.GetBlockLogs(ctx, hash) if err != nil { From 6741a873a0988132d96e484266c8984048435347 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:36:59 -0400 Subject: [PATCH 16/31] lint --- x/evm/keeper/keeper.go | 2 +- x/evm/keeper/keeper_test.go | 5 ++++- x/evm/module.go | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index bcac2cece..e1669b7c0 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -76,7 +76,7 @@ func (k *Keeper) GetBlockHashMapping(ctx sdk.Context, hash []byte) (height int64 store := ctx.KVStore(k.storeKey) bz := store.Get(hash) if bytes.Equal(bz, []byte{}) { - panic(fmt.Errorf("block with hash %s not found", ethcmn.BytesToHash(hash))) + panic(fmt.Errorf("block with hash %v not found", ethcmn.BytesToHash(hash))) } k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &height) return diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index 206fea781..79a233219 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -87,7 +87,10 @@ func TestDBStorage(t *testing.T) { // Test block height mapping functionality testBloom := ethtypes.BytesToBloom([]byte{0x1, 0x3}) - ek.SetBlockBloomMapping(ctx, testBloom, 4) + err = ek.SetBlockBloomMapping(ctx, testBloom, 4) + if err != nil { + t.Fatal(err) + } // Get those state transitions require.Equal(t, ek.GetBalance(ctx, address).Cmp(big.NewInt(5)), 0) diff --git a/x/evm/module.go b/x/evm/module.go index b8ef1b1b5..6cd321766 100644 --- a/x/evm/module.go +++ b/x/evm/module.go @@ -110,7 +110,10 @@ func (am AppModule) NewQuerierHandler() sdk.Querier { func (am AppModule) BeginBlock(ctx sdk.Context, bl abci.RequestBeginBlock) { // Consider removing this when using evm as module without web3 API bloom := ethtypes.BytesToBloom(am.keeper.Bloom.Bytes()) - am.keeper.SetBlockBloomMapping(ctx, bloom, bl.Header.GetHeight()-1) + err := am.keeper.SetBlockBloomMapping(ctx, bloom, bl.Header.GetHeight()-1) + if err != nil { + panic(err) + } am.keeper.SetBlockHashMapping(ctx, bl.Header.LastBlockId.GetHash(), bl.Header.GetHeight()-1) am.keeper.Bloom = big.NewInt(0) am.keeper.TxCount.Reset() From d5fce9336216986d798d4f1a8f9a45e3a7aefb63 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:39:07 -0400 Subject: [PATCH 17/31] lint --- x/evm/keeper/keeper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index e1669b7c0..c4c31abf8 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -76,7 +76,7 @@ func (k *Keeper) GetBlockHashMapping(ctx sdk.Context, hash []byte) (height int64 store := ctx.KVStore(k.storeKey) bz := store.Get(hash) if bytes.Equal(bz, []byte{}) { - panic(fmt.Errorf("block with hash %v not found", ethcmn.BytesToHash(hash))) + panic(fmt.Errorf("block with hash %s not found", ethcmn.BytesToHash(hash))) } k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &height) return @@ -92,7 +92,7 @@ func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, hei store := ctx.KVStore(k.storeKey) heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) if bytes.Equal(heightHash, []byte{}) { - return fmt.Errorf("block with bloombits %s not found", bloom) + return fmt.Errorf("block with bloombits %v not found", bloom) } store.Set(types.BloomKey(heightHash), bloom.Bytes()) return nil From 5bbf7354bf97bc6173a4f9ed54d578053a7d59f4 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:42:49 -0400 Subject: [PATCH 18/31] save logs after handling msg --- x/evm/handler.go | 1 + x/evm/handler_test.go | 4 ++++ x/evm/types/state_transition.go | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/x/evm/handler.go b/x/evm/handler.go index be0dd25df..1d222d4a1 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -80,6 +80,7 @@ func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Res returnData := st.TransitionCSDB(ctx) if returnData.Result.IsOK() { k.Bloom.Or(k.Bloom, returnData.Bloom) + k.Logs = append(k.Logs, returnData.Logs) // does k.SetBlockLogs need to be called here? } return returnData.Result diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 30ad05d5a..e38178ae5 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -128,4 +128,8 @@ func TestHandler_Logs(t *testing.T) { if !reflect.DeepEqual(logs, resultData.Logs) { t.Fatalf("Fail: got %v expected %v", logs, resultData.Logs) } + + if !reflect.DeepEqual(ek.Logs, logs) { + t.Fatalf("Fail: got %v expected %v", ek.Logs, logs) + } } diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index 3ba277dd1..bfac7f4b5 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -123,7 +123,7 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) *ReturnData { logs = nil } bloomInt = ethtypes.LogsBloom(logs) - bloomFilter = ethtypes.BytesToBloom(bloomInt.Bytes()) + bloomFilter = ethtypegs.BytesToBloom(bloomInt.Bytes()) } // Encode all necessary data into slice of bytes to return in sdk result From e66bf4c38b05e59320f5e9d6f0c309cf171eec58 Mon Sep 17 00:00:00 2001 From: noot Date: Fri, 13 Mar 2020 15:54:08 -0400 Subject: [PATCH 19/31] update k.Logs --- x/evm/handler.go | 3 ++- x/evm/handler_test.go | 4 ---- x/evm/keeper/keeper.go | 8 +++++--- x/evm/keeper/querier.go | 2 +- x/evm/types/state_transition.go | 2 +- x/evm/types/statedb.go | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/x/evm/handler.go b/x/evm/handler.go index 1d222d4a1..9b1b673d2 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -80,7 +80,8 @@ func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Res returnData := st.TransitionCSDB(ctx) if returnData.Result.IsOK() { k.Bloom.Or(k.Bloom, returnData.Bloom) - k.Logs = append(k.Logs, returnData.Logs) // does k.SetBlockLogs need to be called here? + fmt.Println(returnData.Logs[0]) + k.Logs = append(k.Logs, returnData.Logs...) // does k.SetBlockLogs or k.AddLog need to be called here? } return returnData.Result diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index e38178ae5..30ad05d5a 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -128,8 +128,4 @@ func TestHandler_Logs(t *testing.T) { if !reflect.DeepEqual(logs, resultData.Logs) { t.Fatalf("Fail: got %v expected %v", logs, resultData.Logs) } - - if !reflect.DeepEqual(ek.Logs, logs) { - t.Fatalf("Fail: got %v expected %v", ek.Logs, logs) - } } diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index c4c31abf8..1ca12cb3f 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -29,6 +29,7 @@ type Keeper struct { CommitStateDB *types.CommitStateDB TxCount *count Bloom *big.Int + Logs []*ethtypes.Log } // TODO: move to types @@ -55,6 +56,7 @@ func NewKeeper(ak auth.AccountKeeper, storageKey, codeKey, CommitStateDB: types.NewCommitStateDB(sdk.Context{}, ak, storageKey, codeKey), TxCount: new(count), Bloom: big.NewInt(0), + Logs: []*ethtypes.Log{}, } } @@ -265,9 +267,9 @@ func (k *Keeper) GetLogs(ctx sdk.Context, hash ethcmn.Hash) []*ethtypes.Log { return logs } -// Logs calls CommitStateDB.Logs using the passed in context -func (k *Keeper) Logs(ctx sdk.Context) []*ethtypes.Log { - return k.CommitStateDB.WithContext(ctx).Logs() +// AllLogs calls CommitStateDB.AllLogs using the passed in context +func (k *Keeper) AllLogs(ctx sdk.Context) []*ethtypes.Log { + return k.CommitStateDB.WithContext(ctx).AllLogs() } // GetRefund calls CommitStateDB.GetRefund using the passed in context diff --git a/x/evm/keeper/querier.go b/x/evm/keeper/querier.go index 865f3bb73..74969ac48 100644 --- a/x/evm/keeper/querier.go +++ b/x/evm/keeper/querier.go @@ -163,7 +163,7 @@ func queryTxLogs(ctx sdk.Context, path []string, keeper Keeper) ([]byte, sdk.Err } func queryLogs(ctx sdk.Context, keeper Keeper) ([]byte, sdk.Error) { - logs := keeper.Logs(ctx) + logs := keeper.AllLogs(ctx) lRes := types.QueryETHLogs{Logs: logs} l, err := codec.MarshalJSONIndent(keeper.cdc, lRes) diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index bfac7f4b5..3ba277dd1 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -123,7 +123,7 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) *ReturnData { logs = nil } bloomInt = ethtypes.LogsBloom(logs) - bloomFilter = ethtypegs.BytesToBloom(bloomInt.Bytes()) + bloomFilter = ethtypes.BytesToBloom(bloomInt.Bytes()) } // Encode all necessary data into slice of bytes to return in sdk result diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index 0b2aa33a8..73e48d275 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -309,7 +309,7 @@ func (csdb *CommitStateDB) GetLogs(hash ethcmn.Hash) ([]*ethtypes.Log, error) { } // Logs returns all the current logs in the state. -func (csdb *CommitStateDB) Logs() []*ethtypes.Log { +func (csdb *CommitStateDB) AllLogs() []*ethtypes.Log { var logs []*ethtypes.Log for _, lgs := range csdb.logs { logs = append(logs, lgs...) From ebf52d3f0c2db50d969571f4a26f74dd622c80c7 Mon Sep 17 00:00:00 2001 From: noot Date: Mon, 16 Mar 2020 10:01:23 -0400 Subject: [PATCH 20/31] cleanup --- x/evm/handler.go | 1 - x/evm/handler_test.go | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/x/evm/handler.go b/x/evm/handler.go index 9b1b673d2..e84443166 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -80,7 +80,6 @@ func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Res returnData := st.TransitionCSDB(ctx) if returnData.Result.IsOK() { k.Bloom.Or(k.Bloom, returnData.Bloom) - fmt.Println(returnData.Logs[0]) k.Logs = append(k.Logs, returnData.Logs...) // does k.SetBlockLogs or k.AddLog need to be called here? } diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 30ad05d5a..3cb24ea88 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -13,8 +13,8 @@ import ( "github.com/cosmos/ethermint/crypto" "github.com/cosmos/ethermint/types" eminttypes "github.com/cosmos/ethermint/types" - "github.com/cosmos/ethermint/utils" evmtypes "github.com/cosmos/ethermint/x/evm/types" + "github.com/ethereum/go-ethereum/common" abci "github.com/tendermint/tendermint/abci/types" tmlog "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" @@ -76,10 +76,7 @@ func TestHandler_Logs(t *testing.T) { priv1, _ := crypto.GenerateKey() - bytecode, err := utils.HexToBytes("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029") - if err != nil { - t.Fatal(err) - } + bytecode := common.FromHex("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029") tx := evmtypes.NewEthereumTxMsg(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode) tx.Sign(big.NewInt(1), priv1.ToECDSA()) @@ -91,7 +88,7 @@ func TestHandler_Logs(t *testing.T) { cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, nil) } - err = cms.LoadLatestVersion() + err := cms.LoadLatestVersion() if err != nil { t.Fatal(err) } @@ -106,7 +103,7 @@ func TestHandler_Logs(t *testing.T) { t.Fatal(err) } - if len(resultData.Logs) == 0 { + if len(resultData.Logs) != 1 { t.Fatal("Fail: expected 1 log") } From 79e9b7605ceb607da624d775b7bc8c36474f8dff Mon Sep 17 00:00:00 2001 From: noot Date: Mon, 16 Mar 2020 10:04:34 -0400 Subject: [PATCH 21/31] remove unused --- utils/utils.go | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 utils/utils.go diff --git a/utils/utils.go b/utils/utils.go deleted file mode 100644 index d70c8af0b..000000000 --- a/utils/utils.go +++ /dev/null @@ -1,25 +0,0 @@ -package utils - -import ( - "encoding/hex" - "errors" - "strings" -) - -// HexToBytes turns a 0x prefixed hex string into a byte slice -func HexToBytes(in string) ([]byte, error) { - if len(in) < 2 { - return nil, errors.New("invalid string") - } - - if strings.Compare(in[:2], "0x") != 0 { - return nil, errors.New("could not byteify non 0x prefixed string") - } - // Ensure we have an even length, otherwise hex.DecodeString will fail and return zero hash - if len(in)%2 != 0 { - return nil, errors.New("cannot decode a odd length string") - } - in = in[2:] - out, err := hex.DecodeString(in) - return out, err -} From bcbd90529de1146628b08cb607f19906630f9eb8 Mon Sep 17 00:00:00 2001 From: noot Date: Mon, 16 Mar 2020 18:58:34 -0400 Subject: [PATCH 22/31] fix issues --- importer/importer_test.go | 2 +- x/evm/handler.go | 18 +++++++++--------- x/evm/handler_test.go | 6 +++--- x/evm/keeper/keeper.go | 18 ++++++++---------- x/evm/keeper/keeper_test.go | 8 ++------ x/evm/keeper/querier.go | 6 +++++- x/evm/types/statedb_test.go | 2 +- x/evm/types/utils.go | 10 ++++++++-- x/evm/types/utils_test.go | 8 +------- 9 files changed, 38 insertions(+), 40 deletions(-) diff --git a/importer/importer_test.go b/importer/importer_test.go index 05ee634ce..fdfed3b6d 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -365,7 +365,7 @@ func applyTransaction(config *ethparams.ChainConfig, bc ethcore.ChainContext, au // Set the receipt logs and create a bloom for filtering receipt.Logs, err = statedb.GetLogs(tx.Hash()) if err != nil { - panic(err) + return nil, 0, err } receipt.Bloom = ethtypes.CreateBloom(ethtypes.Receipts{receipt}) receipt.BlockHash = statedb.BlockHash() diff --git a/x/evm/handler.go b/x/evm/handler.go index e84443166..040908216 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -18,9 +18,9 @@ import ( func NewHandler(k Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) sdk.Result { switch msg := msg.(type) { - case *types.EthereumTxMsg: + case types.EthereumTxMsg: return handleETHTxMsg(ctx, k, msg) - case *types.EmintMsg: + case types.EmintMsg: return handleEmintMsg(ctx, k, msg) default: errMsg := fmt.Sprintf("Unrecognized ethermint Msg type: %v", msg.Type()) @@ -30,7 +30,7 @@ func NewHandler(k Keeper) sdk.Handler { } // Handle an Ethereum specific tx -func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Result { +func handleETHTxMsg(ctx sdk.Context, k Keeper, msg types.EthereumTxMsg) sdk.Result { if err := msg.ValidateBasic(); err != nil { return err.Result() } @@ -56,10 +56,6 @@ func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Res txHash := tmtypes.Tx(txBytes).Hash() ethHash := common.BytesToHash(txHash) - if k.CommitStateDB == nil { - panic("keeper.CommitStateDB is nil") - } - st := types.StateTransition{ Sender: sender, AccountNonce: msg.Data.AccountNonce, @@ -80,13 +76,17 @@ func handleETHTxMsg(ctx sdk.Context, k Keeper, msg *types.EthereumTxMsg) sdk.Res returnData := st.TransitionCSDB(ctx) if returnData.Result.IsOK() { k.Bloom.Or(k.Bloom, returnData.Bloom) - k.Logs = append(k.Logs, returnData.Logs...) // does k.SetBlockLogs or k.AddLog need to be called here? + err = k.SetTransactionLogs(ctx, returnData.Logs, txHash) + if err != nil { + // TODO: handle error + return returnData.Result + } } return returnData.Result } -func handleEmintMsg(ctx sdk.Context, k Keeper, msg *types.EmintMsg) sdk.Result { +func handleEmintMsg(ctx sdk.Context, k Keeper, msg types.EmintMsg) sdk.Result { if err := msg.ValidateBasic(); err != nil { return err.Result() } diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 3cb24ea88..542fbcb03 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -97,7 +97,7 @@ func TestHandler_Logs(t *testing.T) { ctx := sdk.NewContext(ms, abci.Header{}, false, logger) ctx = ctx.WithBlockHeight(1).WithChainID("1") - result := handleETHTxMsg(ctx, ek, tx) + result := handleETHTxMsg(ctx, ek, *tx) resultData, err := evmtypes.DecodeResultData(result.Data) if err != nil { t.Fatal(err) @@ -112,12 +112,12 @@ func TestHandler_Logs(t *testing.T) { } hash := []byte{1} - err = ek.SetBlockLogs(ctx, resultData.Logs, hash) + err = ek.SetTransactionLogs(ctx, resultData.Logs, hash) if err != nil { t.Fatal(err) } - logs, err := ek.GetBlockLogs(ctx, hash) + logs, err := ek.GetTransactionLogs(ctx, hash) if err != nil { t.Fatal(err) } diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 1ca12cb3f..06ea7fe78 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -29,7 +29,6 @@ type Keeper struct { CommitStateDB *types.CommitStateDB TxCount *count Bloom *big.Int - Logs []*ethtypes.Log } // TODO: move to types @@ -56,7 +55,6 @@ func NewKeeper(ak auth.AccountKeeper, storageKey, codeKey, CommitStateDB: types.NewCommitStateDB(sdk.Context{}, ak, storageKey, codeKey), TxCount: new(count), Bloom: big.NewInt(0), - Logs: []*ethtypes.Log{}, } } @@ -116,8 +114,8 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) (ethtypes.B return ethtypes.BytesToBloom(bloom), nil } -// SetBlockLogs sets the block's logs in the KVStore -func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, hash []byte) error { +// SetBlockLogs sets the transaction's logs in the KVStore +func (k *Keeper) SetTransactionLogs(ctx sdk.Context, logs []*ethtypes.Log, hash []byte) error { store := ctx.KVStore(k.storeKey) encLogs, err := types.EncodeLogs(logs) if err != nil { @@ -128,12 +126,12 @@ func (k *Keeper) SetBlockLogs(ctx sdk.Context, logs []*ethtypes.Log, hash []byte return nil } -// GetBlockLogs gets the logs for a block from the KVStore -func (k *Keeper) GetBlockLogs(ctx sdk.Context, hash []byte) ([]*ethtypes.Log, error) { +// GetBlockLogs gets the logs for a transaction from the KVStore +func (k *Keeper) GetTransactionLogs(ctx sdk.Context, hash []byte) ([]*ethtypes.Log, error) { store := ctx.KVStore(k.storeKey) encLogs := store.Get(types.LogsKey(hash)) if len(encLogs) == 0 { - return nil, errors.New("cannot get block logs") + return nil, errors.New("cannot get transaction logs") } return types.DecodeLogs(encLogs) @@ -258,13 +256,13 @@ func (k *Keeper) GetCommittedState(ctx sdk.Context, addr ethcmn.Address, hash et } // GetLogs calls CommitStateDB.GetLogs using the passed in context -func (k *Keeper) GetLogs(ctx sdk.Context, hash ethcmn.Hash) []*ethtypes.Log { +func (k *Keeper) GetLogs(ctx sdk.Context, hash ethcmn.Hash) ([]*ethtypes.Log, error) { logs, err := k.CommitStateDB.WithContext(ctx).GetLogs(hash) if err != nil { - panic(err) + return nil, err } - return logs + return logs, nil } // AllLogs calls CommitStateDB.AllLogs using the passed in context diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index 79a233219..323844851 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -88,9 +88,7 @@ func TestDBStorage(t *testing.T) { // Test block height mapping functionality testBloom := ethtypes.BytesToBloom([]byte{0x1, 0x3}) err = ek.SetBlockBloomMapping(ctx, testBloom, 4) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) // Get those state transitions require.Equal(t, ek.GetBalance(ctx, address).Cmp(big.NewInt(5)), 0) @@ -102,9 +100,7 @@ func TestDBStorage(t *testing.T) { require.Equal(t, ek.GetBlockHashMapping(ctx, []byte{0x43, 0x32}), int64(8)) bloom, err := ek.GetBlockBloomMapping(ctx, 4) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) require.Equal(t, bloom, testBloom) // commit stateDB diff --git a/x/evm/keeper/querier.go b/x/evm/keeper/querier.go index 74969ac48..df13cf735 100644 --- a/x/evm/keeper/querier.go +++ b/x/evm/keeper/querier.go @@ -151,7 +151,11 @@ func queryBlockLogsBloom(ctx sdk.Context, path []string, keeper Keeper) ([]byte, func queryTxLogs(ctx sdk.Context, path []string, keeper Keeper) ([]byte, sdk.Error) { txHash := ethcmn.HexToHash(path[1]) - logs := keeper.GetLogs(ctx, txHash) + logs, err := keeper.GetLogs(ctx, txHash) + if err != nil { + // TODO: handle err + return nil, nil + } bRes := types.QueryETHLogs{Logs: logs} res, err := codec.MarshalJSONIndent(keeper.cdc, bRes) diff --git a/x/evm/types/statedb_test.go b/x/evm/types/statedb_test.go index 9dc46d76a..3efcd4e94 100644 --- a/x/evm/types/statedb_test.go +++ b/x/evm/types/statedb_test.go @@ -89,7 +89,7 @@ func TestBloomFilter(t *testing.T) { // Get log from db logs, err := stateDB.GetLogs(tHash) - require.Nil(t, err) + require.NoError(t, err) require.Equal(t, len(logs), 1) // get logs bloom from the log diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 99a75a03a..7e021e29d 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -76,7 +76,10 @@ func EncodeResultData(data *ResultData) ([]byte, error) { func DecodeResultData(in []byte) (*ResultData, error) { data := new(ResultData) err := rlp.DecodeBytes(in, data) - return data, err + if err != nil { + return nil, err + } + return data, nil } func EncodeLogs(logs []*ethtypes.Log) ([]byte, error) { @@ -86,5 +89,8 @@ func EncodeLogs(logs []*ethtypes.Log) ([]byte, error) { func DecodeLogs(in []byte) ([]*ethtypes.Log, error) { logs := []*ethtypes.Log{} err := rlp.DecodeBytes(in, &logs) - return logs, err + if err != nil { + return nil, err + } + return logs, nil } diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index e71d1b3ab..2f8014080 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -21,15 +21,9 @@ func TestEvmDataEncoding(t *testing.T) { } enc, err := EncodeResultData(data) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) res, err := DecodeResultData(enc) - if err != nil { - t.Fatal(err) - } - require.NoError(t, err) require.Equal(t, addr, res.Address) require.Equal(t, bloom, res.Bloom) From e285fd065a444a691be0ff9b9ea779621377565e Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 17 Mar 2020 10:26:10 -0400 Subject: [PATCH 23/31] comment out handler test --- x/evm/handler_test.go | 78 ++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 83c11fed2..067968845 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -2,22 +2,21 @@ package evm // import ( // "math/big" -// "reflect" // "testing" +// "time" + +// "github.com/stretchr/testify/suite" -// "github.com/cosmos/cosmos-sdk/codec" -// "github.com/cosmos/cosmos-sdk/store" // sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/x/auth" -// "github.com/cosmos/cosmos-sdk/x/params" + +// "github.com/cosmos/ethermint/app" // "github.com/cosmos/ethermint/crypto" -// "github.com/cosmos/ethermint/types" -// eminttypes "github.com/cosmos/ethermint/types" -// evmtypes "github.com/cosmos/ethermint/x/evm/types" -// "github.com/ethereum/go-ethereum/common" +// "github.com/cosmos/ethermint/x/evm/keeper" + +// ethcmn "github.com/ethereum/go-ethereum/common" +// ethtypes "github.com/ethereum/go-ethereum/core/types" + // abci "github.com/tendermint/tendermint/abci/types" -// tmlog "github.com/tendermint/tendermint/libs/log" -// dbm "github.com/tendermint/tm-db" // ) // pragma solidity ^0.5.1; @@ -37,25 +36,52 @@ package evm // "sourceMap": "25:119:0:-;;;90:52;8:9:-1;5:2;;;30:1;27;20:12;5:2;90:52:0;132:2;126:9;;;;;;;;;;25:119;;;;;;" // } -// var ( -// accKey = sdk.NewKVStoreKey("acc") -// storageKey = sdk.NewKVStoreKey(evmtypes.EvmStoreKey) -// codeKey = sdk.NewKVStoreKey(evmtypes.EvmCodeKey) -// blockKey = sdk.NewKVStoreKey(evmtypes.EvmBlockKey) +// type EvmTestSuite struct { +// suite.Suite -// logger = tmlog.NewNopLogger() -// ) +// ctx sdk.Context +// querier sdk.Querier +// app *app.EthermintApp +// } -// func newTestCodec() *codec.Codec { -// cdc := codec.New() +// func (suite *EvmTestSuite) SetupTest() { +// checkTx := false -// evmtypes.RegisterCodec(cdc) -// types.RegisterCodec(cdc) -// auth.RegisterCodec(cdc) -// sdk.RegisterCodec(cdc) -// codec.RegisterCrypto(cdc) +// suite.app = app.Setup(checkTx) +// suite.ctx = suite.app.BaseApp.NewContext(checkTx, abci.Header{Height: 1, ChainID: "3", Time: time.Now().UTC()}) +// suite.querier = keeper.NewQuerier(suite.app.EvmKeeper) +// } + +// func TestEvmTestSuite(t *testing.T) { +// suite.Run(t, new(EvmTestSuite)) +// } + +// func (suite *EvmTestSuite) TestHandler_Logs() { +// // Perform state transitions +// // suite.app.EvmKeeper.CreateAccount(suite.ctx, address) +// // suite.app.EvmKeeper.SetBalance(suite.ctx, address, big.NewInt(5)) +// // suite.app.EvmKeeper.SetNonce(suite.ctx, address, 4) + +// priv1, _ := crypto.GenerateKey() +// bytecode := common.FromHex("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029") +// tx := evmtypes.NewEthereumTxMsg(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode) +// tx.Sign(big.NewInt(1), priv1.ToECDSA()) + +// result := handleETHTxMsg(ctx, suite.App.EvmKeeper, *tx) +// resultData, err := evmtypes.DecodeResultData(result.Data) +// suite.Require().NoError(err, "failed to decode result data") + +// suite.Require().Equal(len(resultData.Logs), 1) +// suite.Require().Equal(len(resultData.Logs[0].Topics), 2) + +// hash := []byte{1} +// err = ek.SetTransactionLogs(ctx, resultData.Logs, hash) +// suite.Require().NoError(err, "failed to set logs") + +// logs, err := ek.GetTransactionLogs(ctx, hash) +// suite.Require().NoError(err, "failed to get logs") -// return cdc +// suite.Require().Equal(logs, resultData.Logs) // } // func TestHandler_Logs(t *testing.T) { From 045e41ad2f8be9b27ed3fe3298c3fa0e6f8fa6b2 Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 17 Mar 2020 10:29:34 -0400 Subject: [PATCH 24/31] address comments --- go.sum | 50 ++++++++++++++++++++++++++++++++++++++++++ x/evm/keeper/keeper.go | 6 ++--- x/evm/types/utils.go | 6 ++--- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/go.sum b/go.sum index 3c2cf7791..dce5b173f 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/99designs/keyring v1.1.3 h1:mEV3iyZWjkxQ7R8ia8GcG97vCX5zQQ7n4o8R2Bylw github.com/99designs/keyring v1.1.3/go.mod h1:657DQuMrBZRtuL/voxVyiyb6zpMehlm5vLB9Qwrv904= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f h1:4O1om+UVU+Hfcihr1timk8YNXHxzZWgCo7ofnrZRApw= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -51,6 +53,8 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/cosmos-sdk v0.34.4-0.20191213112149-d7b0f4b9b4fb h1:zVivJCmI6SF3DmxlhY94trezOyfPXtiIDxCH3VPFXHY= github.com/cosmos/cosmos-sdk v0.34.4-0.20191213112149-d7b0f4b9b4fb/go.mod h1:hasIdlU9b3FEFCWpoStvNQQPg1ZpAKnpmlFklAk1W1o= +github.com/cosmos/cosmos-sdk v0.38.1 h1:DTuxIJeMpB//ydq+ObAjQgsaiwYBZ8T7NDzXjyiL1Kg= +github.com/cosmos/cosmos-sdk v0.38.1/go.mod h1:9ZZex0GKpyNCvilvVAPBoB+0n3A/aO1+/UhPVEaiCy4= github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8 h1:Iwin12wRQtyZhH6FV3ykFcdGNlYEzoeR0jN8Vn+JWsI= github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= @@ -60,6 +64,7 @@ github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0W github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -77,6 +82,7 @@ github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt github.com/elastic/gosigar v0.10.3 h1:xA7TJmJgaVgqEnQpYAijMI4J9V1ZM2a9z8+5gAc5FMs= github.com/elastic/gosigar v0.10.3/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.2 h1:RLRQ0TKLX7DlBRXAJHvbmXL17Q3KNnTBtZ9B6Qo+/Y0= github.com/etcd-io/bbolt v1.3.2/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= @@ -110,6 +116,8 @@ github.com/go-logfmt/logfmt v0.3.0 h1:8HUsc87TaSWLKwrnumgC8/YconD2fJQsRJAsWaPg2i github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= @@ -149,6 +157,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGa github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= @@ -160,8 +170,14 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= +github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f h1:8N8XWLZelZNibkhM1FuF+3Ad3YIbgirjdMiVA0eUkaM= +github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= +github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= +github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= @@ -212,10 +228,14 @@ github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= +github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= @@ -241,6 +261,8 @@ github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1 h1:K47Rk0v/fkEfwfQet2KWhscE0cJzjgCCDBG2KHZoVno= @@ -283,6 +305,8 @@ github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= @@ -304,6 +328,8 @@ github.com/spf13/cobra v0.0.1 h1:zZh3X5aZbdnoj+4XkaBxKfhO4ot82icYdhhREIAXIj8= github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v0.0.6 h1:breEStsVwemnKh2/s6gMvSdMEkwW0sK8vGStnlVBMCs= +github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= @@ -316,10 +342,13 @@ github.com/spf13/viper v1.0.0 h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I= github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.5.0 h1:GpsTwfsQ27oS/Aha/6d1oD7tpKIqWnOA6tgOX9HHkt4= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= github.com/spf13/viper v1.6.1 h1:VPZzIkznI1YhVMRi6vNFLHSwhnhReBfgTxIPccpfdZk= github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= +github.com/spf13/viper v1.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E= +github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 h1:ju5UTwk5Odtm4trrY+4Ca4RMj5OyXbmVeDAVad2T0Jw= github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE= @@ -336,12 +365,17 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stumble/gorocksdb v0.0.3 h1:9UU+QA1pqFYJuf9+5p7z1IqdE5k0mma4UAeu2wmX8kA= github.com/stumble/gorocksdb v0.0.3/go.mod h1:v6IHdFBXk5DJ1K4FZ0xi+eY737quiiBxYtSWXadLybY= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/tecbot/gorocksdb v0.0.0-20191017175515-d217d93fd4c5/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= @@ -352,13 +386,19 @@ github.com/tendermint/go-amino v0.15.1 h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN github.com/tendermint/go-amino v0.15.1/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/iavl v0.12.4 h1:hd1woxUGISKkfUWBA4mmmTwOua6PQZTJM/F0FDrmMV8= github.com/tendermint/iavl v0.12.4/go.mod h1:8LHakzt8/0G3/I8FUU0ReNx98S/EP6eyPJkAUvEXT/o= +github.com/tendermint/iavl v0.13.0 h1:r2sINvNFlJsLlLhGoqlqPlREWYkuK26BvMfkBt+XQnA= +github.com/tendermint/iavl v0.13.0/go.mod h1:7nSUPdrsHEZ2nNZa+9gaIrcJciWd1jCQZXtcyARU82k= github.com/tendermint/tendermint v0.32.1/go.mod h1:jmPDAKuNkev9793/ivn/fTBnfpA9mGBww8MPRNPNxnU= github.com/tendermint/tendermint v0.32.8 h1:eOaLJGRi5x/Rb23fiVsxq9c5fZ/6O5QplExlGjNPDVI= github.com/tendermint/tendermint v0.32.8/go.mod h1:5/B1XZjNYtVBso8o1l/Eg4A0Mhu42lDcmftoQl95j/E= +github.com/tendermint/tendermint v0.33.0 h1:TW1g9sQs3YSqKM8o1+opL3/VmBy4Ke/VKV9MxYpqNbI= +github.com/tendermint/tendermint v0.33.0/go.mod h1:s5UoymnPIY+GcA3mMte4P9gpMP8vS7UH7HBXikT1pHI= github.com/tendermint/tm-db v0.1.1 h1:G3Xezy3sOk9+ekhjZ/kjArYIs1SmwV+1OUgNkj7RgV0= github.com/tendermint/tm-db v0.1.1/go.mod h1:0cPKWu2Mou3IlxecH+MEUSYc1Ch537alLe6CpFrKzgw= github.com/tendermint/tm-db v0.2.0 h1:rJxgdqn6fIiVJZy4zLpY1qVlyD0TU6vhkT4kEf71TQQ= github.com/tendermint/tm-db v0.2.0/go.mod h1:0cPKWu2Mou3IlxecH+MEUSYc1Ch537alLe6CpFrKzgw= +github.com/tendermint/tm-db v0.4.0 h1:iPbCcLbf4nwDFhS39Zo1lpdS1X/cT9CkTlUx17FHQgA= +github.com/tendermint/tm-db v0.4.0/go.mod h1:+Cwhgowrf7NBGXmsqFMbwEtbo80XmyrlY5Jsk95JubQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tyler-smith/go-bip39 v1.0.0 h1:FOHg9gaQLeBBRbHE/QrTLfEiBHy5pQ/yXzf9JG5pYFM= github.com/tyler-smith/go-bip39 v1.0.0/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= @@ -385,6 +425,8 @@ golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -405,6 +447,8 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8 golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -431,6 +475,8 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -463,6 +509,8 @@ google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -490,5 +538,7 @@ gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 4b433b6d7..a51fbd2a3 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -76,7 +76,7 @@ func (k *Keeper) GetBlockHashMapping(ctx sdk.Context, hash []byte) (height int64 func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, height int64) error { store := ctx.KVStore(k.blockKey) heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) - if bytes.Equal(heightHash, []byte{}) { + if len(heightHash) == 0 { return fmt.Errorf("block with bloombits %v not found", bloom) } store.Set(types.BloomKey(heightHash), bloom.Bytes()) @@ -87,12 +87,12 @@ func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, hei func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) (ethtypes.Bloom, error) { store := ctx.KVStore(k.blockKey) heightHash := k.cdc.MustMarshalBinaryLengthPrefixed(height) - if bytes.Equal(heightHash, []byte{}) { + if len(heightHash) == 0 { return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with height %d not found", height) } bloom := store.Get(types.BloomKey(heightHash)) - if bytes.Equal(bloom, []byte{}) { + if len(bloom) == 0 { return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with bloombits %v not found", bloom) } diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 7e021e29d..86c6c5e72 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -73,13 +73,13 @@ func EncodeResultData(data *ResultData) ([]byte, error) { } // DecodeReturnData decodes the byte slice of values to their respective types -func DecodeResultData(in []byte) (*ResultData, error) { +func DecodeResultData(in []byte) (ResultData, error) { data := new(ResultData) err := rlp.DecodeBytes(in, data) if err != nil { - return nil, err + return ResultData{}, err } - return data, nil + return *data, nil } func EncodeLogs(logs []*ethtypes.Log) ([]byte, error) { From 7f4791626b48b7a95eb03b34c22ae5eddda3f33c Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 17 Mar 2020 10:32:52 -0400 Subject: [PATCH 25/31] lint --- x/evm/abci.go | 5 ++++- x/evm/keeper/keeper_test.go | 3 ++- x/evm/types/state_transition.go | 9 +++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/x/evm/abci.go b/x/evm/abci.go index f058e0bb2..daf8d91b2 100644 --- a/x/evm/abci.go +++ b/x/evm/abci.go @@ -15,7 +15,10 @@ import ( func BeginBlock(k Keeper, ctx sdk.Context, req abci.RequestBeginBlock) { // Consider removing this when using evm as module without web3 API bloom := ethtypes.BytesToBloom(k.Bloom.Bytes()) - k.SetBlockBloomMapping(ctx, bloom, req.Header.GetHeight()-1) + err := k.SetBlockBloomMapping(ctx, bloom, req.Header.GetHeight()-1) + if err != nil { + panic(err) + } k.SetBlockHashMapping(ctx, req.Header.LastBlockId.GetHash(), req.Header.GetHeight()-1) k.Bloom = big.NewInt(0) k.TxCount = 0 diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index 580e631c4..108a45f29 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -54,7 +54,8 @@ func (suite *KeeperTestSuite) TestDBStorage() { // Test block height mapping functionality testBloom := ethtypes.BytesToBloom([]byte{0x1, 0x3}) - suite.app.EvmKeeper.SetBlockBloomMapping(suite.ctx, testBloom, 4) + err := suite.app.EvmKeeper.SetBlockBloomMapping(suite.ctx, testBloom, 4) + suite.Require().NoError(err, "failed to set block bloom mapping") // Get those state transitions suite.Require().Equal(suite.app.EvmKeeper.GetBalance(suite.ctx, address).Cmp(big.NewInt(5)), 0) diff --git a/x/evm/types/state_transition.go b/x/evm/types/state_transition.go index f63e0175e..5554fe026 100644 --- a/x/evm/types/state_transition.go +++ b/x/evm/types/state_transition.go @@ -104,11 +104,17 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*ReturnData, error) { switch contractCreation { case true: ret, addr, leftOverGas, err = evm.Create(senderRef, st.Payload, gasLimit, st.Amount) + if err != nil { + return nil, err + } default: // Increment the nonce for the next transaction (just for evm state transition) csdb.SetNonce(st.Sender, csdb.GetNonce(st.Sender)+1) ret, leftOverGas, err = evm.Call(senderRef, *st.Recipient, st.Payload, gasLimit, st.Amount) + if err != nil { + return nil, err + } } gasConsumed := gasLimit - leftOverGas @@ -123,8 +129,7 @@ func (st StateTransition) TransitionCSDB(ctx sdk.Context) (*ReturnData, error) { if st.THash != nil && !st.Simulate { logs, err = csdb.GetLogs(*st.THash) if err != nil { - // TODO: handle error - logs = nil + return nil, err } bloomInt = ethtypes.LogsBloom(logs) bloomFilter = ethtypes.BytesToBloom(bloomInt.Bytes()) From a22277ecb2ce419191c87839bb15a9955a3d66c1 Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 17 Mar 2020 11:17:46 -0400 Subject: [PATCH 26/31] fix handler test --- x/evm/handler.go | 17 ++-- x/evm/handler_test.go | 218 +++++++++++++++--------------------------- 2 files changed, 88 insertions(+), 147 deletions(-) diff --git a/x/evm/handler.go b/x/evm/handler.go index 766602485..2a9804ad4 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -19,17 +19,17 @@ func NewHandler(k Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { switch msg := msg.(type) { case types.MsgEthereumTx: - return handleEthTxMsg(ctx, k, msg) + return HandleEthTxMsg(ctx, k, msg) case types.MsgEthermint: - return handleMsgEthermint(ctx, k, msg) + return HandleMsgEthermint(ctx, k, msg) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ethermint message type: %T", msg) } } } -// handleEthTxMsg handles an Ethereum specific tx -func handleEthTxMsg(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*sdk.Result, error) { +// HandleEthTxMsg handles an Ethereum specific tx +func HandleEthTxMsg(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*sdk.Result, error) { // parse the chainID from a string to a base-10 integer intChainID, ok := new(big.Int).SetString(ctx.ChainID(), 10) if !ok { @@ -83,6 +83,11 @@ func handleEthTxMsg(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*sdk.Re return nil, err } + signer, err := msg.VerifySig(big.NewInt(3)) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeEthereumTx, @@ -91,7 +96,7 @@ func handleEthTxMsg(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*sdk.Re sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.GetSigners()[0].String()), + sdk.NewAttribute(sdk.AttributeKeySender, signer.String()), ), }) @@ -109,7 +114,7 @@ func handleEthTxMsg(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*sdk.Re return returnData.Result, nil } -func handleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk.Result, error) { +func HandleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk.Result, error) { // parse the chainID from a string to a base-10 integer intChainID, ok := new(big.Int).SetString(ctx.ChainID(), 10) if !ok { diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 067968845..9a6f5326d 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -1,154 +1,90 @@ -package evm +package evm_test -// import ( -// "math/big" -// "testing" -// "time" +import ( + "math/big" + "testing" + "time" -// "github.com/stretchr/testify/suite" + "github.com/stretchr/testify/suite" -// sdk "github.com/cosmos/cosmos-sdk/types" + sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/ethermint/app" -// "github.com/cosmos/ethermint/crypto" -// "github.com/cosmos/ethermint/x/evm/keeper" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" -// ethcmn "github.com/ethereum/go-ethereum/common" -// ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/cosmos/ethermint/app" + "github.com/cosmos/ethermint/x/evm" + "github.com/cosmos/ethermint/x/evm/keeper" + "github.com/cosmos/ethermint/x/evm/types" -// abci "github.com/tendermint/tendermint/abci/types" -// ) + abci "github.com/tendermint/tendermint/abci/types" +) -// pragma solidity ^0.5.1; +type EvmTestSuite struct { + suite.Suite -// contract Test { -// event Hello(uint256 indexed world); + ctx sdk.Context + querier sdk.Querier + app *app.EthermintApp +} -// constructor() public { -// emit Hello(17); -// } -// } +func (suite *EvmTestSuite) SetupTest() { + checkTx := false -// { -// "linkReferences": {}, -// "object": "6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029", -// "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x11 PUSH32 0x775A94827B8FD9B519D36CD827093C664F93347070A554F65E4A6F56CD738898 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x35 DUP1 PUSH1 0x4B PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH13 0xAB665F0F557620554BB45ADF26 PUSH8 0x8D2BD349B8A4314 0xbd SELFDESTRUCT KECCAK256 0x5e 0xe8 DIFFICULTY 0xe EXTCODECOPY 0x24 STOP 0x29 ", -// "sourceMap": "25:119:0:-;;;90:52;8:9:-1;5:2;;;30:1;27;20:12;5:2;90:52:0;132:2;126:9;;;;;;;;;;25:119;;;;;;" -// } + suite.app = app.Setup(checkTx) + suite.ctx = suite.app.BaseApp.NewContext(checkTx, abci.Header{Height: 1, ChainID: "3", Time: time.Now().UTC()}) + suite.querier = keeper.NewQuerier(suite.app.EvmKeeper) +} -// type EvmTestSuite struct { -// suite.Suite +func TestEvmTestSuite(t *testing.T) { + suite.Run(t, new(EvmTestSuite)) +} -// ctx sdk.Context -// querier sdk.Querier -// app *app.EthermintApp -// } +func (suite *EvmTestSuite) TestHandler_Logs() { + // Test contract: -// func (suite *EvmTestSuite) SetupTest() { -// checkTx := false - -// suite.app = app.Setup(checkTx) -// suite.ctx = suite.app.BaseApp.NewContext(checkTx, abci.Header{Height: 1, ChainID: "3", Time: time.Now().UTC()}) -// suite.querier = keeper.NewQuerier(suite.app.EvmKeeper) -// } - -// func TestEvmTestSuite(t *testing.T) { -// suite.Run(t, new(EvmTestSuite)) -// } - -// func (suite *EvmTestSuite) TestHandler_Logs() { -// // Perform state transitions -// // suite.app.EvmKeeper.CreateAccount(suite.ctx, address) -// // suite.app.EvmKeeper.SetBalance(suite.ctx, address, big.NewInt(5)) -// // suite.app.EvmKeeper.SetNonce(suite.ctx, address, 4) - -// priv1, _ := crypto.GenerateKey() -// bytecode := common.FromHex("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029") -// tx := evmtypes.NewEthereumTxMsg(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode) -// tx.Sign(big.NewInt(1), priv1.ToECDSA()) - -// result := handleETHTxMsg(ctx, suite.App.EvmKeeper, *tx) -// resultData, err := evmtypes.DecodeResultData(result.Data) -// suite.Require().NoError(err, "failed to decode result data") - -// suite.Require().Equal(len(resultData.Logs), 1) -// suite.Require().Equal(len(resultData.Logs[0].Topics), 2) - -// hash := []byte{1} -// err = ek.SetTransactionLogs(ctx, resultData.Logs, hash) -// suite.Require().NoError(err, "failed to set logs") - -// logs, err := ek.GetTransactionLogs(ctx, hash) -// suite.Require().NoError(err, "failed to get logs") - -// suite.Require().Equal(logs, resultData.Logs) -// } - -// func TestHandler_Logs(t *testing.T) { -// // create logger, codec and root multi-store -// cdc := newTestCodec() - -// // The ParamsKeeper handles parameter storage for the application -// keyParams := sdk.NewKVStoreKey(params.StoreKey) -// tkeyParams := sdk.NewTransientStoreKey(params.TStoreKey) -// paramsKeeper := params.NewKeeper(cdc, keyParams, tkeyParams, params.DefaultCodespace) -// // Set specific supspaces -// authSubspace := paramsKeeper.Subspace(auth.DefaultParamspace) -// ak := auth.NewAccountKeeper(cdc, accKey, authSubspace, eminttypes.ProtoBaseAccount) -// ek := NewKeeper(ak, storageKey, codeKey, blockKey, cdc) - -// gasLimit := uint64(100000) -// gasPrice := big.NewInt(1000000) - -// priv1, _ := crypto.GenerateKey() - -// bytecode := common.FromHex("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029") - -// tx := evmtypes.NewEthereumTxMsg(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode) -// tx.Sign(big.NewInt(1), priv1.ToECDSA()) - -// db := dbm.NewMemDB() -// cms := store.NewCommitMultiStore(db) -// keys := []*sdk.KVStoreKey{accKey, storageKey, codeKey, blockKey} -// for _, key := range keys { -// cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, nil) -// } - -// err := cms.LoadLatestVersion() -// if err != nil { -// t.Fatal(err) -// } - -// ms := cms.CacheMultiStore() -// ctx := sdk.NewContext(ms, abci.Header{}, false, logger) -// ctx = ctx.WithBlockHeight(1).WithChainID("1") - -// result := handleETHTxMsg(ctx, ek, *tx) -// resultData, err := evmtypes.DecodeResultData(result.Data) -// if err != nil { -// t.Fatal(err) -// } - -// if len(resultData.Logs) != 1 { -// t.Fatal("Fail: expected 1 log") -// } - -// if len(resultData.Logs[0].Topics) != 2 { -// t.Fatal("Fail: expected 2 topics") -// } - -// hash := []byte{1} -// err = ek.SetTransactionLogs(ctx, resultData.Logs, hash) -// if err != nil { -// t.Fatal(err) -// } - -// logs, err := ek.GetTransactionLogs(ctx, hash) -// if err != nil { -// t.Fatal(err) -// } - -// if !reflect.DeepEqual(logs, resultData.Logs) { -// t.Fatalf("Fail: got %v expected %v", logs, resultData.Logs) -// } -// } + // pragma solidity ^0.5.1; + + // contract Test { + // event Hello(uint256 indexed world); + + // constructor() public { + // emit Hello(17); + // } + // } + + // { + // "linkReferences": {}, + // "object": "6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029", + // "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x11 PUSH32 0x775A94827B8FD9B519D36CD827093C664F93347070A554F65E4A6F56CD738898 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 PUSH1 0x35 DUP1 PUSH1 0x4B PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG1 PUSH6 0x627A7A723058 KECCAK256 PUSH13 0xAB665F0F557620554BB45ADF26 PUSH8 0x8D2BD349B8A4314 0xbd SELFDESTRUCT KECCAK256 0x5e 0xe8 DIFFICULTY 0xe EXTCODECOPY 0x24 STOP 0x29 ", + // "sourceMap": "25:119:0:-;;;90:52;8:9:-1;5:2;;;30:1;27;20:12;5:2;90:52:0;132:2;126:9;;;;;;;;;;25:119;;;;;;" + // } + + gasLimit := uint64(100000) + gasPrice := big.NewInt(1000000) + + priv, err := crypto.GenerateKey() + suite.Require().NoError(err, "failed to create key") + + bytecode := common.FromHex("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029") + tx := types.NewMsgEthereumTx(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode) + tx.Sign(big.NewInt(3), priv) + + result, err := evm.HandleEthTxMsg(suite.ctx, suite.app.EvmKeeper, *tx) + suite.Require().NoError(err, "failed to handle eth tx msg") + + resultData, err := types.DecodeResultData(result.Data) + suite.Require().NoError(err, "failed to decode result data") + + suite.Require().Equal(len(resultData.Logs), 1) + suite.Require().Equal(len(resultData.Logs[0].Topics), 2) + + hash := []byte{1} + err = suite.app.EvmKeeper.SetTransactionLogs(suite.ctx, resultData.Logs, hash) + suite.Require().NoError(err, "failed to set logs") + + logs, err := suite.app.EvmKeeper.GetTransactionLogs(suite.ctx, hash) + suite.Require().NoError(err, "failed to get logs") + + suite.Require().Equal(logs, resultData.Logs) +} From 6a9e1bf58ce584ae88bf3e5658ca8c8c84091f84 Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 17 Mar 2020 18:35:14 -0400 Subject: [PATCH 27/31] address comments --- x/evm/handler_test.go | 5 ++--- x/evm/keeper/querier.go | 30 +++++++++++++++--------------- x/evm/types/key.go | 11 +++++++++++ x/evm/types/utils.go | 13 +------------ 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 9a6f5326d..bc3c95613 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -14,7 +14,6 @@ import ( "github.com/cosmos/ethermint/app" "github.com/cosmos/ethermint/x/evm" - "github.com/cosmos/ethermint/x/evm/keeper" "github.com/cosmos/ethermint/x/evm/types" abci "github.com/tendermint/tendermint/abci/types" @@ -24,7 +23,7 @@ type EvmTestSuite struct { suite.Suite ctx sdk.Context - querier sdk.Querier + handler sdk.Handler app *app.EthermintApp } @@ -33,7 +32,7 @@ func (suite *EvmTestSuite) SetupTest() { suite.app = app.Setup(checkTx) suite.ctx = suite.app.BaseApp.NewContext(checkTx, abci.Header{Height: 1, ChainID: "3", Time: time.Now().UTC()}) - suite.querier = keeper.NewQuerier(suite.app.EvmKeeper) + suite.handler = evm.NewHandler(suite.app.EvmKeeper) } func TestEvmTestSuite(t *testing.T) { diff --git a/x/evm/keeper/querier.go b/x/evm/keeper/querier.go index ad81d9813..0aca0aa0c 100644 --- a/x/evm/keeper/querier.go +++ b/x/evm/keeper/querier.go @@ -1,6 +1,7 @@ package keeper import ( + "fmt" "strconv" "github.com/cosmos/cosmos-sdk/codec" @@ -51,7 +52,7 @@ func queryProtocolVersion(keeper Keeper) ([]byte, error) { bz, err := codec.MarshalJSONIndent(keeper.cdc, hexutil.Uint(vers)) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -64,7 +65,7 @@ func queryBalance(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) res := types.QueryResBalance{Balance: utils.MarshalBigInt(balance)} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -75,7 +76,7 @@ func queryBlockNumber(ctx sdk.Context, keeper Keeper) ([]byte, error) { bnRes := types.QueryResBlockNumber{Number: num} bz, err := codec.MarshalJSONIndent(keeper.cdc, bnRes) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -88,7 +89,7 @@ func queryStorage(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) res := types.QueryResStorage{Value: val.Bytes()} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil } @@ -99,7 +100,7 @@ func queryCode(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) { res := types.QueryResCode{Code: code} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -111,7 +112,7 @@ func queryNonce(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) { nRes := types.QueryResNonce{Nonce: nonce} bz, err := codec.MarshalJSONIndent(keeper.cdc, nRes) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -124,7 +125,7 @@ func queryHashToHeight(ctx sdk.Context, path []string, keeper Keeper) ([]byte, e res := types.QueryResBlockNumber{Number: blockNumber} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -133,18 +134,18 @@ func queryHashToHeight(ctx sdk.Context, path []string, keeper Keeper) ([]byte, e func queryBlockLogsBloom(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) { num, err := strconv.ParseInt(path[1], 10, 64) if err != nil { - panic("could not unmarshall block number: " + err.Error()) + return nil, fmt.Errorf("could not unmarshall block number: %s" + err.Error()) } bloom, err := keeper.GetBlockBloomMapping(ctx, num) if err != nil { - panic("failed to get block bloom mapping: " + err.Error()) + return nil, fmt.Errorf("failed to get block bloom mapping: %s" + err.Error()) } res := types.QueryBloomFilter{Bloom: bloom} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -154,14 +155,13 @@ func queryTxLogs(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) txHash := ethcmn.HexToHash(path[1]) logs, err := keeper.GetLogs(ctx, txHash) if err != nil { - // TODO: handle err - return nil, nil + return nil, err } res := types.QueryETHLogs{Logs: logs} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil @@ -173,7 +173,7 @@ func queryLogs(ctx sdk.Context, keeper Keeper) ([]byte, error) { res := types.QueryETHLogs{Logs: logs} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil } @@ -189,7 +189,7 @@ func queryAccount(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) } bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil { - panic(sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())) + return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } return bz, nil } diff --git a/x/evm/types/key.go b/x/evm/types/key.go index d9527d9f1..cd1501ee2 100644 --- a/x/evm/types/key.go +++ b/x/evm/types/key.go @@ -14,3 +14,14 @@ const ( // RouterKey uses module name for routing RouterKey = ModuleName ) + +var bloomPrefix = []byte("bloom") +var logsPrefix = []byte("logs") + +func BloomKey(key []byte) []byte { + return append(bloomPrefix, key...) +} + +func LogsKey(key []byte) []byte { + return append(logsPrefix, key...) +} diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 86c6c5e72..4da976cc4 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -13,17 +13,6 @@ import ( "golang.org/x/crypto/sha3" ) -var bloomPrefix = []byte("bloom") -var logsPrefix = []byte("logs") - -func BloomKey(key []byte) []byte { - return append(bloomPrefix, key...) -} - -func LogsKey(key []byte) []byte { - return append(logsPrefix, key...) -} - // GenerateEthAddress generates an Ethereum address. func GenerateEthAddress() ethcmn.Address { priv, err := crypto.GenerateKey() @@ -58,7 +47,7 @@ func rlpHash(x interface{}) (hash ethcmn.Hash) { return hash } -// ResultData represents the data returned in an comsos-sdk/types.Result +// ResultData represents the data returned in an sdk.Result type ResultData struct { Address ethcmn.Address Bloom ethtypes.Bloom From 5e615f4bb3f3435ffb80458c163b31fc454adf1b Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 17 Mar 2020 18:41:17 -0400 Subject: [PATCH 28/31] use amino --- x/evm/types/utils.go | 15 +++++++++------ x/evm/types/utils_test.go | 7 +++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 4da976cc4..347984acb 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -8,6 +8,7 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" + amino "github.com/tendermint/go-amino" "github.com/pkg/errors" "golang.org/x/crypto/sha3" @@ -56,28 +57,30 @@ type ResultData struct { } // EncodeReturnData takes all of the necessary data from the EVM execution -// and returns the data as a byte slice +// and returns the data as a byte slice encoded with amino func EncodeResultData(data *ResultData) ([]byte, error) { - return rlp.EncodeToBytes(data) + return amino.NewCodec().MarshalBinaryLengthPrefixed(data) } -// DecodeReturnData decodes the byte slice of values to their respective types +// DecodeReturnData decodes an amino-encoded byte slice into ReturnData func DecodeResultData(in []byte) (ResultData, error) { data := new(ResultData) - err := rlp.DecodeBytes(in, data) + err := amino.NewCodec().UnmarshalBinaryLengthPrefixed(in, data) if err != nil { return ResultData{}, err } return *data, nil } +// EncodeLogs encodes an array of logs using amino func EncodeLogs(logs []*ethtypes.Log) ([]byte, error) { - return rlp.EncodeToBytes(logs) + return amino.NewCodec().MarshalBinaryLengthPrefixed(logs) } +// DecodeLogs decodes an amino-encoded byte array into an array of logs func DecodeLogs(in []byte) ([]*ethtypes.Log, error) { logs := []*ethtypes.Log{} - err := rlp.DecodeBytes(in, &logs) + err := amino.NewCodec().UnmarshalBinaryLengthPrefixed(in, &logs) if err != nil { return nil, err } diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index 2f8014080..37cfc1935 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -16,8 +16,11 @@ func TestEvmDataEncoding(t *testing.T) { data := &ResultData{ Address: addr, Bloom: bloom, - Logs: []*ethtypes.Log{}, - Ret: ret, + Logs: []*ethtypes.Log{ðtypes.Log{ + Data: []byte{1, 2, 3, 4}, + BlockNumber: 17, + }}, + Ret: ret, } enc, err := EncodeResultData(data) From 22e16bf66b4aa7cabb0cd63800f6f1558d2ed97c Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 17 Mar 2020 19:15:35 -0400 Subject: [PATCH 29/31] lint --- x/evm/types/utils_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index 37cfc1935..789d87a3b 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -16,7 +16,7 @@ func TestEvmDataEncoding(t *testing.T) { data := &ResultData{ Address: addr, Bloom: bloom, - Logs: []*ethtypes.Log{ðtypes.Log{ + Logs: []*ethtypes.Log{{ Data: []byte{1, 2, 3, 4}, BlockNumber: 17, }}, From a9ecb7f4dd8909a8b2149cec91028aa0fcba25f0 Mon Sep 17 00:00:00 2001 From: noot Date: Wed, 18 Mar 2020 10:16:06 -0400 Subject: [PATCH 30/31] address comments --- x/evm/handler.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x/evm/handler.go b/x/evm/handler.go index 2a9804ad4..21dde7910 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -83,11 +83,6 @@ func HandleEthTxMsg(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*sdk.Re return nil, err } - signer, err := msg.VerifySig(big.NewInt(3)) - if err != nil { - return nil, err - } - ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeEthereumTx, @@ -96,7 +91,7 @@ func HandleEthTxMsg(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*sdk.Re sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, signer.String()), + sdk.NewAttribute(sdk.AttributeKeySender, sender.String()), ), }) From 4a8e64a05cdf415298479654b120fcf21738de3c Mon Sep 17 00:00:00 2001 From: noot Date: Wed, 18 Mar 2020 10:17:11 -0400 Subject: [PATCH 31/31] merge --- go.sum | 141 --------------------------------------------------------- 1 file changed, 141 deletions(-) diff --git a/go.sum b/go.sum index b6eaedc72..d853956d7 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,10 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/99designs/keyring v1.1.3 h1:mEV3iyZWjkxQ7R8ia8GcG97vCX5zQQ7n4o8R2BylwQY= github.com/99designs/keyring v1.1.3/go.mod h1:657DQuMrBZRtuL/voxVyiyb6zpMehlm5vLB9Qwrv904= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f h1:4O1om+UVU+Hfcihr1timk8YNXHxzZWgCo7ofnrZRApw= github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -19,18 +17,15 @@ github.com/aristanetworks/goarista v0.0.0-20181101003910-5bb443fba8e0/go.mod h1: github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d h1:1aAija9gr0Hyv4KfQcRcwlmFIrhkDmIj2dz5bkg/s/8= github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d/go.mod h1:icNx/6QdFblhsEjZehARqbNumymUT/ydwlLojFdv7Sk= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d h1:xG8Pj6Y6J760xwETNmMzmlt38QSwz0BLp1cZ09g27uw= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8 h1:mOg8/RgDSHTQ1R0IR+LMDuW4TDShPv+JzYHuR4GLoNA= github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a h1:RQMUrEILyYJEoAT34XS/kLu40vC0+po/UfxrBBA4qZE= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -40,10 +35,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -51,21 +44,14 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191213112149-d7b0f4b9b4fb h1:zVivJCmI6SF3DmxlhY94trezOyfPXtiIDxCH3VPFXHY= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191213112149-d7b0f4b9b4fb/go.mod h1:hasIdlU9b3FEFCWpoStvNQQPg1ZpAKnpmlFklAk1W1o= github.com/cosmos/cosmos-sdk v0.38.1 h1:DTuxIJeMpB//ydq+ObAjQgsaiwYBZ8T7NDzXjyiL1Kg= github.com/cosmos/cosmos-sdk v0.38.1/go.mod h1:9ZZex0GKpyNCvilvVAPBoB+0n3A/aO1+/UhPVEaiCy4= -github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8 h1:Iwin12wRQtyZhH6FV3ykFcdGNlYEzoeR0jN8Vn+JWsI= -github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= -github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= -github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -77,44 +63,27 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dvsekhvalnov/jose2go v0.0.0-20180829124132-7f401d37b68a h1:mq+R6XEM6lJX5VlLyZIrUSP8tSuJp82xTK89hvBwJbU= github.com/dvsekhvalnov/jose2go v0.0.0-20180829124132-7f401d37b68a/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= -github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 h1:aaQcKT9WumO6JEJcRyTqFVq4XUZiUcKR2/GI31TOcz8= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/gosigar v0.10.3 h1:xA7TJmJgaVgqEnQpYAijMI4J9V1ZM2a9z8+5gAc5FMs= github.com/elastic/gosigar v0.10.3/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.2 h1:RLRQ0TKLX7DlBRXAJHvbmXL17Q3KNnTBtZ9B6Qo+/Y0= -github.com/etcd-io/bbolt v1.3.2/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/go-ethereum v1.9.0 h1:9Kaf7UfDkV3aIUJlf14hI/GgEgRAUq60u4fBlb9dLWw= github.com/ethereum/go-ethereum v1.9.0/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/kit v0.6.0 h1:wTifptAGIyIuir4bRyN4h7+kAa2a4eepLYVmRe5qqQ8= -github.com/go-kit/kit v0.6.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0 h1:8HUsc87TaSWLKwrnumgC8/YconD2fJQsRJAsWaPg2ic= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -122,23 +91,16 @@ github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129 h1:tT8iWCYw4uOem71yYA3htfH+LNopJvcqZQshm56G5L4= github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0 h1:kbxbvI4Un1LUWKxufD+BiE6AEExYYgkQLQmLFqA1LFk= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= @@ -149,22 +111,12 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -<<<<<<< HEAD -github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= -======= ->>>>>>> cc591342da28d9693598bd7055e05d63988b7e62 github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -177,32 +129,23 @@ github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f h1:8N8XWLZelZNibkhM github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jackpal/go-nat-pmp v1.0.1 h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/karalabe/usb v0.0.0-20190703133951-9be757f914c0 h1:S8kWZLXHpcOq3nGAvIs0oDgd4CXxkxE3hkDVRjTu7ro= github.com/karalabe/usb v0.0.0-20190703133951-9be757f914c0/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -210,21 +153,16 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= @@ -248,7 +186,6 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= @@ -267,7 +204,6 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -281,25 +217,19 @@ github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.9.1 h1:IWaAmWkYlgG7/S4iw4IpAQt5Y35QaZM6/GsZ7GsjAuk= github.com/prometheus/tsdb v0.9.1/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= -github.com/rakyll/statik v0.1.6 h1:uICcfUXpgqtw2VopbIncslhAmE5hwc4g20TEyEENBNs= github.com/rakyll/statik v0.1.6/go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs= github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962 h1:eUm8ma4+yPknhXtkYlWh3tMkE6gBjXZToDned9s2gbQ= github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rs/cors v1.6.0 h1:G9tHG9lebljV9mfp9SNPDL36nCDxmo3zTlAf1YgvzmI= -github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -320,23 +250,11 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -<<<<<<< HEAD -github.com/spf13/viper v1.0.0 h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I= -github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= -github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.5.0 h1:GpsTwfsQ27oS/Aha/6d1oD7tpKIqWnOA6tgOX9HHkt4= -github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= -github.com/spf13/viper v1.6.1 h1:VPZzIkznI1YhVMRi6vNFLHSwhnhReBfgTxIPccpfdZk= -======= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= ->>>>>>> cc591342da28d9693598bd7055e05d63988b7e62 github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/spf13/viper v1.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E= github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= -github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 h1:ju5UTwk5Odtm4trrY+4Ca4RMj5OyXbmVeDAVad2T0Jw= github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= @@ -344,19 +262,14 @@ github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639 github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stumble/gorocksdb v0.0.3 h1:9UU+QA1pqFYJuf9+5p7z1IqdE5k0mma4UAeu2wmX8kA= -github.com/stumble/gorocksdb v0.0.3/go.mod h1:v6IHdFBXk5DJ1K4FZ0xi+eY737quiiBxYtSWXadLybY= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= -github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/tecbot/gorocksdb v0.0.0-20191017175515-d217d93fd4c5/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= @@ -367,34 +280,21 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= github.com/tendermint/go-amino v0.15.1 h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN+4JgQ= github.com/tendermint/go-amino v0.15.1/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/iavl v0.12.4 h1:hd1woxUGISKkfUWBA4mmmTwOua6PQZTJM/F0FDrmMV8= -github.com/tendermint/iavl v0.12.4/go.mod h1:8LHakzt8/0G3/I8FUU0ReNx98S/EP6eyPJkAUvEXT/o= github.com/tendermint/iavl v0.13.0 h1:r2sINvNFlJsLlLhGoqlqPlREWYkuK26BvMfkBt+XQnA= github.com/tendermint/iavl v0.13.0/go.mod h1:7nSUPdrsHEZ2nNZa+9gaIrcJciWd1jCQZXtcyARU82k= -github.com/tendermint/tendermint v0.32.1/go.mod h1:jmPDAKuNkev9793/ivn/fTBnfpA9mGBww8MPRNPNxnU= -github.com/tendermint/tendermint v0.32.8 h1:eOaLJGRi5x/Rb23fiVsxq9c5fZ/6O5QplExlGjNPDVI= -github.com/tendermint/tendermint v0.32.8/go.mod h1:5/B1XZjNYtVBso8o1l/Eg4A0Mhu42lDcmftoQl95j/E= github.com/tendermint/tendermint v0.33.0 h1:TW1g9sQs3YSqKM8o1+opL3/VmBy4Ke/VKV9MxYpqNbI= github.com/tendermint/tendermint v0.33.0/go.mod h1:s5UoymnPIY+GcA3mMte4P9gpMP8vS7UH7HBXikT1pHI= -github.com/tendermint/tm-db v0.1.1 h1:G3Xezy3sOk9+ekhjZ/kjArYIs1SmwV+1OUgNkj7RgV0= -github.com/tendermint/tm-db v0.1.1/go.mod h1:0cPKWu2Mou3IlxecH+MEUSYc1Ch537alLe6CpFrKzgw= -github.com/tendermint/tm-db v0.2.0 h1:rJxgdqn6fIiVJZy4zLpY1qVlyD0TU6vhkT4kEf71TQQ= -github.com/tendermint/tm-db v0.2.0/go.mod h1:0cPKWu2Mou3IlxecH+MEUSYc1Ch537alLe6CpFrKzgw= github.com/tendermint/tm-db v0.4.0 h1:iPbCcLbf4nwDFhS39Zo1lpdS1X/cT9CkTlUx17FHQgA= github.com/tendermint/tm-db v0.4.0/go.mod h1:+Cwhgowrf7NBGXmsqFMbwEtbo80XmyrlY5Jsk95JubQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tyler-smith/go-bip39 v1.0.0 h1:FOHg9gaQLeBBRbHE/QrTLfEiBHy5pQ/yXzf9JG5pYFM= github.com/tyler-smith/go-bip39 v1.0.0/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 h1:1cngl9mPEoITZG8s8cVcUy5CeIBYhEESkOB7m6Gmkrk= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -402,12 +302,8 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -417,7 +313,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1 h1:Y/KGZSOdz/2r0WJ9Mkmz6NJBusp0kiNx1Cn82lzJQ6w= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -426,10 +321,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -437,12 +329,10 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7 h1:bit1t3mgdR35yN0cX0G8orgLtOuyL9Wqxa1mccLB0ig= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -452,15 +342,8 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -472,58 +355,34 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262 h1:qsl9y/CJx34tuA7QCPNp86JNJe4spst6Ff8MjvPUdPg= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.13.0 h1:bHIbVsCwmvbArgCJmLdgOdHFXlKqTOVjbibbS19cXHc= -google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -<<<<<<< HEAD -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -======= ->>>>>>> cc591342da28d9693598bd7055e05d63988b7e62 gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=