diff --git a/input/chainsync/block.go b/input/chainsync/block.go index dd6c7da..9eddeb7 100644 --- a/input/chainsync/block.go +++ b/input/chainsync/block.go @@ -25,10 +25,11 @@ type BlockContext struct { } type BlockEvent struct { - BlockBodySize uint64 `json:"blockBodySize"` - IssuerVkey string `json:"issuerVkey"` - BlockHash string `json:"blockHash"` - BlockCbor byteSliceJsonHex `json:"blockCbor,omitempty"` + BlockBodySize uint64 `json:"blockBodySize"` + IssuerVkey string `json:"issuerVkey"` + BlockHash string `json:"blockHash"` + BlockCbor byteSliceJsonHex `json:"blockCbor,omitempty"` + TransactionCount uint64 `json:"transactionCount"` } func NewBlockContext(block ledger.Block, networkMagic uint32) BlockContext { @@ -50,9 +51,10 @@ func NewBlockHeaderContext(block ledger.BlockHeader) BlockContext { func NewBlockEvent(block ledger.Block, includeCbor bool) BlockEvent { evt := BlockEvent{ - BlockBodySize: block.BlockBodySize(), - BlockHash: block.Hash(), - IssuerVkey: block.IssuerVkey().Hash().String(), + BlockBodySize: block.BlockBodySize(), + BlockHash: block.Hash(), + IssuerVkey: block.IssuerVkey().Hash().String(), + TransactionCount: uint64(len(block.Transactions())), } if includeCbor { evt.BlockCbor = block.Cbor() diff --git a/output/notify/notify.go b/output/notify/notify.go index c3d61e8..e454df7 100644 --- a/output/notify/notify.go +++ b/output/notify/notify.go @@ -65,9 +65,10 @@ func (n *NotifyOutput) Start() error { err := beeep.Notify( n.title, fmt.Sprintf( - "New Block!\nBlockNumber: %d, SlotNumber: %d\nHash: %s", + "New Block!\nBlockNumber: %d, SlotNumber: %d, TransactionCount: %d\nHash: %s", bc.BlockNumber, bc.SlotNumber, + be.TransactionCount, be.BlockHash, ), "assets/snek-icon.png",