Skip to content

Commit

Permalink
make signer a public type
Browse files Browse the repository at this point in the history
  • Loading branch information
QuestofIranon committed Feb 6, 2020
1 parent 184695b commit e2b7797
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ type node struct {
address string
}

type signer func(message []byte) []byte
type TransactionSigner func(message []byte) []byte

type operator struct {
accountID AccountID
privateKey *Ed25519PrivateKey
publicKey Ed25519PublicKey
signer signer
signer TransactionSigner
}

var mainnetNodes = map[string]AccountID{
Expand Down Expand Up @@ -181,7 +181,7 @@ func (client *Client) SetOperator(accountID AccountID, privateKey Ed25519Private
return client
}

func (client *Client) SetOperatorWith(accountID AccountID, publicKey Ed25519PublicKey, signer signer) *Client {
func (client *Client) SetOperatorWith(accountID AccountID, publicKey Ed25519PublicKey, signer TransactionSigner) *Client {
client.operator = &operator{
accountID: accountID,
privateKey: nil,
Expand Down
2 changes: 1 addition & 1 deletion transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (transaction Transaction) signWithOperator(operator operator) Transaction {
return transaction
}

func (transaction Transaction) SignWith(publicKey Ed25519PublicKey, signer signer) Transaction {
func (transaction Transaction) SignWith(publicKey Ed25519PublicKey, signer TransactionSigner) Transaction {
signature := signer(transaction.pb.GetBodyBytes())

transaction.pb.SigMap.SigPair = append(transaction.pb.SigMap.SigPair, &proto.SignaturePair{
Expand Down

0 comments on commit e2b7797

Please sign in to comment.