core: change notify implementation to save notifications

Fixes #453 and makes it possible to refer to these notifications later.
This commit is contained in:
Roman Khimov 2019-11-13 16:55:20 +03:00
parent 9134cc1c37
commit 5ce269c035
7 changed files with 128 additions and 15 deletions

View file

@ -14,16 +14,18 @@ import (
)
type interopContext struct {
bc Blockchainer
trigger byte
block *Block
tx *transaction.Transaction
mem *storage.MemCachedStore
bc Blockchainer
trigger byte
block *Block
tx *transaction.Transaction
mem *storage.MemCachedStore
notifications []NotificationEvent
}
func newInteropContext(trigger byte, bc Blockchainer, s storage.Store, block *Block, tx *transaction.Transaction) *interopContext {
mem := storage.NewMemCachedStore(s)
return &interopContext{bc, trigger, block, tx, mem}
nes := make([]NotificationEvent, 0)
return &interopContext{bc, trigger, block, tx, mem, nes}
}
// All lists are sorted, keep 'em this way, please.