2024-10-24 17:00:46 +02:00
|
|
|
package event
|
|
|
|
|
|
|
|
import (
|
|
|
|
geEvent "github.com/grassrootseconomics/eth-tracker/pkg/event"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
evReg = "CUSTODIAL_REGISTRATION"
|
|
|
|
)
|
|
|
|
|
|
|
|
type eventCustodialRegistration struct {
|
|
|
|
account string
|
|
|
|
}
|
|
|
|
|
|
|
|
func asCustodialRegistrationEvent(gev *geEvent.Event) (*eventCustodialRegistration, bool) {
|
|
|
|
var ok bool
|
|
|
|
var ev eventCustodialRegistration
|
|
|
|
if gev.TxType != evReg {
|
|
|
|
return nil, false
|
|
|
|
}
|
|
|
|
pl := gev.Payload
|
|
|
|
ev.account, ok = pl["account"].(string)
|
|
|
|
if !ok {
|
|
|
|
return nil, false
|
|
|
|
}
|
2024-10-24 17:17:04 +02:00
|
|
|
logg.Debug("parsed ev", "pl", pl, "ev", ev)
|
2024-10-24 17:00:46 +02:00
|
|
|
return &ev, true
|
|
|
|
}
|
|
|
|
|
|
|
|
func handleCustodialRegistration(ev *eventCustodialRegistration) error {
|
|
|
|
return nil
|
|
|
|
}
|