2015-04-13 18:26:41 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2015-04-15 19:14:08 -07:00
|
|
|
// Functions to generate eventId strings
|
|
|
|
|
2015-08-04 13:15:10 -07:00
|
|
|
func EventStringAccInput(addr []byte) string { return fmt.Sprintf("Acc/%X/Input", addr) }
|
|
|
|
func EventStringAccOutput(addr []byte) string { return fmt.Sprintf("Acc/%X/Output", addr) }
|
|
|
|
func EventStringAccCall(addr []byte) string { return fmt.Sprintf("Acc/%X/Call", addr) }
|
|
|
|
func EventStringLogEvent(addr []byte) string { return fmt.Sprintf("Log/%X", addr) }
|
|
|
|
func EventStringPermissions(name string) string { return fmt.Sprintf("Permissions/%s", name) }
|
|
|
|
func EventStringBond() string { return "Bond" }
|
|
|
|
func EventStringUnbond() string { return "Unbond" }
|
|
|
|
func EventStringRebond() string { return "Rebond" }
|
|
|
|
func EventStringDupeout() string { return "Dupeout" }
|
|
|
|
func EventStringNewBlock() string { return "NewBlock" }
|
|
|
|
func EventStringFork() string { return "Fork" }
|
2015-04-13 18:26:41 -07:00
|
|
|
|
2015-04-15 19:14:08 -07:00
|
|
|
// Most event messages are basic types (a block, a transaction)
|
|
|
|
// but some (an input to a call tx or a receive) are more exotic:
|
|
|
|
|
2015-08-04 13:15:10 -07:00
|
|
|
type EventMsgTx struct {
|
2015-05-01 17:26:49 -07:00
|
|
|
Tx Tx `json:"tx"`
|
|
|
|
Return []byte `json:"return"`
|
|
|
|
Exception string `json:"exception"`
|
2015-04-15 19:14:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type CallData struct {
|
2015-05-01 17:26:49 -07:00
|
|
|
Caller []byte `json:"caller"`
|
|
|
|
Callee []byte `json:"callee"`
|
|
|
|
Data []byte `json:"data"`
|
2015-06-25 20:28:34 -07:00
|
|
|
Value int64 `json:"value"`
|
|
|
|
Gas int64 `json:"gas"`
|
2015-04-15 19:14:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type EventMsgCall struct {
|
2015-05-01 17:26:49 -07:00
|
|
|
CallData *CallData `json:"call_data"`
|
|
|
|
Origin []byte `json:"origin"`
|
2015-07-10 05:56:38 +00:00
|
|
|
TxID []byte `json:"tx_id"`
|
2015-05-01 17:26:49 -07:00
|
|
|
Return []byte `json:"return"`
|
|
|
|
Exception string `json:"exception"`
|
2015-04-15 19:14:08 -07:00
|
|
|
}
|