Skip to content

Commit

Permalink
feat: Added network_version_info
Browse files Browse the repository at this point in the history
  • Loading branch information
andrix10 committed Oct 16, 2020
1 parent 80fb88f commit b0e36d1
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions network_version_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package hedera

import "github.com/hashgraph/hedera-sdk-go/proto"

type NetworkVersionInfo struct {
ProtobufVersion SemanticVersion
ServicesVersion SemanticVersion
}

func newNetworkVersionInfo(hapi SemanticVersion, hedera SemanticVersion) NetworkVersionInfo {
return NetworkVersionInfo{
ProtobufVersion: hapi,
ServicesVersion: hedera,
}
}

func networkVersionInfoFromProtobuf(version *proto.NetworkGetVersionInfoResponse) NetworkVersionInfo {
return NetworkVersionInfo{
ProtobufVersion: semanticVersionFromProtobuf(version.HapiProtoVersion),
ServicesVersion: semanticVersionFromProtobuf(version.HederaServicesVersion),
}
}

func (version *NetworkVersionInfo) toProtobuf() *proto.NetworkGetVersionInfoResponse {
return &proto.NetworkGetVersionInfoResponse{
HapiProtoVersion: version.ProtobufVersion.toProtobuf(),
HederaServicesVersion: version.ServicesVersion.toProtobuf(),
}
}

0 comments on commit b0e36d1

Please sign in to comment.