From 9d0bed8f4f4e2d472a00caf4623b2567a8982555 Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Wed, 25 Sep 2019 09:17:02 -0700 Subject: [PATCH] Merge PR #5102: Make events const and alias them (if internal) --- x/bank/alias.go | 5 +++++ x/bank/internal/types/events.go | 4 ++-- x/crisis/alias.go | 4 ++++ x/crisis/internal/types/events.go | 4 ++-- x/distribution/types/events.go | 4 ++-- x/slashing/alias.go | 12 ++++++++++++ x/staking/types/events.go | 4 ++-- 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/x/bank/alias.go b/x/bank/alias.go index 662a408ce3..3533e3084d 100644 --- a/x/bank/alias.go +++ b/x/bank/alias.go @@ -20,6 +20,11 @@ const ( RouterKey = types.RouterKey DefaultParamspace = types.DefaultParamspace DefaultSendEnabled = types.DefaultSendEnabled + + EventTypeTransfer = types.EventTypeTransfer + AttributeKeyRecipient = types.AttributeKeyRecipient + AttributeKeySender = types.AttributeKeySender + AttributeValueCategory = types.AttributeValueCategory ) var ( diff --git a/x/bank/internal/types/events.go b/x/bank/internal/types/events.go index db831a297f..c03d142f00 100644 --- a/x/bank/internal/types/events.go +++ b/x/bank/internal/types/events.go @@ -1,7 +1,7 @@ package types -// Bank module event types -var ( +// bank module event types +const ( EventTypeTransfer = "transfer" AttributeKeyRecipient = "recipient" diff --git a/x/crisis/alias.go b/x/crisis/alias.go index ce6a3ed849..6c176e2655 100644 --- a/x/crisis/alias.go +++ b/x/crisis/alias.go @@ -14,6 +14,10 @@ const ( CodeInvalidInput = types.CodeInvalidInput ModuleName = types.ModuleName DefaultParamspace = types.DefaultParamspace + + EventTypeInvariant = types.EventTypeInvariant + AttributeValueCrisis = types.AttributeValueCrisis + AttributeKeyRoute = types.AttributeKeyRoute ) var ( diff --git a/x/crisis/internal/types/events.go b/x/crisis/internal/types/events.go index 5f05cf9e72..a20a7d7a7e 100644 --- a/x/crisis/internal/types/events.go +++ b/x/crisis/internal/types/events.go @@ -1,7 +1,7 @@ package types -// Crisis module event types -var ( +// crisis module event types +const ( EventTypeInvariant = "invariant" AttributeValueCrisis = ModuleName diff --git a/x/distribution/types/events.go b/x/distribution/types/events.go index d6db257844..ce4c0ef62e 100644 --- a/x/distribution/types/events.go +++ b/x/distribution/types/events.go @@ -1,7 +1,7 @@ package types -// Distribution module event types -var ( +// distribution module event types +const ( EventTypeSetWithdrawAddress = "set_withdraw_address" EventTypeRewards = "rewards" EventTypeCommission = "commission" diff --git a/x/slashing/alias.go b/x/slashing/alias.go index 4d28dc09bd..c010751033 100644 --- a/x/slashing/alias.go +++ b/x/slashing/alias.go @@ -29,6 +29,18 @@ const ( QueryParameters = types.QueryParameters QuerySigningInfo = types.QuerySigningInfo QuerySigningInfos = types.QuerySigningInfos + + EventTypeSlash = types.EventTypeSlash + EventTypeLiveness = types.EventTypeLiveness + AttributeKeyAddress = types.AttributeKeyAddress + AttributeKeyHeight = types.AttributeKeyHeight + AttributeKeyPower = types.AttributeKeyPower + AttributeKeyReason = types.AttributeKeyReason + AttributeKeyJailed = types.AttributeKeyJailed + AttributeKeyMissedBlocks = types.AttributeKeyMissedBlocks + AttributeValueDoubleSign = types.AttributeValueDoubleSign + AttributeValueMissingSignature = types.AttributeValueMissingSignature + AttributeValueCategory = types.AttributeValueCategory ) var ( diff --git a/x/staking/types/events.go b/x/staking/types/events.go index f4eb81d2e5..ef0f01aa5c 100644 --- a/x/staking/types/events.go +++ b/x/staking/types/events.go @@ -1,7 +1,7 @@ package types -// Staking module event types -var ( +// staking module event types +const ( EventTypeCompleteUnbonding = "complete_unbonding" EventTypeCompleteRedelegation = "complete_redelegation" EventTypeCreateValidator = "create_validator"