Skip to content

Commit

Permalink
Merge pull request #650 from UnUniFi/position-nft
Browse files Browse the repository at this point in the history
Position Ownership NFT
  • Loading branch information
kimurayu45z authored Aug 7, 2023
2 parents 6a06422 + 6a8ee37 commit 3807ec1
Show file tree
Hide file tree
Showing 31 changed files with 3,024 additions and 543 deletions.
75 changes: 39 additions & 36 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ var (
derivativestypes.ModuleName: {authtypes.Minter, authtypes.Burner},
derivativestypes.DerivativeFeeCollector: nil,
derivativestypes.MarginManager: nil,
derivativestypes.PendingPaymentManager: nil,

ecosystemincentivetypes.ModuleName: nil,
}
Expand Down Expand Up @@ -462,13 +463,13 @@ func NewApp(
buildertypes.StoreKey,

// original modules
derivativestypes.StoreKey,
pricefeedtypes.StoreKey,

nftbackedloantypes.StoreKey,
nftfactorytypes.StoreKey,
ecosystemincentivetypes.StoreKey,

derivativestypes.StoreKey,
pricefeedtypes.StoreKey,

yieldaggregatortypes.StoreKey,
stakeibctypes.StoreKey,
epochstypes.StoreKey,
Expand Down Expand Up @@ -750,24 +751,6 @@ func NewApp(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.PricefeedKeeper = pricefeedkeeper.NewKeeper(
appCodec,
keys[pricefeedtypes.StoreKey],
keys[pricefeedtypes.MemStoreKey],
app.GetSubspace(pricefeedtypes.ModuleName),
app.BankKeeper,
)

app.DerivativesKeeper = derivativeskeeper.NewKeeper(
appCodec,
keys[derivativestypes.StoreKey],
keys[derivativestypes.MemStoreKey],
app.GetSubspace(derivativestypes.ModuleName),
app.AccountKeeper,
app.BankKeeper,
app.PricefeedKeeper,
)

app.NftfactoryKeeper = nftfactorykeeper.NewKeeper(
appCodec,
keys[nftfactorytypes.StoreKey],
Expand Down Expand Up @@ -802,6 +785,26 @@ func NewApp(
// create Keeper objects which have Hooks
app.NftbackedloanKeeper = *nftbackedloanKeeper.SetHooks(nftbackedloantypes.NewMultiNftbackedloanHooks(app.EcosystemincentiveKeeper.Hooks()))

app.PricefeedKeeper = pricefeedkeeper.NewKeeper(
appCodec,
keys[pricefeedtypes.StoreKey],
keys[pricefeedtypes.MemStoreKey],
app.GetSubspace(pricefeedtypes.ModuleName),
app.BankKeeper,
)

app.DerivativesKeeper = derivativeskeeper.NewKeeper(
appCodec,
keys[derivativestypes.StoreKey],
keys[derivativestypes.MemStoreKey],
app.GetSubspace(derivativestypes.ModuleName),
app.AccountKeeper,
app.BankKeeper,
app.PricefeedKeeper,
app.UnUniFiNFTKeeper,
app.NftfactoryKeeper,
)

scopedIcacallbacksKeeper := app.CapabilityKeeper.ScopeToModule(icacallbackstypes.ModuleName)
app.ScopedIcacallbacksKeeper = scopedIcacallbacksKeeper
app.IcacallbacksKeeper = *icacallbackskeeper.NewKeeper(
Expand Down Expand Up @@ -1000,13 +1003,13 @@ func NewApp(
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)),

// original modules
pricefeed.NewAppModule(appCodec, app.PricefeedKeeper, app.AccountKeeper),
derivatives.NewAppModule(appCodec, app.DerivativesKeeper, app.BankKeeper),

nftfactory.NewAppModule(appCodec, app.NftfactoryKeeper, app.UnUniFiNFTKeeper),
nftbackedloan.NewAppModule(appCodec, app.NftbackedloanKeeper, app.AccountKeeper, app.BankKeeper),
ecosystemincentive.NewAppModule(appCodec, app.EcosystemincentiveKeeper, app.BankKeeper),

pricefeed.NewAppModule(appCodec, app.PricefeedKeeper, app.AccountKeeper),
derivatives.NewAppModule(appCodec, app.DerivativesKeeper, app.BankKeeper),

yieldaggregator.NewAppModule(appCodec, app.YieldaggregatorKeeper, app.AccountKeeper, app.BankKeeper),
stakeibc.NewAppModule(appCodec, app.StakeibcKeeper, app.AccountKeeper, app.BankKeeper),
epochs.NewAppModule(appCodec, app.EpochsKeeper),
Expand Down Expand Up @@ -1041,13 +1044,13 @@ func NewApp(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
// original modules
pricefeedtypes.ModuleName,
derivativestypes.ModuleName,

nftfactorytypes.ModuleName,
nftbackedloantypes.ModuleName,
ecosystemincentivetypes.ModuleName,

pricefeedtypes.ModuleName,
derivativestypes.ModuleName,

stakeibctypes.ModuleName,
epochstypes.ModuleName,
interchainquerytypes.ModuleName,
Expand Down Expand Up @@ -1085,13 +1088,13 @@ func NewApp(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
// original modules
pricefeedtypes.ModuleName,
derivativestypes.ModuleName,

nftfactorytypes.ModuleName,
nftbackedloantypes.ModuleName,
ecosystemincentivetypes.ModuleName,

pricefeedtypes.ModuleName,
derivativestypes.ModuleName,

stakeibctypes.ModuleName,
epochstypes.ModuleName,
interchainquerytypes.ModuleName,
Expand Down Expand Up @@ -1139,13 +1142,13 @@ func NewApp(
consensusparamtypes.ModuleName,

// original modules
pricefeedtypes.ModuleName,
derivativestypes.ModuleName,

nftfactorytypes.ModuleName,
nftbackedloantypes.ModuleName,
ecosystemincentivetypes.ModuleName,

pricefeedtypes.ModuleName,
derivativestypes.ModuleName,

stakeibctypes.ModuleName,
epochstypes.ModuleName,
interchainquerytypes.ModuleName,
Expand Down Expand Up @@ -1539,13 +1542,13 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(buildertypes.ModuleName)

// original modules
paramsKeeper.Subspace(pricefeedtypes.ModuleName)
paramsKeeper.Subspace(derivativestypes.ModuleName)

paramsKeeper.Subspace(nftfactorytypes.ModuleName)
paramsKeeper.Subspace(nftbackedloantypes.ModuleName)
paramsKeeper.Subspace(ecosystemincentivetypes.ModuleName)

paramsKeeper.Subspace(pricefeedtypes.ModuleName)
paramsKeeper.Subspace(derivativestypes.ModuleName)

paramsKeeper.Subspace(stakeibctypes.ModuleName)
paramsKeeper.Subspace(epochstypes.ModuleName)
paramsKeeper.Subspace(interchainquerytypes.ModuleName)
Expand Down
Loading

0 comments on commit 3807ec1

Please sign in to comment.