-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
27 lines (23 loc) · 853 Bytes
/
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
package transaction
import "github.com/Dharitri-org/drtg-core/data/block"
// Encoder represents a byte slice to string encoder
type Encoder interface {
Encode(buff []byte) string
IsInterfaceNil() bool
}
// Marshalizer is able to encode an object to its byte slice representation
type Marshalizer interface {
Marshal(obj interface{}) ([]byte, error)
IsInterfaceNil() bool
}
// StatusComputerHandler computes a transaction status
type StatusComputerHandler interface {
ComputeStatusWhenInStorageKnowingMiniblock(miniblockType block.Type, tx *ApiTransactionResult) (TxStatus, error)
ComputeStatusWhenInStorageNotKnowingMiniblock(destinationShard uint32, tx *ApiTransactionResult) (TxStatus, error)
SetStatusIfIsRewardReverted(
tx *ApiTransactionResult,
miniblockType block.Type,
headerNonce uint64,
headerHash []byte,
) (bool, error)
}