-
Notifications
You must be signed in to change notification settings - Fork 11
/
interface.go
45 lines (34 loc) 路 1.62 KB
/
interface.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
36
37
38
39
40
41
42
43
44
45
package mtg
import (
"context"
"github.com/MixinNetwork/mixin/crypto"
)
type Store interface {
WriteProperty(key, val []byte) error
ReadProperty(key []byte) ([]byte, error)
WriteIteration(ir *Iteration) error
ListIterations() ([]*Iteration, error)
WriteOutput(utxo *Output, traceId string) error
WriteOutputs(utxos []*Output, traceId string) error
ListOutputsForTransaction(traceId string) ([]*Output, error)
ListOutputsForAsset(groupId string, state, assetId string, limit int) ([]*Output, error)
WriteAction(act *Action) error
ListActions(limit int) ([]*UnifiedOutput, error)
WriteTransaction(tx *Transaction) error
ReadTransactionByTraceId(traceId string) (*Transaction, error)
ReadTransactionByHash(hash crypto.Hash) (*Transaction, error)
ListTransactions(state int, limit int) ([]*Transaction, error)
DeleteTransaction(tx *Transaction) error
WriteCollectibleOutput(utxo *CollectibleOutput, traceId string) error
WriteCollectibleOutputs(utxos []*CollectibleOutput, traceId string) error
ListCollectibleOutputsForTransaction(traceId string) ([]*CollectibleOutput, error)
ListCollectibleOutputsForToken(state, tokenId string, limit int) ([]*CollectibleOutput, error)
WriteCollectibleTransaction(traceId string, tx *CollectibleTransaction) error
ReadCollectibleTransaction(traceId string) (*CollectibleTransaction, error)
ReadCollectibleTransactionByHash(hash crypto.Hash) (*CollectibleTransaction, error)
ListCollectibleTransactions(state int, limit int) ([]*CollectibleTransaction, error)
}
type Worker interface {
ProcessOutput(context.Context, *Output)
ProcessCollectibleOutput(context.Context, *CollectibleOutput)
}