Documentation ¶
Index ¶
- Constants
- Variables
- func CIDForGenesisTransactionID(txid []byte) int
- func MeasureBytesOfData(rev module.Revision, data []byte) (int, error)
- func NewTransactionListFromHash(d db.Database, h []byte) module.TransactionList
- func NewTransactionListFromSlice(dbase db.Database, list []module.Transaction) module.TransactionList
- func NewTransactionListV1FromSlice(list []module.Transaction) module.TransactionList
- func NewTransactionListWithBuilder(builder merkle.Builder, h []byte) module.TransactionList
- func RegisterFactory(f *Factory)
- func SerializeJSON(s []byte, in map[string]bool, exclude map[string]bool) ([]byte, error)
- func SerializeMap(d map[string]interface{}, i map[string]bool, e map[string]bool) ([]byte, error)
- func SerializeValue(v interface{}) ([]byte, error)
- func Unwrap(t module.Transaction) module.Transaction
- type Factory
- type GenesisTransaction
- type Handler
- type SerializeError
- type Transaction
- type TransactionListV1
Constants ¶
View Source
const ( InvalidGenesisError = iota + errors.CodeService + 100 InvalidSignatureError InvalidVersion InvalidTxValue InvalidFormat NotEnoughStepError NotEnoughBalanceError ContractNotUsable AccessDeniedError )
View Source
const ( ICONMainNetGenesisID = "5aa2453a84ba2fb1e3394b9e3471f5dcebc6225fc311a97ca505728153b9d246" ICONMainNetCID = 1 )
View Source
const ( Version2 = 2 Version3 = 3 )
Variables ¶
View Source
var ICONMainNetGenesisIDBytes, _ = hex.DecodeString(ICONMainNetGenesisID)
View Source
var TransactionType = reflect.TypeOf((*transaction)(nil))
Functions ¶
func NewTransactionListFromHash ¶
func NewTransactionListFromHash(d db.Database, h []byte) module.TransactionList
func NewTransactionListFromSlice ¶
func NewTransactionListFromSlice(dbase db.Database, list []module.Transaction) module.TransactionList
func NewTransactionListV1FromSlice ¶
func NewTransactionListV1FromSlice(list []module.Transaction) module.TransactionList
func NewTransactionListWithBuilder ¶
func NewTransactionListWithBuilder(builder merkle.Builder, h []byte) module.TransactionList
func RegisterFactory ¶ added in v0.9.1
func RegisterFactory(f *Factory)
func SerializeJSON ¶
func SerializeMap ¶
func SerializeValue ¶ added in v0.9.1
func Unwrap ¶ added in v0.9.6
func Unwrap(t module.Transaction) module.Transaction
Types ¶
type GenesisTransaction ¶
type GenesisTransaction interface { Transaction CID() int NID() int }
func NewGenesisTransaction ¶
func NewGenesisTransaction(b []byte) (GenesisTransaction, error)
type Handler ¶
type Handler interface { Prepare(ctx contract.Context) (state.WorldContext, error) Execute(ctx contract.Context, estimate bool) (txresult.Receipt, error) Dispose() }
func NewHandler ¶
type SerializeError ¶
type SerializeError struct {
// contains filtered or unexported fields
}
func (*SerializeError) Error ¶
func (s *SerializeError) Error() string
type Transaction ¶
type Transaction interface { module.Transaction PreValidate(wc state.WorldContext, update bool) error GetHandler(cm contract.ContractManager) (Handler, error) Timestamp() int64 Nonce() *big.Int To() module.Address IsSkippable() bool }
TODO It assumes normal transaction. When supporting patch, add skipping timestamp checking for it at PreValidate().
func NewPatchTransaction ¶
func NewTransaction ¶
func NewTransaction(b []byte) (Transaction, error)
func NewTransactionFromJSON ¶
func NewTransactionFromJSON(b []byte) (Transaction, error)
func Wrap ¶ added in v0.9.4
func Wrap(t Transaction) Transaction
type TransactionListV1 ¶
type TransactionListV1 struct {
// contains filtered or unexported fields
}
func (*TransactionListV1) Equal ¶
func (l *TransactionListV1) Equal(t module.TransactionList) bool
func (*TransactionListV1) Flush ¶
func (l *TransactionListV1) Flush() error
func (*TransactionListV1) Get ¶
func (l *TransactionListV1) Get(i int) (module.Transaction, error)
func (*TransactionListV1) Hash ¶
func (l *TransactionListV1) Hash() []byte
func (*TransactionListV1) Iterator ¶
func (l *TransactionListV1) Iterator() module.TransactionIterator
Click to show internal directories.
Click to hide internal directories.