Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HCNET_ASSET_CONTRACT_TOPICS = map[xdr.ScSymbol]EventType{ xdr.ScSymbol("transfer"): EventTypeTransfer, xdr.ScSymbol("mint"): EventTypeMint, xdr.ScSymbol("clawback"): EventTypeClawback, xdr.ScSymbol("burn"): EventTypeBurn, } ErrNotHcnetAssetContract = errors.New("event was not from a Hcnet Asset Contract") ErrEventUnsupported = errors.New("this type of Hcnet Asset Contract event is unsupported") ErrEventIntegrity = errors.New("contract ID doesn't match asset + passphrase") )
View Source
var ErrNotBalanceChangeEvent = errors.New("event doesn't represent a balance change")
View Source
var ErrNotBurnEvent = errors.New("event is not a valid 'burn' event")
View Source
var ErrNotClawbackEvent = errors.New("event is not a valid 'clawback' event")
View Source
var ErrNotMintEvent = errors.New("event is not a valid 'mint' event")
View Source
var ErrNotTransferEvent = errors.New("event is not a valid 'transfer' event")
Functions ¶
func GenerateEvent ¶
func GenerateEvent( type_ EventType, from, to, admin string, asset xdr.Asset, amount *big.Int, passphrase string, ) xdr.ContractEvent
GenerateEvent is a utility function to be used by testing frameworks in order to generate Hcnet Asset Contract events.
To provide a generic interface, there are more arguments than apply to the type, but you should only expect the relevant ones to be set (for example, transfer events have no admin, so it will be ignored). This means you can always pass your set of testing parameters, modify the type, and get the event filled out with the details you expect.
Types ¶
type BurnEvent ¶
type BurnEvent struct { From string Amount xdr.Int128Parts // contains filtered or unexported fields }
type ClawbackEvent ¶
type ClawbackEvent struct { Admin string From string Amount xdr.Int128Parts // contains filtered or unexported fields }
type Event ¶
type Event = xdr.ContractEvent
type HcnetAssetContractEvent ¶
func NewHcnetAssetContractEvent ¶
func NewHcnetAssetContractEvent(event *Event, networkPassphrase string) (HcnetAssetContractEvent, error)
Click to show internal directories.
Click to hide internal directories.