Skip to content

Commit

Permalink
chore: reorganize repo structure (#7)
Browse files Browse the repository at this point in the history
* chore: update module path to v2

* feat: upgrade protobuf to cosmos sdk v0.50

* feat: upgrade module to cosmos sdk v0.50

* feat: support app wiring

* chore: include authority query cmd

* chore: small nits

* chore: reorganize repo structure
  • Loading branch information
johnletey authored Sep 23, 2024
1 parent cd9d62b commit 258836b
Show file tree
Hide file tree
Showing 53 changed files with 341 additions and 345 deletions.
2 changes: 0 additions & 2 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
[![codecov](https://img.shields.io/codecov/c/gh/noble-assets/florin?token=E3Q02S9U5R&labelColor=black)](https://codecov.io/gh/noble-assets/florin)

This repository includes the `x/florin` Cosmos SDK module implementation.

For more information, refer to the module's [spec](../x/florin/spec) files.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ proto-breaking:

test-unit:
@echo "🤖 Running unit tests..."
@go test -cover -coverprofile=coverage.out -race -v ./x/florin/keeper/...
@go test -cover -coverprofile=coverage.out -race -v ./keeper/...
@echo "✅ Completed unit tests!"
2 changes: 1 addition & 1 deletion x/florin/client/cli/query.go → client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/gogoproto/proto"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/types"
"github.com/spf13/cobra"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/types/blacklist"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion x/florin/client/cli/tx.go → client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/types"
"github.com/spf13/cobra"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/types/blacklist"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions x/florin/genesis.go → genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package florin
import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/monerium/module-noble/v2/x/florin/keeper"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/keeper"
"github.com/monerium/module-noble/v2/types"
"github.com/monerium/module-noble/v2/types/blacklist"
)

func InitGenesis(ctx sdk.Context, k *keeper.Keeper, genesis types.GenesisState) {
Expand Down
4 changes: 2 additions & 2 deletions x/florin/keeper/keeper.go → keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

"cosmossdk.io/core/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/types"
"github.com/monerium/module-noble/v2/types/blacklist"
)

type Keeper struct {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion x/florin/keeper/msg_server.go → keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"adr36.dev"
"cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/types"
)

var _ types.MsgServer = &msgServer{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/types/blacklist"
)

var _ blacklist.MsgServer = &blacklistMsgServer{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/monerium/module-noble/v2/keeper"
"github.com/monerium/module-noble/v2/types/blacklist"
"github.com/monerium/module-noble/v2/utils"
"github.com/monerium/module-noble/v2/utils/mocks"
"github.com/monerium/module-noble/v2/x/florin/keeper"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/monerium/module-noble/v2/keeper"
"github.com/monerium/module-noble/v2/types"
"github.com/monerium/module-noble/v2/utils"
"github.com/monerium/module-noble/v2/utils/mocks"
"github.com/monerium/module-noble/v2/x/florin/keeper"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion x/florin/keeper/query_server.go → keeper/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/types"
)

var _ types.QueryServer = &queryServer{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/types/blacklist"
)

var _ blacklist.QueryServer = &blacklistQueryServer{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/monerium/module-noble/v2/keeper"
"github.com/monerium/module-noble/v2/types/blacklist"
"github.com/monerium/module-noble/v2/utils"
"github.com/monerium/module-noble/v2/utils/mocks"
"github.com/monerium/module-noble/v2/x/florin/keeper"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/monerium/module-noble/v2/keeper"
"github.com/monerium/module-noble/v2/types"
"github.com/monerium/module-noble/v2/utils"
"github.com/monerium/module-noble/v2/utils/mocks"
"github.com/monerium/module-noble/v2/x/florin/keeper"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion x/florin/keeper/state.go → keeper/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"cosmossdk.io/store/prefix"
"github.com/cosmos/cosmos-sdk/runtime"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/types"
)

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"cosmossdk.io/store/prefix"
"github.com/cosmos/cosmos-sdk/runtime"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/types/blacklist"
)

//
Expand Down
2 changes: 1 addition & 1 deletion x/florin/keeper/state_test.go → keeper/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package keeper_test
import (
"testing"

"github.com/monerium/module-noble/v2/types"
"github.com/monerium/module-noble/v2/utils"
"github.com/monerium/module-noble/v2/utils/mocks"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/stretchr/testify/require"
)

Expand Down
8 changes: 4 additions & 4 deletions x/florin/module.go → module.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
modulev1 "github.com/monerium/module-noble/v2/api/module/v1"
"github.com/monerium/module-noble/v2/x/florin/client/cli"
"github.com/monerium/module-noble/v2/x/florin/keeper"
"github.com/monerium/module-noble/v2/x/florin/types"
"github.com/monerium/module-noble/v2/x/florin/types/blacklist"
"github.com/monerium/module-noble/v2/client/cli"
"github.com/monerium/module-noble/v2/keeper"
"github.com/monerium/module-noble/v2/types"
"github.com/monerium/module-noble/v2/types/blacklist"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion proto/florin/blacklist/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/monerium/module-noble/v2/x/florin/types/blacklist";
option go_package = "github.com/monerium/module-noble/v2/types/blacklist";

// Emitted when a validator makes a decision.
message Decision {
Expand Down
2 changes: 1 addition & 1 deletion proto/florin/blacklist/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package florin.blacklist.v1;

option go_package = "github.com/monerium/module-noble/v2/x/florin/types/blacklist";
option go_package = "github.com/monerium/module-noble/v2/types/blacklist";

message GenesisState {
string owner = 1;
Expand Down
2 changes: 1 addition & 1 deletion proto/florin/blacklist/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package florin.blacklist.v1;
import "cosmos/query/v1/query.proto";
import "google/api/annotations.proto";

option go_package = "github.com/monerium/module-noble/v2/x/florin/types/blacklist";
option go_package = "github.com/monerium/module-noble/v2/types/blacklist";

service Query {
rpc Owner(QueryOwner) returns (QueryOwnerResponse) {
Expand Down
2 changes: 1 addition & 1 deletion proto/florin/blacklist/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/monerium/module-noble/v2/x/florin/types/blacklist";
option go_package = "github.com/monerium/module-noble/v2/types/blacklist";

service Msg {
option (cosmos.msg.v1.service) = true;
Expand Down
2 changes: 1 addition & 1 deletion proto/florin/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/monerium/module-noble/v2/x/florin/types";
option go_package = "github.com/monerium/module-noble/v2/types";

// Emitted when a denom is allowed.
message DenomAllowed {
Expand Down
2 changes: 1 addition & 1 deletion proto/florin/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "cosmos_proto/cosmos.proto";
import "florin/blacklist/v1/genesis.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/monerium/module-noble/v2/x/florin/types";
option go_package = "github.com/monerium/module-noble/v2/types";

message GenesisState {
// blacklist_state is the genesis state of the blacklist submodule.
Expand Down
2 changes: 1 addition & 1 deletion proto/florin/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "florin/v1/genesis.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

option go_package = "github.com/monerium/module-noble/v2/x/florin/types";
option go_package = "github.com/monerium/module-noble/v2/types";

service Query {
rpc Authority(QueryAuthority) returns (QueryAuthorityResponse) {
Expand Down
2 changes: 1 addition & 1 deletion proto/florin/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/monerium/module-noble/v2/x/florin/types";
option go_package = "github.com/monerium/module-noble/v2/types";

service Msg {
option (cosmos.msg.v1.service) = true;
Expand Down
4 changes: 2 additions & 2 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
_ "github.com/cosmos/cosmos-sdk/x/bank"
_ "github.com/cosmos/cosmos-sdk/x/consensus"
_ "github.com/cosmos/cosmos-sdk/x/staking"
_ "github.com/monerium/module-noble/v2/x/florin"
_ "github.com/monerium/module-noble/v2"

// Cosmos Modules
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
Expand All @@ -34,7 +34,7 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
// Custom Modules
florinkeeper "github.com/monerium/module-noble/v2/x/florin/keeper"
florinkeeper "github.com/monerium/module-noble/v2/keeper"
)

var DefaultNodeHome string
Expand Down
File renamed without changes.
File renamed without changes.

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

File renamed without changes.

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

File renamed without changes.
Loading

0 comments on commit 258836b

Please sign in to comment.