Skip to content

Commit

Permalink
modifications (#24)
Browse files Browse the repository at this point in the history
* modification + quick fix block api

* updates
  • Loading branch information
jingweicb authored Feb 10, 2023
1 parent 448bbd5 commit fa0077f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ tmp
*.exe~
*.dll
*.so
*.dylib
*.dylib

# Validation config
configs/*
6 changes: 3 additions & 3 deletions pkg/client/client_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (c *OpClient) ParseOps(
) ([]*RosettaTypes.Operation, error) {
var ops []*RosettaTypes.Operation

if tx.Receipt.Type == L1ToL2DepositType && len(tx.Trace) > 0 && tx.Transaction.IsSystemTx() {
if tx.Receipt.Type == L1ToL2DepositType && len(tx.Trace) > 0 {
call := tx.Trace[0]
fromAddress := evmClient.MustChecksum(call.From.String())
toAddress := evmClient.MustChecksum(call.To.String())
Expand Down Expand Up @@ -46,8 +46,8 @@ func (c *OpClient) ParseOps(
}
ops = append(ops, feeOps...)

ops = append(ops, handlers.MintOps(tx, len(ops))...)
ops = append(ops, handlers.BurnOps(tx, len(ops))...)
// ops = append(ops, handlers.MintOps(tx, len(ops))...)
// ops = append(ops, handlers.BurnOps(tx, len(ops))...)
ops = append(ops, handlers.TraceOps(tx.Trace, len(ops))...)

return ops, nil
Expand Down
1 change: 1 addition & 0 deletions pkg/handlers/burn.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

// BurnOps constructs a list of [RosettaTypes.Operation]s for an Optimism Withdrawal or "burn" transaction.
func BurnOps(tx *evmClient.LoadedTransaction, startIndex int) []*RosettaTypes.Operation {
// tx's To address could be nil, if the type == CREATE, it will break
if *tx.Transaction.To() != common.L2ToL1MessagePasser {
return nil
}
Expand Down

0 comments on commit fa0077f

Please sign in to comment.