Skip to content

Commit 4b901a1

Browse files
committed
chore: use inbuilt types for event fields
1 parent f97dce6 commit 4b901a1

File tree

17 files changed

+314
-262
lines changed

17 files changed

+314
-262
lines changed

proto/sentinel/node/v3/events.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22
package sentinel.node.v3;
33

44
import "gogoproto/gogo.proto";
5-
import "sentinel/types/v1/status.proto";
65

76
option go_package = "github.com/sentinel-official/sentinelhub/v12/x/node/types/v3";
87
option (gogoproto.equal_all) = false;
@@ -38,7 +37,7 @@ message EventUpdateDetails {
3837

3938
message EventUpdateStatus {
4039
string node_address = 1;
41-
sentinel.types.v1.Status status = 2;
40+
string status = 2;
4241
}
4342

4443
message EventCreateSession {

proto/sentinel/plan/v3/events.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22
package sentinel.plan.v3;
33

44
import "gogoproto/gogo.proto";
5-
import "sentinel/types/v1/status.proto";
65

76
option go_package = "github.com/sentinel-official/sentinelhub/v12/x/plan/types/v3";
87
option (gogoproto.equal_all) = false;
@@ -31,5 +30,5 @@ message EventUnlinkNode {
3130
message EventUpdate {
3231
uint64 id = 1 [(gogoproto.customname) = "ID"];
3332
string prov_address = 2;
34-
sentinel.types.v1.Status status = 3;
33+
string status = 3;
3534
}

proto/sentinel/provider/v3/events.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22
package sentinel.provider.v3;
33

44
import "gogoproto/gogo.proto";
5-
import "sentinel/types/v1/status.proto";
65

76
option go_package = "github.com/sentinel-official/sentinelhub/v12/x/provider/types/v3";
87
option (gogoproto.equal_all) = false;
@@ -26,5 +25,5 @@ message EventUpdateDetails {
2625

2726
message EventUpdateStatus {
2827
string prov_address = 1;
29-
sentinel.types.v1.Status status = 2;
28+
string status = 2;
3029
}

proto/sentinel/session/v3/events.proto

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ syntax = "proto3";
22
package sentinel.session.v3;
33

44
import "gogoproto/gogo.proto";
5-
import "google/protobuf/duration.proto";
6-
import "sentinel/types/v1/status.proto";
75

86
option go_package = "github.com/sentinel-official/sentinelhub/v12/x/session/types/v3";
97
option (gogoproto.equal_all) = false;
@@ -29,16 +27,13 @@ message EventUpdateDetails {
2927
string node_address = 3;
3028
string download_bytes = 4;
3129
string upload_bytes = 5;
32-
google.protobuf.Duration duration = 6 [
33-
(gogoproto.nullable) = false,
34-
(gogoproto.stdduration) = true
35-
];
30+
string duration = 6;
3631
}
3732

3833
message EventUpdateStatus {
3934
uint64 id = 1 [(gogoproto.customname) = "ID"];
4035
string acc_address = 2;
4136
string node_address = 3;
42-
sentinel.types.v1.Status status = 4;
37+
string status = 4;
4338
string status_at = 5;
4439
}

proto/sentinel/subscription/v3/events.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ syntax = "proto3";
22
package sentinel.subscription.v3;
33

44
import "gogoproto/gogo.proto";
5-
import "sentinel/types/v1/status.proto";
65

76
option go_package = "github.com/sentinel-official/sentinelhub/v12/x/subscription/types/v3";
87
option (gogoproto.equal_all) = false;
@@ -52,7 +51,7 @@ message EventUpdate {
5251
uint64 plan_id = 2 [(gogoproto.customname) = "PlanID"];
5352
string acc_address = 3;
5453
string renewal_price_policy = 4;
55-
sentinel.types.v1.Status status = 5;
54+
string status = 5;
5655
string inactive_at = 6;
5756
string status_at = 7;
5857
}

x/node/keeper/msg_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func (k *Keeper) HandleMsgUpdateNodeStatus(ctx sdk.Context, msg *v3.MsgUpdateNod
180180
ctx.EventManager().EmitTypedEvent(
181181
&v3.EventUpdateStatus{
182182
NodeAddress: node.Address,
183-
Status: node.Status,
183+
Status: node.Status.String(),
184184
},
185185
)
186186

x/node/types/v3/events.pb.go

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

x/plan/keeper/msg_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func (k *Keeper) HandleMsgUpdatePlanStatus(ctx sdk.Context, msg *v3.MsgUpdatePla
206206
&v3.EventUpdate{
207207
ID: plan.ID,
208208
ProvAddress: plan.ProvAddress,
209-
Status: plan.Status,
209+
Status: plan.Status.String(),
210210
},
211211
)
212212

0 commit comments

Comments
 (0)