mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
app/ship_processor.go: Store abi from ship in processor.
This commit is contained in:
parent
b3961f4eec
commit
2268d19b08
1 changed files with 8 additions and 0 deletions
|
|
@ -52,6 +52,9 @@ type ShipProcessor struct {
|
|||
|
||||
// System contract ("eosio" per default)
|
||||
syscontract eos.AccountName
|
||||
|
||||
// ABI Returned from SHIP
|
||||
shipABI *eos.ABI
|
||||
}
|
||||
|
||||
// SpawnProcessor creates a new ShipProccessor that consumes the shipclient.Stream passed to it.
|
||||
|
|
@ -69,6 +72,7 @@ func SpawnProccessor(shipStream *shipclient.Stream, loader StateLoader, saver St
|
|||
|
||||
// Attach handlers
|
||||
shipStream.BlockHandler = processor.processBlock
|
||||
shipStream.InitHandler = processor.initHandler
|
||||
|
||||
// Needed because if nil, traces will not be included in the response from ship.
|
||||
shipStream.TraceHandler = func([]*ship.TransactionTraceV0) {}
|
||||
|
|
@ -76,6 +80,10 @@ func SpawnProccessor(shipStream *shipclient.Stream, loader StateLoader, saver St
|
|||
return processor
|
||||
}
|
||||
|
||||
func (processor *ShipProcessor) initHandler(abi *eos.ABI) {
|
||||
processor.shipABI = abi
|
||||
}
|
||||
|
||||
func (processor *ShipProcessor) queueMessage(channel api.Channel, payload []byte) bool {
|
||||
err := processor.writer.Write(channel, payload)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue