-
Notifications
You must be signed in to change notification settings - Fork 177
/
results.go
35 lines (24 loc) · 1.25 KB
/
results.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// (c) 2019 Dapper Labs - ALL RIGHTS RESERVED
package storage
import (
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/storage/badger/transaction"
)
type ExecutionResults interface {
// Store stores an execution result.
Store(result *flow.ExecutionResult) error
// BatchStore stores an execution result in a given batch
BatchStore(result *flow.ExecutionResult, batch BatchStorage) error
// ByID retrieves an execution result by its ID.
ByID(resultID flow.Identifier) (*flow.ExecutionResult, error)
// ByIDTx retrieves an execution result by its ID in the context of the given transaction
ByIDTx(resultID flow.Identifier) func(*transaction.Tx) (*flow.ExecutionResult, error)
// Index indexes an execution result by block ID.
Index(blockID flow.Identifier, resultID flow.Identifier) error
// ForceIndex indexes an execution result by block ID overwriting existing database entry
ForceIndex(blockID flow.Identifier, resultID flow.Identifier) error
// BatchIndex indexes an execution result by block ID in a given batch
BatchIndex(blockID flow.Identifier, resultID flow.Identifier, batch BatchStorage) error
// ByBlockID retrieves an execution result by block ID.
ByBlockID(blockID flow.Identifier) (*flow.ExecutionResult, error)
}