TX_Storage -> DataKey, SC_Transfers -> TransferInternal, TransferExternal
this package exports an interface which is used by blockchain to persist/query data
DataKey
type DataKey struct {
SCID crypto.Key // tx which created the the contract or contract ID
Key Variable
Special bool // whether the value is generic or special , special is used to store DERO value
}
DataAtom
type DataAtom struct {
Key DataKey
Prev_Value Variable // previous Value if any
Value Variable // current value if any
}
TransferInternal
type TransferInternal struct {
Received []uint64
Sent []uint64
}
TransferExternal
// any external tranfers
type TransferExternal struct {
Address string `msgpack:"A,omitempty" json:"A,omitempty"` // transfer to this blob
Amount uint64 `msgpack:"V,omitempty" json:"V,omitempty"` // Amount in Atomic units
}
SC_Transfers
type SC_Transfers struct {
BalanceAtStart uint64 // value at start
TransferI TransferInternal // all internal transfers
TransferE []TransferExternal // all external transfers
}
TX_Storage
// all SC load and store operations will go though this
type TX_Storage struct {
DiskLoader func(DataKey, *uint64) Variable
Atoms []DataAtom // all modification operations have to played/reverse in this order
Keys map[DataKey]Variable // this keeps the in-transit DB updates, just in case we have to discard instantly
Transfers map[crypto.Key]SC_Transfers // all transfers ( internal/external )
}