Skip to content

Commit

Permalink
adds new relayer method (celestiaorg#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed May 9, 2022
1 parent b9ea500 commit 4f1a12c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 8 additions & 0 deletions x/qgb/orchestrator/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ type relayer struct {
evmClient EVMClient
}

func NewRelayer(querier Querier, evmClient EVMClient) (*relayer, error) {
return &relayer{
querier: querier,
bridgeID: types.BridgeId,
evmClient: evmClient,
}, nil
}

func (r *relayer) processValsetEvents(ctx context.Context, valSetChannel <-chan types.Valset) error {
for valset := range valSetChannel {

Expand Down
16 changes: 9 additions & 7 deletions x/qgb/orchestrator/relayer_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package orchestrator

import (
"fmt"
paytypes "github.com/celestiaorg/celestia-app/x/payment/types"
"github.com/celestiaorg/celestia-app/x/qgb/types"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"os"
"strings"
"sync"
"time"

paytypes "github.com/celestiaorg/celestia-app/x/payment/types"
"github.com/cosmos/cosmos-sdk/crypto/keyring"

wrapper "github.com/celestiaorg/quantum-gravity-bridge/ethereum/solidity/wrappers/QuantumGravityBridge.sol"
"github.com/ethereum/go-ethereum/ethclient"
tmlog "github.com/tendermint/tendermint/libs/log"
Expand Down Expand Up @@ -71,15 +71,17 @@ func RelayerCmd() *cobra.Command {
return err
}

// TODO add NewRelayer method
relay := relayer{
bridgeID: types.BridgeId,
evmClient: NewEvmClient(
relay, err := NewRelayer(
querier,
NewEvmClient(
tmlog.NewTMLogger(os.Stdout),
*qgbWrapper,
config.privateKey,
config.evmRPC,
),
)
if err != nil {
return err
}

wg := &sync.WaitGroup{}
Expand Down

0 comments on commit 4f1a12c

Please sign in to comment.