Merge branch 'fedekunze/2819-fix-tx-search' of https://github.com/cosmos/cosmos-sdk into fedekunze/2819-fix-tx-search
Merge branch
This commit is contained in:
commit
8414c344fa
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue