Skip to content

Commit

Permalink
fix: use higher abstraction of key methods
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
  • Loading branch information
0xivanov committed Aug 1, 2024
1 parent ec90ef7 commit cea8098
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions key_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"fmt"

"github.com/hashgraph/hedera-protobufs-go/services"
protobuf "google.golang.org/protobuf/proto"
)

// KeyList is a list of keys
Expand Down Expand Up @@ -79,11 +78,6 @@ func (kl *KeyList) AddAllPublicKeys(keys []PublicKey) *KeyList {
return kl
}

func (kl *KeyList) ToBytes() ([]byte, error) {
protoKey := kl._ToProtoKeyList()
return protobuf.Marshal(protoKey)
}

// String returns a string representation of the KeyList
func (kl KeyList) String() string {
var s string
Expand Down Expand Up @@ -165,14 +159,3 @@ func _KeyListFromProtobuf(pb *services.KeyList) (KeyList, error) {
threshold: -1,
}, nil
}

func KeyListFromBytes(bytes []byte) (KeyList, error) {
protoKey := &services.KeyList{}

err := protobuf.Unmarshal(bytes, protoKey)
if err != nil {
return KeyList{}, err
}

return _KeyListFromProtobuf(protoKey)
}
2 changes: 1 addition & 1 deletion tck/methods/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func getKeyListFromString(keyStr string) (hedera.Key, error) {
return hedera.KeyList{}, err
}

return hedera.KeyListFromBytes(bytes)
return hedera.KeyFromBytes(bytes)
}

func getKeyFromString(keyStr string) (hedera.Key, error) {
Expand Down

0 comments on commit cea8098

Please sign in to comment.