Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Zaremba <[email protected]>
Signed-off-by: sczembor <[email protected]>
  • Loading branch information
sczembor and robert-zaremba authored Jan 9, 2025
1 parent e62efa9 commit 9d71f19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions native2ika/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

//go:generate msgp

// SignRequest represents a signature request.
type SignRequest struct {
// SignReq represents a signature request.
type SignReq struct {
ID uint64 `msg:"id"`
Payload []byte `msg:"payload"`
DWalletID string `msg:"dwallet_id"`
Expand All @@ -21,10 +21,10 @@ type SignRequest struct {
Timestamp int64 `msg:"time"`
}

type SignRequestBytes []byte
type SignReqBytes []byte

// SignRequestFetcher is an interface for getting sign requests from the Native network.
type SignRequestFetcher interface {
type SignReqFetcher interface {
GetBtcSignRequests(from int, limit int) ([]SignRequest, error)

Check failure on line 28 in native2ika/fetcher.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

undefined: SignRequest

Check failure on line 28 in native2ika/fetcher.go

View workflow job for this annotation

GitHub Actions / Run govulncheck

undefined: SignRequest

Check failure on line 28 in native2ika/fetcher.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

undefined: SignRequest
}

Expand Down
9 changes: 5 additions & 4 deletions nbtc/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ type Relayer struct {
shutdownChan chan struct{}
processTxsTicker *time.Ticker
confirmTxsTicker *time.Ticker
fetchBlocksTicker *time.Ticker
fetcher native2ika.SignRequestFetcher
fetchFrom int
// native Sign Request
signReqTicker *time.Ticker
signReqFetcher native2ika.SignRequestFetcher
signReqStart int
}

// RelayerConfig holds the configuration parameters for the Relayer.
Expand Down Expand Up @@ -95,7 +96,7 @@ func NewRelayer(
shutdownChan: make(chan struct{}),
processTxsTicker: time.NewTicker(relayerConfig.ProcessTxsInterval),
confirmTxsTicker: time.NewTicker(relayerConfig.ConfirmTxsInterval),
fetchBlocksTicker: time.NewTicker(relayerConfig.FetchBlocksInterval),
signReqTicker: time.NewTicker(relayerConfig.FetchBlocksInterval),
fetcher: fetcher,
fetchFrom: relayerConfig.FetchFrom,
}, nil
Expand Down

0 comments on commit 9d71f19

Please sign in to comment.