Merge branch 'develop' into fedekunze/2819-fix-tx-search

This commit is contained in:
Federico Kunze 2018-11-27 22:56:36 +01:00 committed by GitHub
commit 9751a61b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 17 deletions

View File

@ -80,8 +80,9 @@ IMPROVEMENTS
- #2821 Codespaces are now strings - #2821 Codespaces are now strings
- #2779 Introduce `ValidateBasic` to the `Tx` interface and call it in the ante - #2779 Introduce `ValidateBasic` to the `Tx` interface and call it in the ante
handler. handler.
- #2825 More staking and distribution invariants - #2825 More staking and distribution invariants
- #2912 Print commit ID in hex when commit is synced.
* Tendermint * Tendermint
- #2796 Update to go-amino 0.14.1 - #2796 Update to go-amino 0.14.1

View File

@ -805,7 +805,7 @@ func (app *BaseApp) Commit() (res abci.ResponseCommit) {
commitID := app.cms.Commit() commitID := app.cms.Commit()
// TODO: this is missing a module identifier and dumps byte array // TODO: this is missing a module identifier and dumps byte array
app.Logger.Debug("Commit synced", app.Logger.Debug("Commit synced",
"commit", commitID, "commit", fmt.Sprintf("%X", commitID),
) )
// Reset the Check state to the latest committed // Reset the Check state to the latest committed

View File

@ -127,18 +127,21 @@ func (rs *RestServer) Start(listenAddr string, sslHosts string,
if err != nil { if err != nil {
return return
} }
go rpcserver.StartHTTPAndTLSServer(
rs.log.Info("Starting Gaia Lite REST service...")
rs.log.Info(rs.fingerprint)
err := rpcserver.StartHTTPAndTLSServer(
rs.listener, rs.listener,
rs.Mux, rs.Mux,
certFile, keyFile, certFile, keyFile,
rs.log, rs.log,
) )
rs.log.Info(rs.fingerprint) if err != nil {
rs.log.Info("REST server started") return err
}
} }
// logger.Info("REST server started")
return nil return nil
} }

View File

@ -6,7 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/keys"
codec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth"
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
@ -103,6 +103,7 @@ func (c relayCommander) loop(fromChainID, fromChainNode, toChainID, toChainNode
} }
ingressKey := ibc.IngressSequenceKey(fromChainID) ingressKey := ibc.IngressSequenceKey(fromChainID)
lengthKey := ibc.EgressLengthKey(toChainID)
OUTER: OUTER:
for { for {
@ -120,11 +121,10 @@ OUTER:
panic(err) panic(err)
} }
lengthKey := ibc.EgressLengthKey(toChainID)
egressLengthbz, err := query(fromChainNode, lengthKey, c.ibcStore) egressLengthbz, err := query(fromChainNode, lengthKey, c.ibcStore)
if err != nil { if err != nil {
c.logger.Error("error querying outgoing packet list length", "err", err) c.logger.Error("error querying outgoing packet list length", "err", err)
continue OUTER //TODO replace with continue (I think it should just to the correct place where OUTER is now) continue OUTER // TODO replace with continue (I think it should just to the correct place where OUTER is now)
} }
var egressLength uint64 var egressLength uint64
@ -147,7 +147,7 @@ OUTER:
continue OUTER // TODO replace to break, will break first loop then send back to the beginning (aka OUTER) continue OUTER // TODO replace to break, will break first loop then send back to the beginning (aka OUTER)
} }
err = c.broadcastTx(seq, toChainNode, c.refine(egressbz, i, passphrase)) err = c.broadcastTx(toChainNode, c.refine(egressbz, i, seq, passphrase))
seq++ seq++
@ -166,13 +166,13 @@ func query(node string, key []byte, storeName string) (res []byte, err error) {
} }
// nolint: unparam // nolint: unparam
func (c relayCommander) broadcastTx(seq uint64, node string, tx []byte) error { func (c relayCommander) broadcastTx(node string, tx []byte) error {
_, err := context.NewCLIContext().WithNodeURI(node).BroadcastTx(tx) _, err := context.NewCLIContext().WithNodeURI(node).BroadcastTx(tx)
return err return err
} }
func (c relayCommander) getSequence(node string) uint64 { func (c relayCommander) getSequence(node string) uint64 {
res, err := query(node, c.address, c.accStore) res, err := query(node, auth.AddressStoreKey(c.address), c.accStore)
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -189,7 +189,7 @@ func (c relayCommander) getSequence(node string) uint64 {
return 0 return 0
} }
func (c relayCommander) refine(bz []byte, sequence uint64, passphrase string) []byte { func (c relayCommander) refine(bz []byte, ibcSeq, accSeq uint64, passphrase string) []byte {
var packet ibc.IBCPacket var packet ibc.IBCPacket
if err := c.cdc.UnmarshalBinaryLengthPrefixed(bz, &packet); err != nil { if err := c.cdc.UnmarshalBinaryLengthPrefixed(bz, &packet); err != nil {
panic(err) panic(err)
@ -198,10 +198,10 @@ func (c relayCommander) refine(bz []byte, sequence uint64, passphrase string) []
msg := ibc.IBCReceiveMsg{ msg := ibc.IBCReceiveMsg{
IBCPacket: packet, IBCPacket: packet,
Relayer: c.address, Relayer: c.address,
Sequence: sequence, Sequence: ibcSeq,
} }
txBldr := authtxb.NewTxBuilderFromCLI().WithSequence(sequence).WithCodec(c.cdc) txBldr := authtxb.NewTxBuilderFromCLI().WithSequence(accSeq).WithCodec(c.cdc)
cliCtx := context.NewCLIContext() cliCtx := context.NewCLIContext()
name, err := cliCtx.GetFromName() name, err := cliCtx.GetFromName()