Skip to content

Commit

Permalink
Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Oct 27, 2024
1 parent c5f0a24 commit e611e3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
4 changes: 0 additions & 4 deletions relayer/relays/parachain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type SourceConfig struct {
Parachain config.ParachainConfig `mapstructure:"parachain"`
Ethereum config.EthereumConfig `mapstructure:"ethereum"`
Contracts SourceContractsConfig `mapstructure:"contracts"`
ChannelID ChannelID `mapstructure:"channel-id"`
}

type SourceContractsConfig struct {
Expand Down Expand Up @@ -76,9 +75,6 @@ func (c Config) Validate() error {
if c.Source.Contracts.Gateway == "" {
return fmt.Errorf("source contracts setting [Gateway] is not set")
}
if c.Source.ChannelID == [32]byte{} {
return fmt.Errorf("source setting [channel-id] is not set")
}

// Sink
err = c.Sink.Ethereum.Validate()
Expand Down
22 changes: 0 additions & 22 deletions relayer/relays/parachain/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,28 +367,6 @@ func fetchMessageProof(
return MessageProofV2{Message: message, Proof: merkleProof}, nil
}

func (s *Scanner) findLatestNonce(ctx context.Context) (uint64, error) {
// Fetch latest nonce in ethereum gateway
gatewayAddress := common.HexToAddress(s.config.Contracts.Gateway)
gatewayContract, err := contracts.NewGateway(
gatewayAddress,
s.ethConn.Client(),
)
if err != nil {
return 0, fmt.Errorf("create gateway contract for address '%v': %w", gatewayAddress, err)
}

options := bind.CallOpts{
Pending: true,
Context: ctx,
}
ethInboundNonce, _, err := gatewayContract.ChannelNoncesOf(&options, s.config.ChannelID)
if err != nil {
return 0, fmt.Errorf("fetch nonce from gateway contract for channelID '%v': %w", s.config.ChannelID, err)
}
return ethInboundNonce, err
}

func (s *Scanner) isNonceRelayed(ctx context.Context, nonce uint64) (bool, error) {
var isRelayed bool
// Fetch latest nonce in ethereum gateway
Expand Down

0 comments on commit e611e3a

Please sign in to comment.