Skip to content

Commit

Permalink
Merge pull request #227 from faultytolly/subaccount-module-part-5
Browse files Browse the repository at this point in the history
Subaccount module part 5
  • Loading branch information
3eyedraga authored Aug 1, 2023
2 parents d876f42 + 1475771 commit dd62a60
Show file tree
Hide file tree
Showing 76 changed files with 2,486 additions and 233 deletions.
13 changes: 9 additions & 4 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type AppKeepers struct {
AuthzKeeper authzkeeper.Keeper
SubaccountKeeper subaccountkeeper.Keeper

//// SGE keepers \\\\
// // SGE keepers \\\\
BetKeeper *betmodulekeeper.Keeper
MarketKeeper *marketmodulekeeper.Keeper
MintKeeper mintkeeper.Keeper
Expand All @@ -113,7 +113,7 @@ type AppKeepers struct {
OVMKeeper *ovmmodulekeeper.Keeper
SubaccountModule subaccount.AppModule

//// SGE modules \\\\
// // SGE modules \\\\
BetModule betmodule.AppModule
MarketModule marketmodule.AppModule
HouseModule housemodule.AppModule
Expand Down Expand Up @@ -344,7 +344,7 @@ func NewAppKeeper(
appKeepers.SlashingKeeper,
)

//// SGE keepers \\\\
// // SGE keepers \\\\

appKeepers.OrderbookKeeper = orderbookmodulekeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -399,7 +399,7 @@ func NewAppKeeper(
)
appKeepers.OrderbookKeeper.SetHouseKeeper(appKeepers.HouseKeeper)

//// SGE modules \\\\
// // SGE modules \\\\

appKeepers.BetModule = betmodule.NewAppModule(
appCodec,
Expand Down Expand Up @@ -435,6 +435,11 @@ func NewAppKeeper(
appCodec,
appKeepers.keys[subaccounttypes.StoreKey],
appKeepers.GetSubspace(subaccounttypes.ModuleName),
appKeepers.BankKeeper,
appKeepers.OVMKeeper,
appKeepers.BetKeeper,
appKeepers.OrderbookKeeper,
appKeepers.HouseKeeper,
)
appKeepers.SubaccountModule = subaccount.NewAppModule(appKeepers.SubaccountKeeper)

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.18

require (
github.com/cosmos/cosmos-sdk v0.45.16
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v4 v4.4.2
github.com/gogo/protobuf v1.3.3
github.com/golang-jwt/jwt v3.2.2+incompatible
Expand All @@ -22,7 +23,6 @@ require (
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v2 v2.4.0
mvdan.cc/gofumpt v0.4.0
)
Expand Down Expand Up @@ -276,6 +276,7 @@ require (
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.3.3 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpF
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI=
github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek=
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY=
Expand Down
44 changes: 43 additions & 1 deletion proto/sge/subaccount/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";
package sgenetwork.sge.subaccount;

import "sge/subaccount/subaccount.proto";
import "sge/bet/tx.proto";
import "sge/house/tx.proto";

option go_package = "github.com/sge-network/sge/x/subaccount/types";

Expand All @@ -13,7 +15,17 @@ service Msg {
// TopUp defines a method for topping up a subaccount.
rpc TopUp(MsgTopUp) returns (MsgTopUpResponse);

// WithdrawUnlockedBalances defines a method for withdrawing unlocked balances.
rpc WithdrawUnlockedBalances(MsgWithdrawUnlockedBalances) returns (MsgWithdrawUnlockedBalancesResponse);

// PlaceBet defines a method for placing a bet using a subaccount.
rpc Wager(MsgWager) returns (MsgWagerResponse);

// HouseDeposit defines a method for depositing funds to provide liquidity to a market.
rpc HouseDeposit(MsgHouseDeposit) returns (MsgHouseDepositResponse);

// HouseWithdraw defines a method for withdrawing funds from a market.
rpc HouseWithdraw(MsgHouseWithdraw) returns (MsgHouseWithdrawResponse);
}

// MsgCreateSubAccount defines the Msg/CreateSubAccount request type.
Expand Down Expand Up @@ -53,4 +65,34 @@ message MsgWithdrawUnlockedBalances {
}

// MsgWithdrawUnlockedBalancesResponse defines the Msg/WithdrawUnlockedBalances response type.
message MsgWithdrawUnlockedBalancesResponse {}
message MsgWithdrawUnlockedBalancesResponse {}

// MsgPlaceBet wraps the MsgPlaceBet message. We need it in order not to have double interface registration conflicts.
message MsgWager {
sgenetwork.sge.bet.MsgWager msg = 1;
}

// MsgBetResponse wraps the MsgPlaceBetResponse message. We need it in order not to have double interface registration conflicts.
message MsgWagerResponse {
sgenetwork.sge.bet.MsgWagerResponse response = 1;
}

// MsgHouseDeposit wraps the MsgHouseDeposit message. We need it in order not to have double interface registration conflicts.
message MsgHouseDeposit {
sge.house.MsgDeposit msg = 1;
}

// MsgHouseDepositResponse wraps the MsgHouseDepositResponse message. We need it in order not to have double interface registration conflicts.
message MsgHouseDepositResponse {
sge.house.MsgDepositResponse response = 1;
}

// MsgHouseWithdraw wraps the MsgHouseWithdraw message. We need it in order not to have double interface registration conflicts.
message MsgHouseWithdraw {
sge.house.MsgWithdraw msg = 1;
}

// MsgHouseWithdrawResponse wraps the MsgHouseWithdrawResponse message. We need it in order not to have double interface registration conflicts.
message MsgHouseWithdrawResponse {
sge.house.MsgWithdrawResponse response = 1;
}
2 changes: 1 addition & 1 deletion types/kyc.pb.go

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

2 changes: 1 addition & 1 deletion x/bet/types/bet.pb.go

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

2 changes: 1 addition & 1 deletion x/bet/types/bet_odds.pb.go

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

2 changes: 1 addition & 1 deletion x/bet/types/constraints.pb.go

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

2 changes: 1 addition & 1 deletion x/bet/types/genesis.pb.go

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

2 changes: 1 addition & 1 deletion x/bet/types/params.pb.go

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

2 changes: 1 addition & 1 deletion x/bet/types/query.pb.go

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

14 changes: 7 additions & 7 deletions x/bet/types/query.pb.gw.go

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

2 changes: 1 addition & 1 deletion x/bet/types/ticket.pb.go

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

2 changes: 1 addition & 1 deletion x/bet/types/wager.pb.go

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

2 changes: 1 addition & 1 deletion x/house/types/authz.pb.go

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

2 changes: 1 addition & 1 deletion x/house/types/deposit.pb.go

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

2 changes: 1 addition & 1 deletion x/house/types/genesis.pb.go

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

2 changes: 1 addition & 1 deletion x/house/types/params.pb.go

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

2 changes: 1 addition & 1 deletion x/house/types/query.pb.go

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

10 changes: 5 additions & 5 deletions x/house/types/query.pb.gw.go

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

2 changes: 1 addition & 1 deletion x/house/types/ticket.pb.go

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

2 changes: 1 addition & 1 deletion x/house/types/tx.pb.go

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

2 changes: 1 addition & 1 deletion x/house/types/withdraw.pb.go

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

2 changes: 1 addition & 1 deletion x/market/types/genesis.pb.go

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

2 changes: 1 addition & 1 deletion x/market/types/market.pb.go

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

2 changes: 1 addition & 1 deletion x/market/types/odds.pb.go

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

2 changes: 1 addition & 1 deletion x/market/types/params.pb.go

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

2 changes: 1 addition & 1 deletion x/market/types/query.pb.go

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

Loading

0 comments on commit dd62a60

Please sign in to comment.