-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/upload-new-audio-icon-#1395
- Loading branch information
Showing
406 changed files
with
778,661 additions
and
2,099 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"BVS","identity":"2DBB6C30FD1D52C4","website":"","security_contact":"","details":""},"commission":{"rate":"0.070000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.050000000000000000"},"min_self_delegation":"1","delegator_address":"pylo10fp57zm469ljpzyzmkurr9439x37rfnffdjura","validator_address":"pylovaloper10fp57zm469ljpzyzmkurr9439x37rfnfv9ltc3","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Awf0LrmZRvM7ShEsCovBhrkWB6xC69gCn6N4JJhvEFc="},"value":{"denom":"ubedrock","amount":"200000000"}}],"memo":"1233d3696f3fbfb44edfaf72640bb91d085f3dae@65.109.34.133:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ah/UChdmGTKEmmlWRT0lo3/UIvqB2knDVadZUO86B5Wu"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["suWOiBAKJLJPpNq9/FYUnXVgh4npNRgKnIPremeVBS4ulBkNuj+XppSzKxSlB+noBLznb9S4zC2T0YhMLTuHbw=="]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package v1 | ||
|
||
import ( | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
|
||
"github.com/Pylons-tech/pylons/app/upgrades" | ||
) | ||
|
||
const ( | ||
// UpgradeName is the shared upgrade plan name for mainnet and testnet | ||
UpgradeName = "v1.1.2" | ||
) | ||
|
||
// TODO: Update StoreUpgrades | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
StoreUpgrades: storetypes.StoreUpgrades{ | ||
Added: []string{}, | ||
Deleted: []string{}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package v1 | ||
|
||
import ( | ||
"cosmossdk.io/math" | ||
"github.com/Pylons-tech/pylons/x/pylons/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" | ||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" | ||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
) | ||
|
||
const ( | ||
// mainnet master wallet address | ||
MasterWallet = "pylo1vnwhaymaazugzz9ln2sznddveyed6shz3x8xwl" | ||
MaxSupply = 100_000_000_000_000 | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
bankKeeper bankkeeper.Keeper, | ||
accKeeper *authkeeper.AccountKeeper, | ||
staking *stakingkeeper.Keeper, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
// logger := ctx.Logger() | ||
|
||
bankBaseKeeper, _ := bankKeeper.(bankkeeper.BaseKeeper) | ||
if types.IsMainnet(ctx.ChainID()) { | ||
BurnToken(ctx, accKeeper, &bankBaseKeeper, staking) | ||
} | ||
|
||
vm, err := mm.RunMigrations(ctx, configurator, fromVM) | ||
return vm, err | ||
} | ||
} | ||
|
||
// Burn bedrock denom token | ||
func BurnToken(ctx sdk.Context, accKeeper *authkeeper.AccountKeeper, bank *bankkeeper.BaseKeeper, staking *stakingkeeper.Keeper) { | ||
// only burn bedrock token | ||
denom := types.StakingCoinDenom | ||
// Get all delegations | ||
delegations := staking.GetAllDelegations(ctx) | ||
// Get all account balances | ||
accs := bank.GetAccountsBalances(ctx) | ||
for _, acc := range accs { | ||
found := false | ||
balance := acc.Coins.AmountOf(denom) | ||
// Check if denom token amount GT 0 | ||
if balance.GT(math.ZeroInt()) { | ||
for _, delegator := range delegations { | ||
// Check if account address is equal to delegator address, if equal do nothing | ||
if acc.Address == delegator.DelegatorAddress || acc.Address == MasterWallet { | ||
found = true | ||
break | ||
} else { | ||
// If account address address is not equal to delegator address burn token | ||
found = false | ||
} | ||
} | ||
if !found { | ||
amount := sdk.NewCoin(denom, balance) | ||
BurnCoins(ctx, bank, acc.Address, amount) | ||
} | ||
} | ||
} | ||
|
||
supply := bank.GetSupply(ctx, denom) | ||
maxSupply := math.NewInt(MaxSupply) | ||
if supply.Amount.GT(maxSupply) { | ||
|
||
extraSupply := supply.Amount.Sub(maxSupply) | ||
extraCoins := sdk.NewCoin(denom, extraSupply) | ||
BurnCoins(ctx, bank, MasterWallet, extraCoins) | ||
|
||
} | ||
} | ||
|
||
func BurnCoins(ctx sdk.Context, bank *bankkeeper.BaseKeeper, acc string, amount sdk.Coin) { | ||
// Send denom token to module | ||
err := bank.SendCoinsFromAccountToModule(ctx, sdk.MustAccAddressFromBech32(acc), types.PaymentsProcessorName, sdk.NewCoins(amount)) | ||
if err != nil { | ||
panic(err) | ||
} | ||
// Burn denom token in module | ||
err = bank.BurnCoins(ctx, types.PaymentsProcessorName, sdk.NewCoins(amount)) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package v1_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"cosmossdk.io/math" | ||
"github.com/Pylons-tech/pylons/app/apptesting" | ||
v1 "github.com/Pylons-tech/pylons/app/upgrades/mainnet/v1" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" | ||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
var ( | ||
stakingCoinDenom string = "ubedrock" | ||
defaultAcctFundsBedrockCoin sdk.Coins = sdk.NewCoins( | ||
sdk.NewCoin(stakingCoinDenom, sdk.NewInt(10_000_000)), | ||
) | ||
) | ||
|
||
type UpgradeTestSuite struct { | ||
apptesting.KeeperTestHelper | ||
} | ||
|
||
func TestUpgradeTestSuite(t *testing.T) { | ||
s := new(UpgradeTestSuite) | ||
suite.Run(t, s) | ||
} | ||
|
||
func (suite *UpgradeTestSuite) TestBurnToken_Ubedrock() { | ||
suite.Setup() | ||
// Fund ubedrock to test account | ||
for _, acc := range suite.TestAccs { | ||
suite.FundAcc(acc, defaultAcctFundsBedrockCoin) | ||
} | ||
// Get ubedrock total supply | ||
totalAmount := suite.App.BankKeeper.GetSupply(suite.Ctx, stakingCoinDenom) | ||
suite.Require().Equal(totalAmount.Amount, math.NewInt(31_000_000)) | ||
// Burn ubedrock | ||
bankBaseKeeper, _ := suite.App.BankKeeper.(bankkeeper.BaseKeeper) | ||
v1.BurnToken(suite.Ctx, &suite.App.AccountKeeper, &bankBaseKeeper, &suite.App.StakingKeeper) | ||
// Check ubedrock total supply (should equal 0) | ||
totalAmount = suite.App.BankKeeper.GetSupply(suite.Ctx, stakingCoinDenom) | ||
suite.Require().Equal(totalAmount.Amount, math.ZeroInt()) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package v6 | ||
|
||
import ( | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
|
||
"github.com/Pylons-tech/pylons/app/upgrades" | ||
) | ||
|
||
const ( | ||
// UpgradeName is the shared upgrade plan name for mainnet and testnet | ||
UpgradeName = "v1.1.1" | ||
) | ||
|
||
// TODO: Update StoreUpgrades | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
StoreUpgrades: storetypes.StoreUpgrades{ | ||
Added: []string{}, | ||
Deleted: []string{}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package v6 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" | ||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" | ||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
bankKeeper bankkeeper.Keeper, | ||
accKeeper *authkeeper.AccountKeeper, | ||
staking *stakingkeeper.Keeper, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
return mm.RunMigrations(ctx, configurator, fromVM) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
package-lock.json | ||
/.pnp | ||
.pnp.js | ||
/.next | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
*.env | ||
.env* | ||
.env | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { requestUrl } from '@hooks' | ||
import { AxiosResponse } from 'axios' | ||
|
||
export const getRecipeHistory = async ( | ||
cookbookId: string, | ||
recipeId: string | ||
): Promise<AxiosResponse<unknown, any>> => { | ||
return await requestUrl?.get( | ||
`/pylons/get_recipe_history/${cookbookId}/${recipeId}` | ||
) | ||
} | ||
|
||
export const getRecipeDetails = async ( | ||
cookbookId: string, | ||
recipeId: string | ||
): Promise<AxiosResponse<unknown, any>> => { | ||
return await requestUrl?.get(`/pylons/recipe/${cookbookId}/${recipeId}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './easelBuy' |
Oops, something went wrong.