mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-02 11:43:40 +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)
|
// System contract ("eosio" per default)
|
||||||
syscontract eos.AccountName
|
syscontract eos.AccountName
|
||||||
|
|
||||||
|
// ABI Returned from SHIP
|
||||||
|
shipABI *eos.ABI
|
||||||
}
|
}
|
||||||
|
|
||||||
// SpawnProcessor creates a new ShipProccessor that consumes the shipclient.Stream passed to it.
|
// 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
|
// Attach handlers
|
||||||
shipStream.BlockHandler = processor.processBlock
|
shipStream.BlockHandler = processor.processBlock
|
||||||
|
shipStream.InitHandler = processor.initHandler
|
||||||
|
|
||||||
// Needed because if nil, traces will not be included in the response from ship.
|
// Needed because if nil, traces will not be included in the response from ship.
|
||||||
shipStream.TraceHandler = func([]*ship.TransactionTraceV0) {}
|
shipStream.TraceHandler = func([]*ship.TransactionTraceV0) {}
|
||||||
|
|
@ -76,6 +80,10 @@ func SpawnProccessor(shipStream *shipclient.Stream, loader StateLoader, saver St
|
||||||
return processor
|
return processor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (processor *ShipProcessor) initHandler(abi *eos.ABI) {
|
||||||
|
processor.shipABI = abi
|
||||||
|
}
|
||||||
|
|
||||||
func (processor *ShipProcessor) queueMessage(channel api.Channel, payload []byte) bool {
|
func (processor *ShipProcessor) queueMessage(channel api.Channel, payload []byte) bool {
|
||||||
err := processor.writer.Write(channel, payload)
|
err := processor.writer.Write(channel, payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue