Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: align events naming #199

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions proto/kyve/stakers/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ message MsgClaimCommissionRewards {
option (cosmos.msg.v1.signer) = "creator";
// creator ...
string creator = 1;
// amount ...
repeated cosmos.base.v1beta1.Coin amount = 2 [
// amounts ...
repeated cosmos.base.v1beta1.Coin amounts = 2 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
Expand Down
13 changes: 7 additions & 6 deletions x/bundles/keeper/logic_bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,17 @@ 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(),
RewardUploader: bundleReward.UploaderCommission.Add(bundleReward.UploaderStorageCost...).String(),
RewardDelegation: bundleReward.Delegation.String(),
RewardTotal: bundleReward.Total.String(),
FinalizedAt: uint64(ctx.BlockTime().Unix()),
Uploader: bundleProposal.Uploader,
NextUploader: nextUploader,
RewardUploaderCommission: bundleReward.UploaderCommission.String(),
RewardUploaderStorageCost: bundleReward.UploaderStorageCost.String(),
})

// Finalize the proposal, saving useful information.
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
Loading