Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Sep 23, 2024
1 parent 25bd531 commit 21fcc32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion adapters/vm2core/vm2core.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func StateDiff(trace *vm.TransactionTrace) *core.StateDiff {
func Receipt(fee *felt.Felt, feeUnit core.FeeUnit, txHash *felt.Felt,
trace *vm.TransactionTrace, txnReceipt *vm.TransactionReceipt,
) *core.TransactionReceipt {
return &core.TransactionReceipt{
return &core.TransactionReceipt{ //nolint:exhaustruct
Fee: fee,
FeeUnit: feeUnit,
Events: AdaptOrderedEvents(trace.AllEvents()),
Expand Down
8 changes: 2 additions & 6 deletions builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,7 @@ func (b *Builder) runTxn(txn *mempool.BroadcastedTransaction) error {

receipt := vm2core.Receipt(fee[0], feeUnit, txn.Transaction.Hash(), &trace[0], &txnReceipts[0])
if b.shadowBlock != nil {
err = b.overrideTraces(receipt)
if err != nil {
return err
}
b.overrideTraces(receipt)
}
if b.junoEndpoint != "" {
seqTrace := vm2core.AdaptStateDiff(trace[0].StateDiff)
Expand Down Expand Up @@ -545,12 +542,11 @@ func mergeStateDiffs(oldStateDiff, newStateDiff *core.StateDiff) *core.StateDiff
return oldStateDiff
}

func (b *Builder) overrideTraces(receipt *core.TransactionReceipt) error {
func (b *Builder) overrideTraces(receipt *core.TransactionReceipt) {
// Note: the error message changes between blockifier-rc2 and blockifier-rc3.
// If we run with blockifier-rc3, we won't get the same revert-reason that was
// generated if the FGW was running blockifier-rc2. We account for this here.
receipt.RevertReason = b.shadowBlock.Receipts[b.pendingBlock.Block.TransactionCount].RevertReason
return nil
}

// shadowTxns pulls transactions from the FGW and feeds them into the mempool for execution.
Expand Down

0 comments on commit 21fcc32

Please sign in to comment.