Skip to content

Commit 867bd8e

Browse files
update property for better clarity and add to helpers
1 parent 1aaf2e0 commit 867bd8e

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

pkg/capabilities/capabilities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type CapabilityResponse struct {
7474

7575
type ResponseMetadata struct {
7676
Metering []MeteringNodeDetail
77-
N uint32
77+
CapDON_N uint32
7878
}
7979

8080
type MeteringNodeDetail struct {

pkg/capabilities/pb/capabilities.pb.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/pb/capabilities.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ message ResponseMetadata {
127127
// If you are working with this in a capability, you should not emit
128128
// more than one metering report per node.
129129
repeated metering.MeteringReportNodeDetail metering = 1;
130-
// n represents the total number of nodes in a capability don.
131-
uint32 n = 2;
130+
// capdon_n represents the total number of nodes in a capability don.
131+
uint32 capdon_n = 2;
132132
}
133133

134134
message RegistrationMetadata {

pkg/capabilities/pb/capabilities_helpers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func CapabilityResponseToProto(resp capabilities.CapabilityResponse) *Capability
9090
Value: values.ProtoMap(resp.Value),
9191
Metadata: &ResponseMetadata{
9292
Metering: metering,
93+
CapdonN: resp.Metadata.CapDON_N,
9394
},
9495
Payload: resp.Payload,
9596
}
@@ -166,6 +167,7 @@ func CapabilityResponseFromProto(pr *CapabilityResponse) (capabilities.Capabilit
166167
Value: val,
167168
Metadata: capabilities.ResponseMetadata{
168169
Metering: metering,
170+
CapDON_N: pr.Metadata.GetCapdonN(),
169171
},
170172
Payload: pr.Payload,
171173
}

0 commit comments

Comments
 (0)