Skip to content

Commit

Permalink
refactor: Rename exchange service to sync service for block and header (
Browse files Browse the repository at this point in the history
rollkit#1245)

<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

Closes: rollkit#1246
<!--
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue.
-->

<!--
Please complete the checklist to ensure that the PR is ready to be
reviewed.

IMPORTANT:
PRs should be left in Draft until the below checklist is completed.
-->

- [x] New and updated code has appropriate documentation
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [ ] Visual proof for any user facing features like CLI or
documentation updates
- [x] Linked issues closed with keywords
  • Loading branch information
Manav-Aggarwal authored and chandiniv1 committed Nov 15, 2023
1 parent 4d53ecb commit a958324
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 608 deletions.
282 changes: 0 additions & 282 deletions block/block_exchange.go

This file was deleted.

13 changes: 0 additions & 13 deletions block/block_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,12 @@ func NewBlockSyncService(ctx context.Context, store ds.TxnDatastore, conf config
}, nil
}

<<<<<<<< HEAD:block/block_sync.go
// BlockStore returns the blockstore of the BlockSyncService
func (bSyncService *BlockSyncService) BlockStore() *goheaderstore.Store[*types.Block] {
return bSyncService.blockStore
}

func (bSyncService *BlockSyncService) initBlockStoreAndStartSyncer(ctx context.Context, initial *types.Block) error {
========
// BlockStore returns the blockstore of the BlockExchangeService
func (bExService *BlockExchangeService) BlockStore() *goheaderstore.Store[*types.Block] {
return bExService.blockStore
}

func (bExService *BlockExchangeService) initBlockStoreAndStartSyncer(ctx context.Context, initial *types.Block) error {
>>>>>>>> 2e3215b (Move block/header exchange to block package (#1224)):block/block_exchange.go
if initial == nil {
return fmt.Errorf("failed to initialize the blockstore and start syncer")
}
Expand All @@ -101,11 +92,7 @@ func (bExService *BlockExchangeService) initBlockStoreAndStartSyncer(ctx context

// Initialize block store if needed and broadcasts provided block.
// Note: Only returns an error in case block store can't be initialized. Logs error if there's one while broadcasting.
<<<<<<<< HEAD:block/block_sync.go
func (bSyncService *BlockSyncService) WriteToBlockStoreAndBroadcast(ctx context.Context, block *types.Block) error {
========
func (bExService *BlockExchangeService) WriteToBlockStoreAndBroadcast(ctx context.Context, block *types.Block) error {
>>>>>>>> 2e3215b (Move block/header exchange to block package (#1224)):block/block_exchange.go
// For genesis block initialize the store and start the syncer
if int64(block.Height()) == bSyncService.genesis.InitialHeight {
if err := bSyncService.blockStore.Init(ctx, block); err != nil {
Expand Down
18 changes: 0 additions & 18 deletions block/exchange.go

This file was deleted.

Loading

0 comments on commit a958324

Please sign in to comment.