mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Run go-instrument-errors to wrap errors
This commit is contained in:
@@ -777,11 +777,11 @@ func (c *AuctionClient) AuctionEventInit() (*AuctionEventInitialize, int64, erro
|
||||
return nil, 0, tracerr.Wrap(err)
|
||||
}
|
||||
if len(logs) != 1 {
|
||||
return nil, 0, fmt.Errorf("no event of type InitializeHermezAuctionProtocolEvent found")
|
||||
return nil, 0, tracerr.Wrap(fmt.Errorf("no event of type InitializeHermezAuctionProtocolEvent found"))
|
||||
}
|
||||
vLog := logs[0]
|
||||
if vLog.Topics[0] != logAuctionInitialize {
|
||||
return nil, 0, fmt.Errorf("event is not InitializeHermezAuctionProtocolEvent")
|
||||
return nil, 0, tracerr.Wrap(fmt.Errorf("event is not InitializeHermezAuctionProtocolEvent"))
|
||||
}
|
||||
|
||||
var auctionInit AuctionEventInitialize
|
||||
@@ -789,7 +789,7 @@ func (c *AuctionClient) AuctionEventInit() (*AuctionEventInitialize, int64, erro
|
||||
"InitializeHermezAuctionProtocolEvent", vLog.Data); err != nil {
|
||||
return nil, 0, tracerr.Wrap(err)
|
||||
}
|
||||
return &auctionInit, int64(vLog.BlockNumber), err
|
||||
return &auctionInit, int64(vLog.BlockNumber), tracerr.Wrap(err)
|
||||
}
|
||||
|
||||
// AuctionEventsByBlock returns the events in a block that happened in the
|
||||
|
||||
@@ -710,18 +710,18 @@ func (c *RollupClient) RollupEventInit() (*RollupEventInitialize, int64, error)
|
||||
return nil, 0, tracerr.Wrap(err)
|
||||
}
|
||||
if len(logs) != 1 {
|
||||
return nil, 0, fmt.Errorf("no event of type InitializeHermezEvent found")
|
||||
return nil, 0, tracerr.Wrap(fmt.Errorf("no event of type InitializeHermezEvent found"))
|
||||
}
|
||||
vLog := logs[0]
|
||||
if vLog.Topics[0] != logHermezInitialize {
|
||||
return nil, 0, fmt.Errorf("event is not InitializeHermezEvent")
|
||||
return nil, 0, tracerr.Wrap(fmt.Errorf("event is not InitializeHermezEvent"))
|
||||
}
|
||||
|
||||
var rollupInit RollupEventInitialize
|
||||
if err := c.contractAbi.UnpackIntoInterface(&rollupInit, "InitializeHermezEvent", vLog.Data); err != nil {
|
||||
return nil, 0, tracerr.Wrap(err)
|
||||
}
|
||||
return &rollupInit, int64(vLog.BlockNumber), err
|
||||
return &rollupInit, int64(vLog.BlockNumber), tracerr.Wrap(err)
|
||||
}
|
||||
|
||||
// RollupEventsByBlock returns the events in a block that happened in the Rollup Smart Contract
|
||||
|
||||
@@ -408,11 +408,11 @@ func (c *WDelayerClient) WDelayerEventInit() (*WDelayerEventInitialize, int64, e
|
||||
return nil, 0, tracerr.Wrap(err)
|
||||
}
|
||||
if len(logs) != 1 {
|
||||
return nil, 0, fmt.Errorf("no event of type InitializeWithdrawalDelayerEvent found")
|
||||
return nil, 0, tracerr.Wrap(fmt.Errorf("no event of type InitializeWithdrawalDelayerEvent found"))
|
||||
}
|
||||
vLog := logs[0]
|
||||
if vLog.Topics[0] != logWDelayerInitialize {
|
||||
return nil, 0, fmt.Errorf("event is not InitializeWithdrawalDelayerEvent")
|
||||
return nil, 0, tracerr.Wrap(fmt.Errorf("event is not InitializeWithdrawalDelayerEvent"))
|
||||
}
|
||||
|
||||
var wDelayerInit WDelayerEventInitialize
|
||||
@@ -420,7 +420,7 @@ func (c *WDelayerClient) WDelayerEventInit() (*WDelayerEventInitialize, int64, e
|
||||
vLog.Data); err != nil {
|
||||
return nil, 0, tracerr.Wrap(err)
|
||||
}
|
||||
return &wDelayerInit, int64(vLog.BlockNumber), err
|
||||
return &wDelayerInit, int64(vLog.BlockNumber), tracerr.Wrap(err)
|
||||
}
|
||||
|
||||
// WDelayerEventsByBlock returns the events in a block that happened in the
|
||||
|
||||
Reference in New Issue
Block a user