forked from onflow/flow-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transaction_results.go
35 lines (24 loc) · 1.78 KB
/
transaction_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
package storage
import "github.com/onflow/flow-go/model/flow"
// TransactionResults represents persistent storage for transaction result
type TransactionResults interface {
// BatchStore inserts a batch of transaction result into a batch
BatchStore(blockID flow.Identifier, transactionResults []flow.TransactionResult, batch BatchStorage) error
// ByBlockIDTransactionID returns the transaction result for the given block ID and transaction ID
ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.TransactionResult, error)
// ByBlockIDTransactionIndex returns the transaction result for the given blockID and transaction index
ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.TransactionResult, error)
// ByBlockID gets all transaction results for a block, ordered by transaction index
ByBlockID(id flow.Identifier) ([]flow.TransactionResult, error)
}
// LightTransactionResults represents persistent storage for light transaction result
type LightTransactionResults interface {
// BatchStore inserts a batch of transaction result into a batch
BatchStore(blockID flow.Identifier, transactionResults []flow.LightTransactionResult, batch BatchStorage) error
// ByBlockIDTransactionID returns the transaction result for the given block ID and transaction ID
ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.LightTransactionResult, error)
// ByBlockIDTransactionIndex returns the transaction result for the given blockID and transaction index
ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.LightTransactionResult, error)
// ByBlockID gets all transaction results for a block, ordered by transaction index
ByBlockID(id flow.Identifier) ([]flow.LightTransactionResult, error)
}