Skip to content

Commit

Permalink
feat(): upgrade arweave signer sha256
Browse files Browse the repository at this point in the history
  • Loading branch information
zyjblockchain committed Nov 30, 2023
1 parent 58c59b5 commit b2bd991
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk/signer.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package sdk

import (
"crypto/sha256"
"errors"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/everFinance/goar"
"github.com/everFinance/goar/utils"
Expand All @@ -18,7 +18,8 @@ func (s *SDK) Sign(msg string) (string, error) {
switch s.signerType {
case RSASignerType:
signer := s.signer.(*goar.Signer)
sig, err := signer.SignMsg(accounts.TextHash([]byte(msg)))
hash := sha256.Sum256([]byte(msg))
sig, err := signer.SignMsg(hash[:])
if err != nil {
return "", err
}
Expand Down

0 comments on commit b2bd991

Please sign in to comment.