Skip to content

Commit 76a849c

Browse files
TerryhungTerry
andauthored
Align the task height (#1225)
Co-authored-by: Terry <[email protected]>
1 parent 4464cd3 commit 76a849c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tasks/fevm/blockheader/tasks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
4545
StateRoot: current.ParentState().String(),
4646
}
4747

48-
cid, err := executed.Key().Cid()
48+
cid, err := current.Key().Cid()
4949
if err != nil {
5050
log.Errorf("Error at getting cid: [%v] err: %v", cid, err)
5151
report.ErrorsDetected = err
@@ -71,7 +71,7 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
7171
return nil, report, nil
7272
}
7373
return &fevm.FEVMBlockHeader{
74-
Height: int64(executed.Height()),
74+
Height: int64(current.Height()),
7575
Hash: hash.String(),
7676
ParentHash: ethBlock.ParentHash.String(),
7777
Miner: ethBlock.Miner.String(),

tasks/fevm/receipt/tasks.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
5252
StateRoot: current.ParentState().String(),
5353
}
5454

55-
messages, err := p.node.ChainGetMessagesInTipset(ctx, executed.Key())
55+
messages, err := p.node.ChainGetMessagesInTipset(ctx, current.Key())
5656
if err != nil {
57-
log.Errorf("Error at getting messages. ts: %v, height: %v, err: %v", executed.String(), executed.Height(), err)
57+
log.Errorf("Error at getting messages. ts: %v, height: %v, err: %v", current.String(), current.Height(), err)
5858
report.ErrorsDetected = err
5959
return nil, report, nil
6060
}
@@ -64,7 +64,7 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
6464
if message.Message == nil {
6565
continue
6666
}
67-
if !util.IsEVMAddress(ctx, p.node, message.Message.To, executed.Key()) {
67+
if !util.IsEVMAddress(ctx, p.node, message.Message.To, current.Key()) {
6868
continue
6969
}
7070

@@ -87,7 +87,7 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
8787
}
8888

8989
receiptObj := &fevm.FEVMReceipt{
90-
Height: int64(executed.Height()),
90+
Height: int64(current.Height()),
9191
TransactionHash: receipt.TransactionHash.String(),
9292
TransactionIndex: uint64(receipt.TransactionIndex),
9393
BlockHash: receipt.BlockHash.String(),

tasks/fevm/transaction/tasks.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
5050
StateRoot: current.ParentState().String(),
5151
}
5252

53-
messages, err := p.node.ChainGetMessagesInTipset(ctx, executed.Key())
53+
messages, err := p.node.ChainGetMessagesInTipset(ctx, current.Key())
5454
if err != nil {
55-
log.Errorf("Error at getting messages. ts: %v, height: %v, err: %v", executed.String(), executed.Height(), err)
55+
log.Errorf("Error at getting messages. ts: %v, height: %v, err: %v", current.String(), current.Height(), err)
5656
report.ErrorsDetected = err
5757
return nil, report, nil
5858
}
@@ -62,7 +62,7 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
6262
if message.Message == nil {
6363
continue
6464
}
65-
if !util.IsEVMAddress(ctx, p.node, message.Message.To, executed.Key()) {
65+
if !util.IsEVMAddress(ctx, p.node, message.Message.To, current.Key()) {
6666
continue
6767
}
6868

@@ -85,7 +85,7 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
8585
}
8686

8787
txnObj := &fevm.FEVMTransaction{
88-
Height: int64(executed.Height()),
88+
Height: int64(current.Height()),
8989
Hash: txn.Hash.String(),
9090
ChainID: uint64(txn.ChainID),
9191
Nonce: uint64(txn.Nonce),

0 commit comments

Comments
 (0)