Skip to content

Commit

Permalink
replace tendermint/tendermint with cometbft/cometbft pkg and disable …
Browse files Browse the repository at this point in the history
…local node mode
  • Loading branch information
MonikaCat committed Jan 2, 2024
1 parent b42800f commit 0f91fef
Show file tree
Hide file tree
Showing 22 changed files with 1,147 additions and 1,029 deletions.
2 changes: 1 addition & 1 deletion cmd/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

"github.com/forbole/juno/v5/types"

"github.com/cometbft/cometbft/libs/cli"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/cli"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion database/postgresql/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func Builder(ctx *database.Context) (database.Database, error) {
postgresDb.SetMaxIdleConns(ctx.Cfg.MaxIdleConnections)

return &Database{
Cdc: ctx.EncodingConfig.Marshaler,
Cdc: ctx.EncodingConfig.Codec,
Amino: ctx.EncodingConfig.Amino,

SQL: postgresDb,
Expand Down
160 changes: 97 additions & 63 deletions go.mod

Large diffs are not rendered by default.

429 changes: 257 additions & 172 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion logging/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

"github.com/gogo/protobuf/proto"

tmctypes "github.com/cometbft/cometbft/rpc/core/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
tmctypes "github.com/tendermint/tendermint/rpc/core/types"

"github.com/forbole/juno/v5/modules"
"github.com/forbole/juno/v5/types"
Expand Down
2 changes: 1 addition & 1 deletion logging/logger.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package logging

import (
tmctypes "github.com/cometbft/cometbft/rpc/core/types"
sdk "github.com/cosmos/cosmos-sdk/types"
tmctypes "github.com/tendermint/tendermint/rpc/core/types"

"github.com/forbole/juno/v5/modules"
"github.com/forbole/juno/v5/types"
Expand Down
2 changes: 1 addition & 1 deletion modules/messages/message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"
channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types"
"github.com/gogo/protobuf/proto"

"github.com/forbole/juno/v5/database"
Expand Down
4 changes: 2 additions & 2 deletions modules/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (

"github.com/cosmos/cosmos-sdk/x/authz"

tmctypes "github.com/cometbft/cometbft/rpc/core/types"
tmtypes "github.com/cometbft/cometbft/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/forbole/juno/v5/types"
"github.com/go-co-op/gocron"
tmctypes "github.com/tendermint/tendermint/rpc/core/types"
tmtypes "github.com/tendermint/tendermint/types"
)

// Module represents a generic module without any particular handling of data
Expand Down
2 changes: 1 addition & 1 deletion modules/pruning/handle_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pruning
import (
"fmt"

tmctypes "github.com/tendermint/tendermint/rpc/core/types"
tmctypes "github.com/cometbft/cometbft/rpc/core/types"

"github.com/forbole/juno/v5/database"
"github.com/forbole/juno/v5/types"
Expand Down
2 changes: 1 addition & 1 deletion modules/registrar/registrar.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func NewDefaultRegistrar(parser messages.MessageAddressesParser) *DefaultRegistr
func (r *DefaultRegistrar) BuildModules(ctx Context) modules.Modules {
return modules.Modules{
pruning.NewModule(ctx.JunoConfig, ctx.Database, ctx.Logger),
messages.NewModule(r.parser, ctx.EncodingConfig.Marshaler, ctx.Database),
messages.NewModule(r.parser, ctx.EncodingConfig.Codec, ctx.Database),
telemetry.NewModule(ctx.JunoConfig),
}
}
Expand Down
5 changes: 2 additions & 3 deletions node/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ import (

"github.com/forbole/juno/v5/node"
nodeconfig "github.com/forbole/juno/v5/node/config"
"github.com/forbole/juno/v5/node/local"
"github.com/forbole/juno/v5/node/remote"
)

func BuildNode(cfg nodeconfig.Config, encodingConfig *params.EncodingConfig) (node.Node, error) {
switch cfg.Type {
case nodeconfig.TypeRemote:
return remote.NewNode(cfg.Details.(*remote.Details), encodingConfig.Marshaler)
return remote.NewNode(cfg.Details.(*remote.Details), encodingConfig.Codec)
case nodeconfig.TypeLocal:
return local.NewNode(cfg.Details.(*local.Details), encodingConfig.TxConfig, encodingConfig.Marshaler)
return nil, fmt.Errorf("local node is currently not supported")
case nodeconfig.TypeNone:
return nil, nil

Expand Down
Loading

0 comments on commit 0f91fef

Please sign in to comment.