Skip to content

Commit e6b2694

Browse files
committed
refactor dlc event
1 parent 4e1ed0b commit e6b2694

30 files changed

Lines changed: 1600 additions & 4897 deletions

api/side/dlc/params.pulsar.go

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

api/side/lending/lending.pulsar.go

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

api/side/lending/query.pulsar.go

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

api/side/lending/query_grpc.pb.go

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

proto/side/dlc/params.proto

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,12 @@ import "cosmos_proto/cosmos.proto";
77

88
option go_package = "github.com/sideprotocol/side/x/dlc/types";
99

10-
message PricePair {
11-
string pair = 1;
12-
int32 decimals = 2;
13-
string interval = 3 [
14-
(cosmos_proto.scalar) = "cosmos.Dec",
15-
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
16-
(gogoproto.nullable) = false
17-
];
18-
}
19-
2010
// Params defines the parameters for the module.
2111
message Params {
22-
uint32 price_event_nonce_queue_size = 1;
23-
repeated PricePair price_pairs = 2 [(gogoproto.nullable) = false];
24-
uint32 date_event_nonce_queue_size = 3;
25-
google.protobuf.Duration date_interval = 4 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
26-
uint32 lending_event_nonce_queue_size = 5;
27-
repeated string allowed_oracle_participants = 6;
28-
uint32 oracle_participant_num = 7;
29-
uint32 oracle_participant_threshold = 8;
30-
uint32 nonce_generation_batch_size = 9;
31-
int64 nonce_generation_interval = 10;
12+
uint32 nonce_queue_size = 1;
13+
uint32 nonce_generation_batch_size = 2;
14+
int64 nonce_generation_interval = 3;
15+
repeated string allowed_oracle_participants = 4;
16+
uint32 oracle_participant_num = 5;
17+
uint32 oracle_participant_threshold = 6;
3218
}

proto/side/lending/lending.proto

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,17 @@ message Loan {
215215
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
216216
(gogoproto.nullable) = false
217217
];
218-
uint64 liquidation_event_id = 19;
219-
uint64 default_liquidation_event_id = 20;
220-
uint64 repayment_event_id = 21;
221-
repeated Authorization authorizations = 22 [(gogoproto.nullable) = false];
222-
string collateral_amount = 23 [
218+
uint64 dlc_event_id = 19;
219+
repeated Authorization authorizations = 20 [(gogoproto.nullable) = false];
220+
string collateral_amount = 21 [
223221
(gogoproto.customtype) = "cosmossdk.io/math.Int",
224222
(gogoproto.nullable) = false
225223
];
226-
uint64 liquidation_id = 24;
227-
string referrer = 25;
228-
google.protobuf.Timestamp create_at = 26 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
229-
google.protobuf.Timestamp disburse_at = 27 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
230-
LoanStatus status = 28;
224+
uint64 liquidation_id = 22;
225+
string referrer = 23;
226+
google.protobuf.Timestamp create_at = 24 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
227+
google.protobuf.Timestamp disburse_at = 25 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
228+
LoanStatus status = 26;
231229
}
232230

233231
enum CetType {

proto/side/lending/query.proto

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ service Query {
3333
option (google.api.http).get = "/side/lending/collateral/address";
3434
}
3535

36-
rpc LiquidationEvent(QueryLiquidationEventRequest) returns (QueryLiquidationEventResponse) {
37-
option (google.api.http).get = "/side/lending/liquidation/event";
36+
rpc DlcEventCount(QueryDlcEventCountRequest) returns (QueryDlcEventCountResponse) {
37+
option (google.api.http).get = "/side/lending/dlc/event/count";
3838
}
3939

4040
rpc Loan(QueryLoanRequest) returns (QueryLoanResponse) {
@@ -109,24 +109,14 @@ message QueryPoolExchangeRateResponse {
109109
string exchange_rate = 1;
110110
}
111111

112-
message QueryLiquidationEventRequest {
113-
string pool_id = 1;
114-
string collateral_amount = 2;
115-
string borrow_amount = 3;
116-
int64 maturity = 4;
117-
}
112+
message QueryDlcEventCountRequest {}
118113

119-
message QueryLiquidationEventResponse {
120-
uint64 event_id = 1;
121-
string oracle_pubkey = 2;
122-
string nonce = 3;
123-
string price = 4;
124-
string signature_point = 5;
114+
message QueryDlcEventCountResponse {
115+
uint64 count = 1;
125116
}
126117

127118
message QueryLoanCetInfosRequest {
128119
string loan_id = 1;
129-
string collateral_amount = 2;
130120
}
131121

132122
message QueryLoanCetInfosResponse {

proto/side/oracle/genesis.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ message GenesisState {
1212
Params params = 1 [(gogoproto.nullable) = false];
1313

1414
repeated OraclePrice prices = 2;
15-
repeated BlockHeader blocks = 3;
15+
repeated BlockHeader blocks = 3;
1616
}

0 commit comments

Comments
 (0)