Skip to content

Commit

Permalink
chore: align event naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mbreithecker committed Jun 12, 2024
1 parent c27d840 commit f1d95f6
Show file tree
Hide file tree
Showing 18 changed files with 464 additions and 622 deletions.
45 changes: 11 additions & 34 deletions proto/kyve/bundles/v1beta1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ syntax = "proto3";

package kyve.bundles.v1beta1;

import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "kyve/bundles/v1beta1/bundles.proto";
import "kyve/bundles/v1beta1/params.proto";
Expand Down Expand Up @@ -90,50 +88,29 @@ message EventBundleFinalized {
// status of the finalized bundle
BundleStatus status = 7;
// amount which funders provided to the total bundle reward
repeated cosmos.base.v1beta1.Coin funders_payout = 8 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string funders_payout = 8;
// amount which the inflation pool provided to the total reward (in ukyve)
uint64 inflation_payout = 9;
// rewards transferred to treasury
repeated cosmos.base.v1beta1.Coin reward_treasury = 10 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// reward_uploader_commission are the commission rewards of the uploader.
// if the uploader has no delegations the delegation rewards are included here
repeated cosmos.base.v1beta1.Coin reward_uploader_commission = 11 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string reward_treasury = 10;
// reward_uploader are the total rewards (commission + storage cost)
// the uploader received
string reward_uploader = 11;
// rewardDelegation rewards distributed among all delegators
repeated cosmos.base.v1beta1.Coin reward_delegation = 12 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string reward_delegation = 12;
// rewardTotal the total bundle reward
repeated cosmos.base.v1beta1.Coin reward_total = 13 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string reward_total = 13;
// finalized_at the block height where the bundle got finalized
uint64 finalized_at = 14;
// uploader the address of the uploader of this bundle
string uploader = 15;
// next_uploader the address of the next uploader after this bundle
string next_uploader = 16;
// reward_uploader_storage_cost are the storage cost rewards for the uploader
repeated cosmos.base.v1beta1.Coin reward_uploader_storage_cost = 17 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string reward_uploader_storage_cost = 17;
// reward_uploader_commission are the commission rewards of the uploader.
// if the uploader has no delegations the delegation rewards are included here
string reward_uploader_commission = 18;
}

// EventClaimedUploaderRole is an event emitted when an uploader claims the uploader role
Expand Down
10 changes: 2 additions & 8 deletions proto/kyve/delegation/v1beta1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ syntax = "proto3";

package kyve.delegation.v1beta1;

import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "kyve/delegation/v1beta1/delegation.proto";
import "kyve/delegation/v1beta1/params.proto";
Expand Down Expand Up @@ -79,12 +77,8 @@ message EventWithdrawRewards {
string address = 1;
// staker is the account address of the protocol node the users withdraws from.
string staker = 2;
// amount ...
repeated cosmos.base.v1beta1.Coin amount = 3 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// amounts ...
string amounts = 3;
}

// EventSlash is an event emitted when a protocol node is slashed.
Expand Down
20 changes: 3 additions & 17 deletions proto/kyve/funders/v1beta1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ syntax = "proto3";

package kyve.funders.v1beta1;

import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "kyve/funders/v1beta1/params.proto";

Expand Down Expand Up @@ -62,17 +60,9 @@ message EventFundPool {
// address is the account address of the pool funder.
string address = 2;
// amounts is a list of coins the funder has funded
repeated cosmos.base.v1beta1.Coin amounts = 3 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string amounts = 3;
// amounts_per_bundle is a list of coins the funder wants to distribute per finalized bundle
repeated cosmos.base.v1beta1.Coin amounts_per_bundle = 4 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string amounts_per_bundle = 4;
}

// EventDefundPool is an event emitted when a pool is defunded.
Expand All @@ -83,11 +73,7 @@ message EventDefundPool {
// address is the account address of the pool funder.
string address = 2;
// amounts is a list of coins that the funder wants to defund
repeated cosmos.base.v1beta1.Coin amounts = 3 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string amounts = 3;
}

// EventPoolOutOfFunds is an event emitted when a pool has run out of funds
Expand Down
10 changes: 2 additions & 8 deletions proto/kyve/stakers/v1beta1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ syntax = "proto3";

package kyve.stakers.v1beta1;

import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "kyve/stakers/v1beta1/params.proto";

Expand Down Expand Up @@ -68,12 +66,8 @@ message EventUpdateCommission {
message EventClaimCommissionRewards {
// staker is the account address of the protocol node.
string staker = 1;
// amount is the amount of the commission rewards claimed
repeated cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// amounts is the amount of the commission rewards claimed
string amounts = 2;
}

// EventJoinPool ...
Expand Down
12 changes: 6 additions & 6 deletions x/bundles/keeper/logic_bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,13 @@ func (k Keeper) finalizeCurrentBundleProposal(ctx sdk.Context, poolId uint64, vo
Abstain: voteDistribution.Abstain,
Total: voteDistribution.Total,
Status: voteDistribution.Status,
FundersPayout: fundersPayout,
FundersPayout: fundersPayout.String(),
InflationPayout: inflationPayout,
RewardTreasury: bundleReward.Treasury,
RewardUploaderCommission: bundleReward.UploaderCommission,
RewardUploaderStorageCost: bundleReward.UploaderStorageCost,
RewardDelegation: bundleReward.Delegation,
RewardTotal: bundleReward.Total,
RewardTreasury: bundleReward.Treasury.String(),
RewardUploaderCommission: bundleReward.UploaderCommission.String(),
RewardUploaderStorageCost: bundleReward.UploaderStorageCost.String(),
RewardDelegation: bundleReward.Delegation.String(),
RewardTotal: bundleReward.Total.String(),
FinalizedAt: uint64(ctx.BlockTime().Unix()),
Uploader: bundleProposal.Uploader,
NextUploader: nextUploader,
Expand Down
24 changes: 15 additions & 9 deletions x/bundles/spec/06_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,30 @@ message EventBundleFinalized {
uint64 total = 6;
// status of the finalized bundle
BundleStatus status = 7;
// amount which funders provided to the total bundle reward (in ukyve)
uint64 funders_payout = 8;
// amount which funders provided to the total bundle reward
string funders_payout = 8;
// amount which the inflation pool provided to the total reward (in ukyve)
uint64 inflation_payout = 9;
// rewards transferred to treasury (in ukyve)
uint64 reward_treasury = 10;
// rewardUploader rewards directly transferred to uploader (in ukyve)
uint64 reward_uploader = 11;
// rewardDelegation rewards distributed among all delegators (in ukyve)
uint64 reward_delegation = 12;
// rewards transferred to treasury
string reward_treasury = 10;
// reward_uploader are the total rewards (commission + storage cost)
// the uploader received
string reward_uploader = 11;
// rewardDelegation rewards distributed among all delegators
string reward_delegation = 12;
// rewardTotal the total bundle reward
uint64 reward_total = 13;
string reward_total = 13;
// finalized_at the block height where the bundle got finalized
uint64 finalized_at = 14;
// uploader the address of the uploader of this bundle
string uploader = 15;
// next_uploader the address of the next uploader after this bundle
string next_uploader = 16;
// reward_uploader_storage_cost are the storage cost rewards for the uploader
string reward_uploader_storage_cost = 17;
// reward_uploader_commission are the commission rewards of the uploader.
// if the uploader has no delegations the delegation rewards are included here
string reward_uploader_commission = 18;
}
```

Expand Down
Loading

0 comments on commit f1d95f6

Please sign in to comment.