@@ -21,7 +21,7 @@ import (
21
21
22
22
"github.com/blinklabs-io/snek/event"
23
23
24
- "github.com/blinklabs-io/gouroboros"
24
+ ouroboros "github.com/blinklabs-io/gouroboros"
25
25
"github.com/blinklabs-io/gouroboros/ledger"
26
26
ochainsync "github.com/blinklabs-io/gouroboros/protocol/chainsync"
27
27
ocommon "github.com/blinklabs-io/gouroboros/protocol/common"
@@ -36,6 +36,7 @@ type ChainSync struct {
36
36
ntcTcp bool
37
37
intersectTip bool
38
38
intersectPoints []ocommon.Point
39
+ includeCbor bool
39
40
errorChan chan error
40
41
eventChan chan event.Event
41
42
byronEpochBaseSlot uint64
@@ -175,7 +176,7 @@ func (c *ChainSync) handleRollBackward(point ocommon.Point, tip ochainsync.Tip)
175
176
func (c * ChainSync ) handleRollForward (blockType uint , blockData interface {}, tip ochainsync.Tip ) error {
176
177
switch v := blockData .(type ) {
177
178
case ledger.Block :
178
- evt := event .New ("block" , time .Now (), NewBlockEvent (v ))
179
+ evt := event .New ("block" , time .Now (), NewBlockEvent (v , c . includeCbor ))
179
180
c .eventChan <- evt
180
181
case ledger.BlockHeader :
181
182
var blockSlot uint64
@@ -201,10 +202,10 @@ func (c *ChainSync) handleRollForward(blockType uint, blockData interface{}, tip
201
202
if err != nil {
202
203
return err
203
204
}
204
- blockEvt := event .New ("block" , time .Now (), NewBlockEvent (block ))
205
+ blockEvt := event .New ("block" , time .Now (), NewBlockEvent (block , c . includeCbor ))
205
206
c .eventChan <- blockEvt
206
207
for _ , transaction := range block .Transactions () {
207
- txEvt := event .New ("transaction" , time .Now (), NewTransactionEvent (block , transaction ))
208
+ txEvt := event .New ("transaction" , time .Now (), NewTransactionEvent (block , transaction , c . includeCbor ))
208
209
c .eventChan <- txEvt
209
210
}
210
211
}
0 commit comments