Skip to content

Commit

Permalink
err logging
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed Feb 23, 2024
1 parent c2b56f3 commit 3f85f20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions crypto/txsigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package crypto
import (
"crypto/ecdsa"
"errors"
"fmt"
"math/big"

"github.com/0xPolygon/polygon-edge/chain"
Expand Down Expand Up @@ -37,14 +38,19 @@ func NewSigner(forks chain.ForksInTime, chainID uint64) TxSigner {
var signer TxSigner

if forks.London {
fmt.Println("Using London signer")
signer = NewLondonSigner(chainID)

Check failure on line 42 in crypto/txsigner.go

View workflow job for this annotation

GitHub Actions / Lint / Run Lint

assignments should only be cuddled with other assignments (wsl)
} else if forks.Berlin {
fmt.Println("Using Berlin signer")
signer = NewBerlinSigner(chainID)

Check failure on line 45 in crypto/txsigner.go

View workflow job for this annotation

GitHub Actions / Lint / Run Lint

assignments should only be cuddled with other assignments (wsl)
} else if forks.EIP155 {
fmt.Println("Using EIP155 signer")
signer = NewEIP155Signer(chainID)

Check failure on line 48 in crypto/txsigner.go

View workflow job for this annotation

GitHub Actions / Lint / Run Lint

assignments should only be cuddled with other assignments (wsl)
} else if forks.Homestead {
fmt.Println("Using Homestead signer")
signer = NewHomesteadSigner()
} else {
fmt.Println("Using NewFrontierSigner")
signer = NewFrontierSigner()
}

Expand Down
2 changes: 1 addition & 1 deletion txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ func (p *TxPool) validateTx(tx *types.Transaction) error {
if signerErr != nil {
metrics.IncrCounter([]string{txPoolMetrics, "invalid_signature_txs"}, 1)

return ErrExtractSignature
return fmt.Errorf("%w. %w", ErrExtractSignature, signerErr)
}

// If the from field is set, check that
Expand Down

0 comments on commit 3f85f20

Please sign in to comment.