Skip to content

Commit

Permalink
Fix: attempt to fix v+27 (#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasse authored Dec 28, 2023
1 parent f14f58a commit b6d2349
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions agents/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"context"
"fmt"
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
Expand All @@ -27,9 +28,11 @@ func signEncoder(ctx context.Context, signer signer.Signer, encoder Encoder, sal
}

// Sign the message.
signature, err := signer.SignMessage(ctx, core.BytesToSlice(hashedDigest), false)
sig, err := signer.SignMessage(ctx, core.BytesToSlice(hashedDigest), false)
if err != nil {
return nil, nil, common.Hash{}, fmt.Errorf("could not sign: %w", err)
}
return signature, encoded, hashedDigest, nil

sig = NewSignature(new(big.Int).Add(big.NewInt(27), sig.V()), sig.R(), sig.S())
return sig, encoded, hashedDigest, nil
}

0 comments on commit b6d2349

Please sign in to comment.