Commit 88599b1c authored by Michael de Hoog's avatar Michael de Hoog

op-signer: fix address comparison

parent 480fe38f
package crypto package crypto
import ( import (
"bytes"
"context" "context"
"crypto/ecdsa" "crypto/ecdsa"
"errors" "errors"
...@@ -56,7 +57,7 @@ func SignerFactoryFromConfig(l log.Logger, privateKey, mnemonic, hdPath string, ...@@ -56,7 +57,7 @@ func SignerFactoryFromConfig(l log.Logger, privateKey, mnemonic, hdPath string,
fromAddress = common.HexToAddress(signerConfig.Address) fromAddress = common.HexToAddress(signerConfig.Address)
signer = func(chainID *big.Int) SignerFn { signer = func(chainID *big.Int) SignerFn {
return func(ctx context.Context, address common.Address, tx *types.Transaction) (*types.Transaction, error) { return func(ctx context.Context, address common.Address, tx *types.Transaction) (*types.Transaction, error) {
if address.String() != signerConfig.Address { if !bytes.Equal(address[:], fromAddress[:]) {
return nil, fmt.Errorf("attempting to sign for %s, expected %s: ", address, signerConfig.Address) return nil, fmt.Errorf("attempting to sign for %s, expected %s: ", address, signerConfig.Address)
} }
return signerClient.SignTransaction(ctx, chainID, tx) return signerClient.SignTransaction(ctx, chainID, tx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment