Skip to content

Commit

Permalink
feat: fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
karlem committed Nov 3, 2023
1 parent afa02c1 commit 0067ffe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/data-node/commands/start/node_pre.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (l *NodeCommand) persistentPre([]string) (err error) {
return fmt.Errorf("failed to verify chain id:%w", err)
}

l.SetupSQLSubscribers(l.Log)
l.SetupSQLSubscribers()

return nil
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/data-node/commands/start/sqlsubscribers.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ func (s *SQLSubscribers) SetupServices(ctx context.Context, log *logging.Logger,
s.paidLiquidityFeesStatsService = service.NewPaidLiquidityFeesStats(s.paidLiquidityFeesStatsStore)
s.partyLockedBalancesService = service.NewPartyLockedBalances(s.partyLockedBalancesStore)
s.partyVestingBalancesService = service.NewPartyVestingBalances(s.partyVestingBalancesStore)

s.transactionResultsSub = sqlsubscribers.NewTransactionResults(log)
s.transactionResultsService = service.NewTransactionResults(s.transactionResultsSub)

toInit := []interface{ Initialise(context.Context) error }{
Expand All @@ -364,7 +366,7 @@ func (s *SQLSubscribers) SetupServices(ctx context.Context, log *logging.Logger,
return nil
}

func (s *SQLSubscribers) SetupSQLSubscribers(log *logging.Logger) {
func (s *SQLSubscribers) SetupSQLSubscribers() {
s.accountSub = sqlsubscribers.NewAccount(s.accountService)
s.assetSub = sqlsubscribers.NewAsset(s.assetService)
s.partySub = sqlsubscribers.NewParty(s.partyService)
Expand Down Expand Up @@ -412,5 +414,4 @@ func (s *SQLSubscribers) SetupSQLSubscribers(log *logging.Logger) {
s.volumeDiscountProgramSub = sqlsubscribers.NewVolumeDiscountProgram(s.volumeDiscountProgramService)
s.paidLiquidityFeesStatsSub = sqlsubscribers.NewPaidLiquidityFeesStats(s.paidLiquidityFeesStatsService)
s.vestingSummarySub = sqlsubscribers.NewVestingBalancesSummary(s.partyVestingBalancesStore, s.partyLockedBalancesStore)
s.transactionResultsSub = sqlsubscribers.NewTransactionResults(log)
}
2 changes: 1 addition & 1 deletion datanode/networkhistory/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ func setupSQLBroker(ctx context.Context, testDbConfig sqlstore.Config, snapshotS
return nil, err
}

subscribers.SetupSQLSubscribers(logging.NewTestLogger())
subscribers.SetupSQLSubscribers()

blockStore := sqlstore.NewBlocks(transactionalConnectionSource)
if err != nil {
Expand Down

0 comments on commit 0067ffe

Please sign in to comment.