fix: SetSignerPublicKey return address with 0x prefix (#4193)
This commit is contained in:
parent
23f71c1125
commit
b08125890e
|
@ -39,3 +39,8 @@ func Hex2Bytes(str string) []byte {
|
||||||
h, _ := hex.DecodeString(str)
|
h, _ := hex.DecodeString(str)
|
||||||
return h
|
return h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToHex returns the hex string representation of bytes with 0x prefix.
|
||||||
|
func ToHex(bytes []byte) string {
|
||||||
|
return "0x" + Bytes2Hex(bytes)
|
||||||
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"github.com/status-im/status-go/account"
|
"github.com/status-im/status-go/account"
|
||||||
"github.com/status-im/status-go/contracts/community-tokens/ownertoken"
|
"github.com/status-im/status-go/contracts/community-tokens/ownertoken"
|
||||||
communityownertokenregistry "github.com/status-im/status-go/contracts/community-tokens/registry"
|
communityownertokenregistry "github.com/status-im/status-go/contracts/community-tokens/registry"
|
||||||
|
"github.com/status-im/status-go/eth-node/types"
|
||||||
"github.com/status-im/status-go/params"
|
"github.com/status-im/status-go/params"
|
||||||
"github.com/status-im/status-go/rpc"
|
"github.com/status-im/status-go/rpc"
|
||||||
"github.com/status-im/status-go/services/utils"
|
"github.com/status-im/status-go/services/utils"
|
||||||
|
@ -104,7 +105,8 @@ func (s *Service) GetSignerPubKey(ctx context.Context, chainID uint64, contractA
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return common.Bytes2Hex(signerPubKey), nil
|
|
||||||
|
return types.ToHex(signerPubKey), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) SafeGetSignerPubKey(ctx context.Context, chainID uint64, communityID string) (string, error) {
|
func (s *Service) SafeGetSignerPubKey(ctx context.Context, chainID uint64, communityID string) (string, error) {
|
||||||
|
|
Loading…
Reference in New Issue