Skip to content

Commit

Permalink
lint proto
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Sep 22, 2024
1 parent d8b8f14 commit 9b487df
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 50 deletions.
19 changes: 16 additions & 3 deletions proto/exocore/oracle/v1/native_token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,46 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types";

// BalanceInfo tells effective-balance for native-restaking asset
message BalanceInfo {
// current round of price, this is updated based on tokenFeeder
uint64 round_id = 1 [(gogoproto.customname)="RoundID"];
// on which block the balance updated, deposit/withdraw will update this and round_id might not change
uint64 block = 2;
// index used to distinguish multiple balanceInfo for one same roundid
uint64 index = 3;
// beaconchain epoch related to slash_refund
// uint epoch = 3;
int64 balance = 4;

// Action defines the reason the balance changed
enum Action {
ACTION_ROUND = 0;
// balance updated when a new round generated
ACTION_ROUND_UNSPECIFIED = 0;
// balance updated when a deposit happened
ACTION_DEPOSIT = 1;
ACTION_WITHDRAW = 2;
ACTION_SLASH_REFUND = 3;
// balance updated when a withdraw happened
ACTION_WITHDRAW = 2;
// balance updatd when a slah/refund on beacon chain happened
ACTION_SLASH_REFUND = 3;
}

// change tells the reason balance changed
Action change = 5;
}

// StakerInfo represents all related information for a staker of native-restaking
message StakerInfo {
// staker's address
string staker_addr = 1;
// the index of corresponding staker in staker list
int64 staker_index = 2;
// list of validators that this staker corresponding to on beacon chain
repeated uint64 validator_indexes = 3;
// list of balances to represets the history of this staker
repeated BalanceInfo balance_list = 4;
}

// StakerList tells which stakers are active for one specific native-restaking asset
message StakerList {
// staker's address
repeated string staker_addrs = 1;
}
2 changes: 2 additions & 0 deletions proto/exocore/oracle/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types";
// Query defines the gRPC querier service.
service Query {

// stakerList shows all stakers related to the specified asset under native-restaking context
rpc StakerList (QueryStakerListRequest) returns (QueryStakerListResponse) {
option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/staker_list";
}

// StakerInfo shows the details for all stakers of the specified assets under native-restaking context
rpc StakerInfos (QueryStakerInfosRequest) returns (QueryStakerInfosResponse) {
option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/staker_infos";
}
Expand Down
107 changes: 60 additions & 47 deletions x/oracle/types/native_token.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions x/oracle/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b487df

Please sign in to comment.