Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/build_docker.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ build: go.sum
ifeq ($(OS),Windows_NT)
go build -mod=readonly $(BUILD_FLAGS) -o build/bitsongd.exe ./cmd/bitsongd
else
go build $(BUILD_FLAGS) -o bin/bitsongd ./cmd/bitsongd
go build $(BUILD_FLAGS) -o build/bitsongd ./cmd/bitsongd
endif

install: go.sum
Expand Down
97 changes: 45 additions & 52 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package app
import (
"encoding/json"

"github.com/cosmos/cosmos-sdk/codec"

"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/codec"
)

// The genesis state of the blockchain is represented here as a map of raw json
Expand All @@ -18,7 +16,7 @@ import (
// object provided to it during init.
type GenesisState map[string]json.RawMessage

// NewDefaultGenesisState generates the default state for the application.
// NewDefaultGenesisState generates the default state for bitsong.
func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState {
return ModuleBasics.DefaultGenesis(cdc)
}
Expand All @@ -33,59 +31,54 @@ func NewDefaultGenesisStateWithCodec(cdc codec.JSONCodec) GenesisState {
InstantiateDefaultPermission: wasmtypes.AccessTypeEverybody,
},
}
gen[wasm.ModuleName] = cdc.MustMarshalJSON(&wasmGen)
return gen
}

/*func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState {
genesis := ModuleBasics.DefaultGenesis(cdc)
mintGenesis := mintGenesisState()
stakingGenesis := stakingGenesisState()
govGenesis := govGenesisState()
// other default genesis
// mintGenesis := mintGenesisState()
// stakingGenesis := stakingGenesisState()
// govGenesis := govGenesisState()

genesis["mint"] = cdc.MustMarshalJSON(mintGenesis)
genesis["staking"] = cdc.MustMarshalJSON(stakingGenesis)
genesis["gov"] = cdc.MustMarshalJSON(govGenesis)
gen[wasmtypes.ModuleName] = cdc.MustMarshalJSON(&wasmGen)
// gen["mint"] = cdc.MustMarshalJSON(mintGenesis)
// gen["staking"] = cdc.MustMarshalJSON(stakingGenesis)
// gen["gov"] = cdc.MustMarshalJSON(govGenesis)

return genesis
return gen
}

// stakingGenesisState returns the default genesis state for the staking module, replacing the
// bond denom from stake to ubtsg
func stakingGenesisState() *stakingtypes.GenesisState {
return &stakingtypes.GenesisState{
Params: stakingtypes.NewParams(
stakingtypes.DefaultUnbondingTime,
stakingtypes.DefaultMaxValidators,
stakingtypes.DefaultMaxEntries,
0,
types.BondDenom,
),
}
}
// func stakingGenesisState() *stakingtypes.GenesisState {
// return &stakingtypes.GenesisState{
// Params: stakingtypes.NewParams(
// stakingtypes.DefaultUnbondingTime,
// stakingtypes.DefaultMaxValidators,
// stakingtypes.DefaultMaxEntries,
// 0,
// "ubtsg", sdk.ZeroDec(),
// ),
// }
// }

func govGenesisState() *govtypes.GenesisState {
return govtypes.NewGenesisState(
1,
govtypes.NewDepositParams(
sdk.NewCoins(sdk.NewCoin(types.BondDenom, govtypes.DefaultMinDepositTokens)),
govtypes.DefaultPeriod,
),
govtypes.NewVotingParams(govtypes.DefaultPeriod),
govtypes.NewTallyParams(govtypes.DefaultQuorum, govtypes.DefaultThreshold, govtypes.DefaultVetoThreshold),
)
}
// func govGenesisState() *govtypes.GenesisState {
// return govtypes.NewGenesisState(
// 1,
// govtypes.NewDepositParams(
// sdk.NewCoins(sdk.NewCoin("ubtsg", govtypes.DefaultMinDepositTokens)),
// govtypes.DefaultPeriod,
// ),
// govtypes.NewVotingParams(govtypes.DefaultPeriod),
// govtypes.NewTallyParams(govtypes.DefaultQuorum, govtypes.DefaultThreshold, govtypes.DefaultVetoThreshold),
// )
// }

func mintGenesisState() *minttypes.GenesisState {
return &minttypes.GenesisState{
Params: minttypes.NewParams(
types.BondDenom,
sdk.NewDecWithPrec(13, 2),
sdk.NewDecWithPrec(20, 2),
sdk.NewDecWithPrec(7, 2),
sdk.NewDecWithPrec(67, 2),
uint64(60*60*8766/5), // assuming 5 second block times
),
}
}
*/
// func mintGenesisState() *minttypes.GenesisState {
// return &minttypes.GenesisState{
// Params: minttypes.NewParams(
// "ubtsg",
// sdk.NewDecWithPrec(13, 2),
// sdk.NewDecWithPrec(20, 2),
// sdk.NewDecWithPrec(7, 2),
// sdk.NewDecWithPrec(67, 2),
// uint64(60*60*8766/6), // assuming 6 second block times
// ),
// }
// }
4 changes: 2 additions & 2 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func appModules(
app.AppKeepers.AccountKeeper, app.AppKeepers.StakingKeeper, app.BaseApp.DeliverTx,
encodingConfig.TxConfig,
),
auth.NewAppModule(appCodec, app.AppKeepers.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
auth.NewAppModule(appCodec, app.AppKeepers.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)),
vesting.NewAppModule(app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper),
bank.NewAppModule(appCodec, app.AppKeepers.BankKeeper, app.AppKeepers.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
capability.NewAppModule(appCodec, *app.AppKeepers.CapabilityKeeper, false),
Expand Down Expand Up @@ -170,7 +170,7 @@ func simulationModules(
return []module.AppModuleSimulation{
auth.NewAppModule(appCodec, app.AppKeepers.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
bank.NewAppModule(appCodec, app.AppKeepers.BankKeeper, app.AppKeepers.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
// fantoken.NewAppModule(appCodec, app.FanTokenKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper),
// fantoken.NewAppModule(appCodec, app.FanTokenKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper), // todo: reimplement
capability.NewAppModule(appCodec, *app.AppKeepers.CapabilityKeeper, false),
feegrantmodule.NewAppModule(appCodec, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.AppKeepers.FeeGrantKeeper, app.interfaceRegistry),
authzmodule.NewAppModule(appCodec, app.AppKeepers.AuthzKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.interfaceRegistry),
Expand Down
11 changes: 6 additions & 5 deletions e2e/basic_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
"time"

sdkmath "cosmossdk.io/math"
// bitsongconformance "github.com/CosmosContracts/juno/tests/interchaintest/conformance"
bitsongconformance "github.com/bitsongofficial/go-bitsong/tests/e2e/conformance"
"github.com/bitsongofficial/go-bitsong/tests/e2e/helpers"

govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
cosmosproto "github.com/cosmos/gogoproto/proto"
Expand Down Expand Up @@ -87,7 +88,7 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, upgradeBranchVersion, upgra
chainUser := users[0]

// execute a contract before the upgrade
// beforeContract := bitsongconformance.StdExecute(t, ctx, chain, chainUser)
beforeContract := bitsongconformance.StdExecute(t, ctx, chain, chainUser)

// upgrade
height, err := chain.Height(ctx)
Expand All @@ -104,10 +105,10 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, upgradeBranchVersion, upgra
UpgradeNodes(t, ctx, chain, client, haltHeight, upgradeRepo, upgradeBranchVersion)

// confirm we can execute against the beforeContract (ref: v20 upgrade patch)
// helpers.ExecuteMsgWithFee(t, ctx, chain, chainUser, beforeContract, "", "10000"+chain.Config().Denom, `{"increment":{}}`)
helpers.ExecuteMsgWithFee(t, ctx, chain, chainUser, beforeContract, "", "10000"+chain.Config().Denom, `{"increment":{}}`)

// Post Upgrade: Conformance Validation
// bitsongconformance.ConformanceCosmWasm(t, ctx, chain, chainUser)
bitsongconformance.ConformanceCosmWasm(t, ctx, chain, chainUser)
// TODO: ibc conformance test
}

Expand Down Expand Up @@ -166,7 +167,7 @@ func ValidatorVoting(t *testing.T, ctx context.Context, chain *cosmos.CosmosChai
func SubmitUpgradeProposal(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, upgradeName string, haltHeight int64) string {
upgradeMsg := []cosmosproto.Message{
&upgradetypes.MsgSoftwareUpgrade{
// gGov Module account
// gov Module account
Authority: "juno10d07y265gmmuvt4z0w9aw880jnsr700jvss730",
Plan: upgradetypes.Plan{
Name: upgradeName,
Expand Down