From 3f2f4b984e33d44bf3867f6cc9cba03ff37f0501 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 5 Mar 2020 09:32:43 -0500 Subject: [PATCH 1/5] Move pkg to std/ --- {simapp/codec => codec/std}/codec.go | 2 +- {simapp/codec => codec/std}/codec.pb.go | 148 ++++++++++++------------ {simapp/codec => codec/std}/codec.proto | 4 +- {simapp/codec => codec/std}/msgs.go | 2 +- x/upgrade/types/types.pb.go | 2 +- 5 files changed, 79 insertions(+), 79 deletions(-) rename {simapp/codec => codec/std}/codec.go (99%) rename {simapp/codec => codec/std}/codec.pb.go (91%) rename {simapp/codec => codec/std}/codec.proto (97%) rename {simapp/codec => codec/std}/msgs.go (99%) diff --git a/simapp/codec/codec.go b/codec/std/codec.go similarity index 99% rename from simapp/codec/codec.go rename to codec/std/codec.go index 75dd59fb3..ce56ee61b 100644 --- a/simapp/codec/codec.go +++ b/codec/std/codec.go @@ -1,4 +1,4 @@ -package codec +package std import ( "github.com/cosmos/cosmos-sdk/codec" diff --git a/simapp/codec/codec.pb.go b/codec/std/codec.pb.go similarity index 91% rename from simapp/codec/codec.pb.go rename to codec/std/codec.pb.go index 1fff6fa81..ef4c65543 100644 --- a/simapp/codec/codec.pb.go +++ b/codec/std/codec.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: simapp/codec/codec.proto +// source: codec/std/codec.proto -package codec +package std import ( fmt "fmt" @@ -53,7 +53,7 @@ func (m *Account) Reset() { *m = Account{} } func (m *Account) String() string { return proto.CompactTextString(m) } func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{0} + return fileDescriptor_daf09dc2dfa19bb4, []int{0} } func (m *Account) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -176,7 +176,7 @@ func (m *Supply) Reset() { *m = Supply{} } func (m *Supply) String() string { return proto.CompactTextString(m) } func (*Supply) ProtoMessage() {} func (*Supply) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{1} + return fileDescriptor_daf09dc2dfa19bb4, []int{1} } func (m *Supply) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -253,7 +253,7 @@ func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{2} + return fileDescriptor_daf09dc2dfa19bb4, []int{2} } func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -327,7 +327,7 @@ func (m *MsgSubmitEvidence) Reset() { *m = MsgSubmitEvidence{} } func (m *MsgSubmitEvidence) String() string { return proto.CompactTextString(m) } func (*MsgSubmitEvidence) ProtoMessage() {} func (*MsgSubmitEvidence) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{3} + return fileDescriptor_daf09dc2dfa19bb4, []int{3} } func (m *MsgSubmitEvidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -367,7 +367,7 @@ func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } func (*MsgSubmitProposal) ProtoMessage() {} func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{4} + return fileDescriptor_daf09dc2dfa19bb4, []int{4} } func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -407,7 +407,7 @@ func (m *Proposal) Reset() { *m = Proposal{} } func (m *Proposal) String() string { return proto.CompactTextString(m) } func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{5} + return fileDescriptor_daf09dc2dfa19bb4, []int{5} } func (m *Proposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -461,7 +461,7 @@ func (m *Content) Reset() { *m = Content{} } func (m *Content) String() string { return proto.CompactTextString(m) } func (*Content) ProtoMessage() {} func (*Content) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{6} + return fileDescriptor_daf09dc2dfa19bb4, []int{6} } func (m *Content) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -573,74 +573,74 @@ func (*Content) XXX_OneofWrappers() []interface{} { } func init() { - proto.RegisterType((*Account)(nil), "cosmos_sdk.simapp.codec.v1.Account") - proto.RegisterType((*Supply)(nil), "cosmos_sdk.simapp.codec.v1.Supply") - proto.RegisterType((*Evidence)(nil), "cosmos_sdk.simapp.codec.v1.Evidence") - proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos_sdk.simapp.codec.v1.MsgSubmitEvidence") - proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos_sdk.simapp.codec.v1.MsgSubmitProposal") - proto.RegisterType((*Proposal)(nil), "cosmos_sdk.simapp.codec.v1.Proposal") - proto.RegisterType((*Content)(nil), "cosmos_sdk.simapp.codec.v1.Content") + proto.RegisterType((*Account)(nil), "cosmos_sdk.codec.std.v1.Account") + proto.RegisterType((*Supply)(nil), "cosmos_sdk.codec.std.v1.Supply") + proto.RegisterType((*Evidence)(nil), "cosmos_sdk.codec.std.v1.Evidence") + proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos_sdk.codec.std.v1.MsgSubmitEvidence") + proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos_sdk.codec.std.v1.MsgSubmitProposal") + proto.RegisterType((*Proposal)(nil), "cosmos_sdk.codec.std.v1.Proposal") + proto.RegisterType((*Content)(nil), "cosmos_sdk.codec.std.v1.Content") } -func init() { proto.RegisterFile("simapp/codec/codec.proto", fileDescriptor_3c6d4085e4065f5a) } +func init() { proto.RegisterFile("codec/std/codec.proto", fileDescriptor_daf09dc2dfa19bb4) } -var fileDescriptor_3c6d4085e4065f5a = []byte{ - // 878 bytes of a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, 0x1a, 0x7a, 0x86, 0xd0, 0xfb, 0x70, 0xbd, - 0xde, 0xbe, 0x62, 0x37, 0x04, 0xdf, 0xa0, 0xad, 0x11, 0xf8, 0x15, 0x78, 0x25, 0x24, 0x6e, 0x12, - 0x2c, 0x8f, 0xe8, 0xaa, 0xd0, 0x79, 0xa7, 0xae, 0x23, 0xef, 0x61, 0xae, 0xb0, 0x27, 0xd0, 0xcb, - 0xc4, 0x2f, 0x87, 0xd5, 0x85, 0xe1, 0xe3, 0x93, 0xa3, 0x9d, 0x8f, 0xee, 0x79, 0x3e, 0x9f, 0x27, - 0x33, 0x13, 0x91, 0x50, 0x55, 0x4d, 0x51, 0x49, 0xcc, 0x7d, 0x6e, 0xa9, 0x7b, 0x8f, 0x33, 0x4a, - 0x62, 0x8e, 0x5d, 0x53, 0x51, 0x47, 0x57, 0xc1, 0x15, 0x96, 0x84, 0xdb, 0xbf, 0xea, 0x60, 0xe3, - 0x40, 0xc8, 0xc1, 0x5d, 0xb0, 0x21, 0x85, 0xd5, 0xbd, 0xe9, 0xaf, 0x32, 0x25, 0xf1, 0x13, 0x6d, - 0xaa, 0xf0, 0xc3, 0x27, 0xff, 0x1d, 0x0e, 0xf4, 0x93, 0xa3, 0x9d, 0x47, 0x97, 0x59, 0x51, 0x05, - 0x56, 0x9a, 0x91, 0x99, 0xbe, 0x28, 0xcc, 0xfc, 0xa1, 0x83, 0xce, 0x33, 0x55, 0x67, 0xf0, 0x4b, - 0x70, 0x1d, 0xff, 0x94, 0xf8, 0x29, 0x41, 0x4e, 0x7e, 0xf5, 0x95, 0xa9, 0xbb, 0x75, 0x53, 0x45, - 0x55, 0xe6, 0xb6, 0x9e, 0x55, 0xd0, 0x13, 0x6d, 0x5a, 0x63, 0x0f, 0x9f, 0x2a, 0x8b, 0x8f, 0x2f, - 0x71, 0x58, 0x96, 0x79, 0xe9, 0xb1, 0x30, 0x54, 0x98, 0xfc, 0x4b, 0x07, 0xaf, 0xed, 0x31, 0xef, - 0x20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x47, 0xfe, 0xb3, 0x13, 0x63, 0x5b, 0x8d, 0x13, 0xd5, 0x33, 0xef, 0xd7, - 0xb3, 0xab, 0xa0, 0xa8, 0x63, 0x45, 0xf8, 0x46, 0x2e, 0x55, 0xd3, 0xb3, 0x7a, 0x08, 0x52, 0xb0, - 0x85, 0x9c, 0x08, 0xe1, 0xc0, 0x6e, 0xa8, 0x18, 0x6d, 0xe3, 0xa0, 0xa2, 0x32, 0x16, 0xbc, 0xd5, - 0x5a, 0x37, 0x51, 0x1b, 0x00, 0x06, 0xe0, 0x75, 0x44, 0xc2, 0x30, 0x89, 0x7c, 0xbe, 0xb0, 0x29, - 0x21, 0x81, 0xcd, 0x28, 0x8e, 0x5c, 0xd5, 0x30, 0x77, 0xeb, 0x72, 0xd5, 0x19, 0x29, 0x4f, 0x53, - 0x31, 0xf7, 0x09, 0x09, 0x0e, 0x72, 0x5e, 0x45, 0x10, 0xa2, 0x46, 0x74, 0xb8, 0xab, 0xda, 0xc3, - 0xfd, 0x4b, 0xda, 0x43, 0x39, 0xe7, 0xcb, 0x0b, 0x23, 0xbb, 0xc2, 0x68, 0x7c, 0x7c, 0xde, 0xd7, - 0x4f, 0xcf, 0xfb, 0xfa, 0xbf, 0xe7, 0x7d, 0xfd, 0xb7, 0x8b, 0xbe, 0x76, 0x7a, 0xd1, 0xd7, 0xfe, - 0xb9, 0xe8, 0x6b, 0xdf, 0xbd, 0xb7, 0x36, 0x65, 0xf5, 0xbf, 0xd3, 0x6c, 0x43, 0x8c, 0xf4, 0x87, - 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x70, 0x52, 0xf3, 0x25, 0x52, 0x09, 0x00, 0x00, +var fileDescriptor_daf09dc2dfa19bb4 = []byte{ + // 875 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x41, 0x6f, 0xdc, 0x44, + 0x14, 0xb6, 0xa9, 0x9b, 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xc8, 0xc0, 0x26, 0xf2, 0x62, + 0x44, 0x42, 0xb7, 0xa5, 0x62, 0x75, 0x4d, 0x81, 0x9a, 0xca, 0x48, 0xf2, 0x96, 0x6b, 0x6d, 0xa0, + 0x2e, 0x00, 0x0c, 0xc1, 0x9b, 0x88, 0x46, 0x51, 0x1a, 0x07, 0x62, 0xee, 0x32, 0x4a, 0x43, 0x97, + 0x33, 0x12, 0x63, 0xdd, 0x27, 0x0f, 0x9b, 0x72, 0xf5, 0xd1, 0xa8, 0x4e, 0x53, 0x33, 0x8f, 0x29, + 0x0d, 0x4f, 0x0a, 0x5e, 0x4d, 0x10, 0xa2, 0x56, 0x74, 0x70, 0xa8, 0xbb, 0xc2, 0xed, 0x4b, 0xba, + 0x42, 0x35, 0xde, 0xab, 0x0b, 0xa3, 0x9a, 0xc1, 0xf0, 0xe1, 0xb3, 0xf3, 0xbe, 0x79, 0x76, 0xde, + 0x37, 0xff, 0x3d, 0xef, 0x9b, 0xbf, 0x5d, 0xf4, 0x8d, 0xb3, 0x8b, 0xbe, 0xf1, 0xcf, 0x45, 0xdf, + 0xf8, 0x6e, 0x7f, 0x65, 0xca, 0xea, 0xcf, 0xd2, 0x74, 0x4d, 0x8e, 0xf1, 0xbb, 0xff, 0x07, 0x00, + 0x00, 0xff, 0xff, 0xf7, 0xf2, 0xb6, 0xa2, 0x40, 0x09, 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { diff --git a/simapp/codec/codec.proto b/codec/std/codec.proto similarity index 97% rename from simapp/codec/codec.proto rename to codec/std/codec.proto index 620370d34..94297308a 100644 --- a/simapp/codec/codec.proto +++ b/codec/std/codec.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package cosmos_sdk.simapp.codec.v1; +package cosmos_sdk.codec.std.v1; import "third_party/proto/cosmos-proto/cosmos.proto"; import "third_party/proto/gogoproto/gogo.proto"; @@ -12,7 +12,7 @@ import "x/params/types/proposal/types.proto"; import "x/upgrade/types/types.proto"; import "x/distribution/types/types.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/simapp/codec"; +option go_package = "github.com/cosmos/cosmos-sdk/codec/std"; // Account defines the application-level Account type. message Account { diff --git a/simapp/codec/msgs.go b/codec/std/msgs.go similarity index 99% rename from simapp/codec/msgs.go rename to codec/std/msgs.go index 5c4599d8d..4d15d8143 100644 --- a/simapp/codec/msgs.go +++ b/codec/std/msgs.go @@ -1,4 +1,4 @@ -package codec +package std import ( sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/upgrade/types/types.pb.go b/x/upgrade/types/types.pb.go index f8c8f1ffd..c0cb0cf18 100644 --- a/x/upgrade/types/types.pb.go +++ b/x/upgrade/types/types.pb.go @@ -117,7 +117,7 @@ func (m *SoftwareUpgradeProposal) XXX_DiscardUnknown() { var xxx_messageInfo_SoftwareUpgradeProposal proto.InternalMessageInfo -// SoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade type CancelSoftwareUpgradeProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` From 4dac1abebf5d1c20ef3603c71c095296cf149827 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 5 Mar 2020 09:40:43 -0500 Subject: [PATCH 2/5] Update imports --- simapp/app.go | 7 +++---- simapp/genesis.go | 5 ++--- simapp/utils_test.go | 4 ++-- x/auth/types/common_test.go | 4 ++-- x/auth/vesting/types/common_test.go | 4 ++-- x/evidence/handler_test.go | 10 +++++----- x/evidence/keeper/keeper_test.go | 4 ++-- x/evidence/keeper/querier_test.go | 10 +++++----- x/evidence/types/codec_test.go | 4 ++-- x/evidence/types/msgs_test.go | 6 +++--- x/gov/abci_test.go | 12 ++++++------ x/gov/keeper/common_test.go | 4 ++-- x/gov/keeper/querier_test.go | 6 +++--- x/staking/common_test.go | 4 ++-- x/staking/keeper/common_test.go | 4 ++-- x/supply/keeper/bank_test.go | 8 ++++---- x/supply/keeper/keeper_test.go | 4 ++-- 17 files changed, 49 insertions(+), 51 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index 5408bcfe9..f6ee16948 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -11,7 +11,7 @@ import ( bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" @@ -126,9 +126,8 @@ func NewSimApp( ) *SimApp { // TODO: Remove cdc in favor of appCodec once all modules are migrated. - cdc := simappcodec.MakeCodec(ModuleBasics) - - appCodec := simappcodec.NewAppCodec(cdc) + cdc := codecstd.MakeCodec(ModuleBasics) + appCodec := codecstd.NewAppCodec(cdc) bApp := bam.NewBaseApp(appName, logger, db, auth.DefaultTxDecoder(cdc), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) diff --git a/simapp/genesis.go b/simapp/genesis.go index 1a760e3e4..c7432aab1 100644 --- a/simapp/genesis.go +++ b/simapp/genesis.go @@ -3,7 +3,7 @@ package simapp import ( "encoding/json" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" ) // The genesis state of the blockchain is represented here as a map of raw json @@ -17,7 +17,6 @@ type GenesisState map[string]json.RawMessage // NewDefaultGenesisState generates the default state for the application. func NewDefaultGenesisState() GenesisState { - cdc := simappcodec.MakeCodec(ModuleBasics) - + cdc := codecstd.MakeCodec(ModuleBasics) return ModuleBasics.DefaultGenesis(cdc) } diff --git a/simapp/utils_test.go b/simapp/utils_test.go index b6d5fa1f3..710c2b9d4 100644 --- a/simapp/utils_test.go +++ b/simapp/utils_test.go @@ -8,13 +8,13 @@ import ( tmkv "github.com/tendermint/tendermint/libs/kv" "github.com/cosmos/cosmos-sdk/codec" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" ) func TestGetSimulationLog(t *testing.T) { - cdc := simappcodec.MakeCodec(ModuleBasics) + cdc := codecstd.MakeCodec(ModuleBasics) decoders := make(sdk.StoreDecoderRegistry) decoders[auth.StoreKey] = func(cdc *codec.Codec, kvAs, kvBs tmkv.Pair) string { return "10" } diff --git a/x/auth/types/common_test.go b/x/auth/types/common_test.go index 02b80ac6a..70214acb3 100644 --- a/x/auth/types/common_test.go +++ b/x/auth/types/common_test.go @@ -1,11 +1,11 @@ package types_test import ( + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" ) var ( app = simapp.Setup(false) - appCodec = simappcodec.NewAppCodec(app.Codec()) + appCodec = codecstd.NewAppCodec(app.Codec()) ) diff --git a/x/auth/vesting/types/common_test.go b/x/auth/vesting/types/common_test.go index 02b80ac6a..70214acb3 100644 --- a/x/auth/vesting/types/common_test.go +++ b/x/auth/vesting/types/common_test.go @@ -1,11 +1,11 @@ package types_test import ( + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" ) var ( app = simapp.Setup(false) - appCodec = simappcodec.NewAppCodec(app.Codec()) + appCodec = codecstd.NewAppCodec(app.Codec()) ) diff --git a/x/evidence/handler_test.go b/x/evidence/handler_test.go index 60e883364..9f7cc1191 100644 --- a/x/evidence/handler_test.go +++ b/x/evidence/handler_test.go @@ -10,8 +10,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/ed25519" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/evidence" "github.com/cosmos/cosmos-sdk/x/evidence/exported" @@ -25,8 +25,8 @@ type HandlerTestSuite struct { app *simapp.SimApp } -func testMsgSubmitEvidence(r *require.Assertions, e exported.Evidence, s sdk.AccAddress) simappcodec.MsgSubmitEvidence { - msg, err := simappcodec.NewMsgSubmitEvidence(e, s) +func testMsgSubmitEvidence(r *require.Assertions, e exported.Evidence, s sdk.AccAddress) codecstd.MsgSubmitEvidence { + msg, err := codecstd.NewMsgSubmitEvidence(e, s) r.NoError(err) return msg } @@ -55,7 +55,7 @@ func (suite *HandlerTestSuite) SetupTest() { // recreate keeper in order to use custom testing types evidenceKeeper := evidence.NewKeeper( - simappcodec.NewAppCodec(app.Codec()), app.GetKey(evidence.StoreKey), + codecstd.NewAppCodec(app.Codec()), app.GetKey(evidence.StoreKey), app.GetSubspace(evidence.ModuleName), app.StakingKeeper, app.SlashingKeeper, ) router := evidence.NewRouter() @@ -118,7 +118,7 @@ func (suite *HandlerTestSuite) TestMsgSubmitEvidence() { suite.Require().NoError(err, "unexpected error; tc #%d", i) suite.Require().NotNil(res, "expected non-nil result; tc #%d", i) - msg := tc.msg.(simappcodec.MsgSubmitEvidence) + msg := tc.msg.(codecstd.MsgSubmitEvidence) suite.Require().Equal(msg.GetEvidence().Hash().Bytes(), res.Data, "invalid hash; tc #%d", i) } } diff --git a/x/evidence/keeper/keeper_test.go b/x/evidence/keeper/keeper_test.go index a28f66efe..49a2b39be 100644 --- a/x/evidence/keeper/keeper_test.go +++ b/x/evidence/keeper/keeper_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/evidence" @@ -83,7 +83,7 @@ func (suite *KeeperTestSuite) SetupTest() { // recreate keeper in order to use custom testing types evidenceKeeper := evidence.NewKeeper( - simappcodec.NewAppCodec(app.Codec()), app.GetKey(evidence.StoreKey), + codecstd.NewAppCodec(app.Codec()), app.GetKey(evidence.StoreKey), app.GetSubspace(evidence.ModuleName), app.StakingKeeper, app.SlashingKeeper, ) router := evidence.NewRouter() diff --git a/x/evidence/keeper/querier_test.go b/x/evidence/keeper/querier_test.go index 069f41c6c..9b99fd4a8 100644 --- a/x/evidence/keeper/querier_test.go +++ b/x/evidence/keeper/querier_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "strings" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/x/evidence/exported" "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -17,7 +17,7 @@ const ( func (suite *KeeperTestSuite) TestQueryEvidence_Existing() { ctx := suite.ctx.WithIsCheckTx(false) numEvidence := 100 - cdc := simappcodec.NewAppCodec(suite.app.Codec()) + cdc := codecstd.NewAppCodec(suite.app.Codec()) evidence := suite.populateEvidence(ctx, numEvidence) query := abci.RequestQuery{ @@ -36,7 +36,7 @@ func (suite *KeeperTestSuite) TestQueryEvidence_Existing() { func (suite *KeeperTestSuite) TestQueryEvidence_NonExisting() { ctx := suite.ctx.WithIsCheckTx(false) - cdc := simappcodec.NewAppCodec(suite.app.Codec()) + cdc := codecstd.NewAppCodec(suite.app.Codec()) numEvidence := 100 suite.populateEvidence(ctx, numEvidence) @@ -52,7 +52,7 @@ func (suite *KeeperTestSuite) TestQueryEvidence_NonExisting() { func (suite *KeeperTestSuite) TestQueryAllEvidence() { ctx := suite.ctx.WithIsCheckTx(false) - cdc := simappcodec.NewAppCodec(suite.app.Codec()) + cdc := codecstd.NewAppCodec(suite.app.Codec()) numEvidence := 100 suite.populateEvidence(ctx, numEvidence) @@ -72,7 +72,7 @@ func (suite *KeeperTestSuite) TestQueryAllEvidence() { func (suite *KeeperTestSuite) TestQueryAllEvidence_InvalidPagination() { ctx := suite.ctx.WithIsCheckTx(false) - cdc := simappcodec.NewAppCodec(suite.app.Codec()) + cdc := codecstd.NewAppCodec(suite.app.Codec()) numEvidence := 100 suite.populateEvidence(ctx, numEvidence) diff --git a/x/evidence/types/codec_test.go b/x/evidence/types/codec_test.go index af2656d38..cfe2a6483 100644 --- a/x/evidence/types/codec_test.go +++ b/x/evidence/types/codec_test.go @@ -7,15 +7,15 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" "github.com/cosmos/cosmos-sdk/x/evidence/exported" "github.com/cosmos/cosmos-sdk/x/evidence/types" ) func TestCodec(t *testing.T) { app := simapp.Setup(false) - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) pk := ed25519.GenPrivKey() var e exported.Evidence = &types.Equivocation{ diff --git a/x/evidence/types/msgs_test.go b/x/evidence/types/msgs_test.go index 127df2535..73d4ef67e 100644 --- a/x/evidence/types/msgs_test.go +++ b/x/evidence/types/msgs_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/evidence/exported" "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -13,8 +13,8 @@ import ( "github.com/tendermint/tendermint/crypto/ed25519" ) -func testMsgSubmitEvidence(t *testing.T, e exported.Evidence, s sdk.AccAddress) simappcodec.MsgSubmitEvidence { - msg, err := simappcodec.NewMsgSubmitEvidence(e, s) +func testMsgSubmitEvidence(t *testing.T, e exported.Evidence, s sdk.AccAddress) codecstd.MsgSubmitEvidence { + msg, err := codecstd.NewMsgSubmitEvidence(e, s) require.NoError(t, err) return msg } diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index c82019be7..4774f4508 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/staking" @@ -28,7 +28,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg, err := simappcodec.NewMsgSubmitProposal( + newProposalMsg, err := codecstd.NewMsgSubmitProposal( gov.ContentFromProposalType("test", "test", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -80,7 +80,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg, err := simappcodec.NewMsgSubmitProposal( + newProposalMsg, err := codecstd.NewMsgSubmitProposal( gov.ContentFromProposalType("test", "test", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -103,7 +103,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg2, err := simappcodec.NewMsgSubmitProposal( + newProposalMsg2, err := codecstd.NewMsgSubmitProposal( gov.ContentFromProposalType("test2", "test2", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -160,7 +160,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, activeQueue.Valid()) activeQueue.Close() - newProposalMsg, err := simappcodec.NewMsgSubmitProposal( + newProposalMsg, err := codecstd.NewMsgSubmitProposal( gov.ContentFromProposalType("test2", "test2", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -216,7 +216,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(5))} - newProposalMsg, err := simappcodec.NewMsgSubmitProposal(TestProposal, proposalCoins, addrs[0]) + newProposalMsg, err := codecstd.NewMsgSubmitProposal(TestProposal, proposalCoins, addrs[0]) require.NoError(t, err) res, err := govHandler(ctx, newProposalMsg) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index e7e9747a0..a61171e24 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -1,8 +1,8 @@ package keeper_test import ( + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/staking" @@ -17,7 +17,7 @@ func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sd valAddrs := simapp.ConvertAddrsToValAddrs(addrs) pks := simapp.CreateTestPubKeys(5) - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) app.StakingKeeper = staking.NewKeeper( appCodec, app.GetKey(staking.StoreKey), diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 918f054a7..f0377d2f2 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -10,8 +10,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -147,7 +147,7 @@ func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc codec.JSONMarshaler, que func TestQueries(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) querier := keeper.NewQuerier(app.GovKeeper) @@ -295,7 +295,7 @@ func TestQueries(t *testing.T) { func TestPaginatedVotesQuery(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) proposal := types.Proposal{ ProposalBase: types.ProposalBase{ diff --git a/x/staking/common_test.go b/x/staking/common_test.go index e55baa0f0..22f388ed0 100644 --- a/x/staking/common_test.go +++ b/x/staking/common_test.go @@ -6,8 +6,8 @@ import ( "github.com/tendermint/tendermint/crypto/secp256k1" "github.com/cosmos/cosmos-sdk/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - cdc "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -43,7 +43,7 @@ func getBaseSimappWithCustomKeeper() (*codec.Codec, *simapp.SimApp, sdk.Context) app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) - appCodec := cdc.NewAppCodec(codec.New()) + appCodec := codecstd.NewAppCodec(codec.New()) app.StakingKeeper = keeper.NewKeeper( appCodec, diff --git a/x/staking/keeper/common_test.go b/x/staking/keeper/common_test.go index d71737ddc..01cb1a75d 100644 --- a/x/staking/keeper/common_test.go +++ b/x/staking/keeper/common_test.go @@ -6,8 +6,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/codec" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -24,7 +24,7 @@ func createTestInput() (*codec.Codec, *simapp.SimApp, sdk.Context) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) - appCodec := simappcodec.NewAppCodec(codec.New()) + appCodec := codecstd.NewAppCodec(codec.New()) app.StakingKeeper = keeper.NewKeeper( appCodec, diff --git a/x/supply/keeper/bank_test.go b/x/supply/keeper/bank_test.go index cb6237147..3a4e8a15c 100644 --- a/x/supply/keeper/bank_test.go +++ b/x/supply/keeper/bank_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" keep "github.com/cosmos/cosmos-sdk/x/supply/keeper" "github.com/cosmos/cosmos-sdk/x/supply/types" @@ -55,7 +55,7 @@ func TestSendCoins(t *testing.T) { maccPerms[multiPerm] = []string{types.Burner, types.Minter, types.Staking} maccPerms[randomPerm] = []string{"random"} - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) keeper := keep.NewKeeper(appCodec, app.GetKey(types.StoreKey), app.AccountKeeper, app.BankKeeper, maccPerms) ak := app.AccountKeeper @@ -116,7 +116,7 @@ func TestMintCoins(t *testing.T) { maccPerms[multiPerm] = []string{types.Burner, types.Minter, types.Staking} maccPerms[randomPerm] = []string{"random"} - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) keeper := keep.NewKeeper(appCodec, app.GetKey(types.StoreKey), app.AccountKeeper, app.BankKeeper, maccPerms) ak := app.AccountKeeper @@ -164,7 +164,7 @@ func TestBurnCoins(t *testing.T) { maccPerms[multiPerm] = []string{types.Burner, types.Minter, types.Staking} maccPerms[randomPerm] = []string{"random"} - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) keeper := keep.NewKeeper(appCodec, app.GetKey(types.StoreKey), app.AccountKeeper, app.BankKeeper, maccPerms) ak := app.AccountKeeper diff --git a/x/supply/keeper/keeper_test.go b/x/supply/keeper/keeper_test.go index a81575914..d43b140d0 100644 --- a/x/supply/keeper/keeper_test.go +++ b/x/supply/keeper/keeper_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + codecstd "github.com/cosmos/cosmos-sdk/codec/std" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" keep "github.com/cosmos/cosmos-sdk/x/supply/keeper" "github.com/cosmos/cosmos-sdk/x/supply/types" @@ -39,7 +39,7 @@ func TestValidatePermissions(t *testing.T) { maccPerms[multiPerm] = []string{types.Burner, types.Minter, types.Staking} maccPerms[randomPerm] = []string{"random"} - appCodec := simappcodec.NewAppCodec(app.Codec()) + appCodec := codecstd.NewAppCodec(app.Codec()) keeper := keep.NewKeeper(appCodec, app.GetKey(types.StoreKey), app.AccountKeeper, app.BankKeeper, maccPerms) err := keeper.ValidatePermissions(multiPermAcc) From 69ba71c28da603721a5a8c607d83843039da2353 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 5 Mar 2020 09:44:11 -0500 Subject: [PATCH 3/5] Add pkg doc --- codec/std/doc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 codec/std/doc.go diff --git a/codec/std/doc.go b/codec/std/doc.go new file mode 100644 index 000000000..9b57bd591 --- /dev/null +++ b/codec/std/doc.go @@ -0,0 +1,10 @@ +/* +Package std defines all the common and standard Cosmos SDK Protocol Buffer +message definitions and type implementations. The std package defines and exposes +a single concrete Codec type that implements all the necessary module codec +interfaces along with all the types necessary to use those modules. + +Applications can choose to either use the codec directly or even extend it without +having the need to redefine all the message and type implementations. +*/ +package std From bc863c921202cb13eff9f07f7fed9816c253e42e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2020 15:40:25 +0000 Subject: [PATCH 4/5] Update module spec (#5751) --- docs/building-modules/structure.md | 58 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/docs/building-modules/structure.md b/docs/building-modules/structure.md index bb20c9945..5f7315f91 100644 --- a/docs/building-modules/structure.md +++ b/docs/building-modules/structure.md @@ -1,6 +1,8 @@ # Recommended Folder Structure @@ -20,23 +22,24 @@ x/{module} │   └── tx.go ├── exported │   └── exported.go -├── internal -│   ├── keeper -│   │   ├── invariants.go -│   │   ├── keeper.go -│   │   ├── ... -│   │   └── querier.go -│   └── types -│   ├── codec.go -│   ├── errors.go -│   ├── events.go -│   ├── expected_keepers.go -│   ├── genesis.go -│   ├── keys.go -│   ├── msgs.go -│   ├── params.go -│   ├── ... -│   └── querier.go +├── keeper +│   ├── invariants.go +│   ├── keeper.go +│   ├── ... +│   └── querier.go +├── types +│ ├── codec.go +│ ├── errors.go +│ ├── events.go +│ ├── expected_keepers.go +│ ├── genesis.go +│ ├── keys.go +│ ├── msgs.go +│ ├── params.go +│ ├── types.pb.go +│ ├── types.proto +│ ├── ... +│ └── querier.go ├── simulation │   ├── decoder.go │   ├── genesis.go @@ -55,9 +58,8 @@ x/{module} - `alias.go`: The module's exported types, constants, and variables. These are mainly to improve developer ergonomics by only needing to import a single package. Note, there is nothing preventing developers from importing other packages from the module -(excluding`internal/`) but it is recommended that `alias.go` have everything -exposed that other modules may need. The majority of the exported values here will -typically come from `internal/` (see below). +but it is recommended that `alias.go` have everything exposed that other modules +may need. - `client/`: The module's CLI and REST client functionality implementation and testing. - `exported/`: The module's exported types -- typically type interfaces. If a module @@ -72,16 +74,10 @@ DRY and also alleviates import cycle chaos. - `genesis.go`: The module's genesis related business logic (e.g. `InitGenesis`). Note, genesis types are defined in `internal/types`. - `handler.go`: The module's message handlers. -- `internal/`: The module's internal types and implementations. The purpose of -this package is mainly two fold. First, it signals that this package is not -intended to be used or imported anywhere outside the defining module. Secondly, -it goes hand-in-hand with `alias.go` in that it allows public types and functions -to be used internally while not being exposed outside to the outside world. This -allows for greater freedom of development while maintaining API stability. - - `internal/types`: The module's type definitions such as messages, `KVStore` - keys, parameter types, and `expected_keepers.go` contracts. - - `internal/keeper`: The module's keeper implementation along with any auxiliary - implementations such as the querier and invariants. +- `keeper/`: The module's keeper implementation along with any auxiliary +implementations such as the querier and invariants. +- `types/`: The module's type definitions such as messages, `KVStore` keys, +parameter types, Protocol Buffer definitions, and `expected_keepers.go` contracts. - `module.go`: The module's implementation of the `AppModule` and `AppModuleBasic` interfaces. - `simulation/`: The module's simulation package defines all the required functions From 6c1e3e53e3bc4ed2ddc54d3bb4cf10ce3c6d9cee Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2020 16:02:17 +0000 Subject: [PATCH 5/5] [ADR: 013] Observability (#5188) * [ADR: 013] Metrics - Inital ADR for metrics with in the SDK - extending metrics to be module specific as well Signed-off-by: Marko Baricevic * add some metrics * update adr-013 to Observability * Update docs/architecture/README.MD Co-Authored-By: Jack Zampolin * change wording * minor wording change * add more things * undo module work * Fix formatting and added more info * Address comments * Address comments Co-authored-by: Alexander Bezobchuk Co-authored-by: Jack Zampolin Co-authored-by: Timothy Chen Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- docs/architecture/README.md | 1 + docs/architecture/adr-013-metrics.md | 97 ++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 docs/architecture/adr-013-metrics.md diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 09632c114..e327a5b64 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -39,6 +39,7 @@ Please add a entry below in your Pull Request for an ADR. - [ADR 010: Modular AnteHandler](./adr-010-modular-antehandler.md) - [ADR 011: Generalize Genesis Accounts](./adr-011-generalize-genesis-accounts.md) - [ADR 012: State Accessors](./adr-012-state-accessors.md) +- [ADR 013: Observability](./adr-013-observability.md) - [ADR 015: IBC Packet Receiver](./adr-015-ibc-packet-receiver.md) - [ADR 016: Validator Consensus Key Rotation](./adr-016-validator-consensus-key-rotation.md) - [ADR 017: Historical Header Module](./adr-017-historical-header-module.md) diff --git a/docs/architecture/adr-013-metrics.md b/docs/architecture/adr-013-metrics.md new file mode 100644 index 000000000..bb2b2b8d6 --- /dev/null +++ b/docs/architecture/adr-013-metrics.md @@ -0,0 +1,97 @@ +# ADR 013: Observability + +## Changelog + +- 20-01-2020: Initial Draft + +## Status + +Proposed + +## Context + +There has been discussion around exposing more metrics to users and node operators about the application. Currently there is only a way to expose metrics from Tendermint and not the application itself. To bring more visibility into applications, I would like to propose reporting of metrics through [Prometheus](https://prometheus.io/). + +Extending `AppModuleBasic` to support registering of metrics would enable developers to see more information about individual modules. + +```go +type AppModuleBasic interface { + Name() string + RegisterCodec(*codec.Codec) + RegisterMetrics(namespace string, labelsAndValues... string) *Metrics + + // genesis + DefaultGenesis() json.RawMessage + ValidateGenesis(json.RawMessage) error + + // client functionality + RegisterRESTRoutes(context.CLIContext, *mux.Router) + GetTxCmd(*codec.Codec) *cobra.Command + GetQueryCmd(*codec.Codec) *cobra.Command +} +// ..... + +func (bm BasicManager) RegisterMetrics(appName string, labelsAndValues... string) MetricsProvider { + for _, b := range bm { + b.CreateMetrics(appName, labelsAndValues) + } +} +``` + +Each module can define its own `Metrics` type and`CreateMetrics` function in the x//observability/metrics.go file: + +```go +type Metrics struct { + Size metrics.Guage + + Transactions metrics.Counter +} + +func CreateMetrics(namespace string, labelsAndValues... string) *Metrics { + labels := make([]string, len(labelsAndValues/2)) + for i := 0; i < len(labelsAndValues); i += 2 { + labels[i/2] = labelsAndValues[i] + } + return &Metrics{ + Size: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ + Namespace: namespace, + Subsystem: "subsystem", + Name: "size", + Help: "Size of the custom metric", + }, labels).With(labelsAndValues...), + Transactions: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ + Namespace: namespace, + Subsystem: "subsystem", + Name: "transactions", + Help: "Number of transactions processed", + }, labels).With(labelsAndValues...), + } + +``` + +To get the correct namespace for the modules changing `BasicManager` to consist of the app name is needed. + +```go +type BasicManager struct { + appName string + modules map[string]AppModuleBasic +} +``` + +## Decision + +- Use Prometheus for metric gathering. +- Add a method to register metrics to the `AppModuleBasic` interface +- Modules create a observability/metrics.go that defines the metrics and create the metrics object. + +## Consequences + +### Positive + +- Add more visibility into SDK based application and modules + +### Negative + +### Neutral + +## References