[#259] netmap/grpc: Implement field setters of NetworkInfo RPC messages

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-17 20:02:02 +03:00 committed by Alex Vanin
parent d0d2f8d5db
commit ae35f17827
2 changed files with 63 additions and 0 deletions

View file

@ -60,3 +60,52 @@ func (m *LocalNodeInfoResponse) SetVerifyHeader(v *session.ResponseVerificationH
m.VerifyHeader = v m.VerifyHeader = v
} }
} }
// SetBody sets body of the request.
func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) {
if x != nil {
x.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (x *NetworkInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) {
if x != nil {
x.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (x *NetworkInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
if x != nil {
x.VerifyHeader = v
}
}
// SetNetworkInfo sets information about the network.
func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) {
if x != nil {
x.NetworkInfo = v
}
}
// SetBody sets body of the response.
func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) {
if x != nil {
x.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (x *NetworkInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
if x != nil {
x.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (x *NetworkInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
if x != nil {
x.VerifyHeader = v
}
}

View file

@ -160,3 +160,17 @@ func (m *NodeInfo) SetState(v NodeInfo_State) {
m.State = v m.State = v
} }
} }
// SetCurrentEpoch sets number of the current epoch.
func (x *NetworkInfo) SetCurrentEpoch(v uint64) {
if x != nil {
x.CurrentEpoch = v
}
}
// SetMagicNumber sets magic number of the sidechain.
func (x *NetworkInfo) SetMagicNumber(v uint64) {
if x != nil {
x.MagicNumber = v
}
}