Skip to content

Commit

Permalink
feat: prepare v6.0.0 (noble-assets#397)
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Graziotti <[email protected]>
  • Loading branch information
johnletey and g-luca authored Aug 27, 2024
1 parent 7e5f3fb commit 4ffb44b
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 24 deletions.
11 changes: 11 additions & 0 deletions .changelog/v6.0.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*Aug 27, 2024*

This is the Xenon major release of Noble. It introduces a new `x/halo` module
that enables the native issuance of [Hashnote's US Yield Coin (**USYC**)][usyc]
asset. USYC is an on-chain representation of Hashnote's Short Duration Yield
Fund, primarily investing in U.S. Treasury Bills and engaging in reverse repo
activities.

Other notable changes are documented below.

[usyc]: https://usyc.hashnote.com
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# CHANGELOG

## v6.0.0

*Aug 27, 2024*

This is the Xenon major release of Noble. It introduces a new `x/halo` module
that enables the native issuance of [Hashnote's US Yield Coin (**USYC**)][usyc]
asset. USYC is an on-chain representation of Hashnote's Short Duration Yield
Fund, primarily investing in U.S. Treasury Bills and engaging in reverse repo
activities.

Other notable changes are documented below.

[usyc]: https://usyc.hashnote.com

### IMPROVEMENTS

- Update module path for v6 release line. ([#389](https://github.com/noble-assets/noble/pull/389))

## v5.0.0

*Jul 5, 2024*
Expand Down
5 changes: 4 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ func New(
"uusdc",
app.AccountKeeper,
nil,
nil,
interfaceRegistry,
)

app.BankKeeper = bankkeeper.NewBaseKeeper(
Expand Down Expand Up @@ -506,6 +508,7 @@ func New(

app.BankKeeper,
)
app.HaloKeeper.SetFTFKeeper(app.FiatTokenFactoryKeeper)
fiattokenfactorymodule := fiattokenfactorymodule.NewAppModule(appCodec, app.FiatTokenFactoryKeeper, app.AccountKeeper, app.BankKeeper)

app.CCTPKeeper = cctpkeeper.NewKeeper(
Expand Down Expand Up @@ -665,6 +668,7 @@ func New(
distrtypes.ModuleName,
slashingtypes.ModuleName,
crisistypes.ModuleName,
fiattokenfactorymoduletypes.ModuleName,
genutiltypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
Expand All @@ -676,7 +680,6 @@ func New(
upgradetypes.ModuleName,
vestingtypes.ModuleName,
tokenfactorymoduletypes.ModuleName,
fiattokenfactorymoduletypes.ModuleName,
globalfee.ModuleName,
cctptypes.ModuleName,
forwardingtypes.ModuleName,
Expand Down
Empty file removed app/upgrades/.gitkeep
Empty file.
6 changes: 3 additions & 3 deletions app/upgrades/xenon/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func CreateUpgradeHandler(
haloKeeper.SetAggregatorOwner(ctx, "noble1u0nahk4wltsp89tpce4cyayd63a69dhpkfq9wq")
haloKeeper.SetEntitlementsOwner(ctx, "noble1u0nahk4wltsp89tpce4cyayd63a69dhpkfq9wq")
case MainnetChainID:
haloKeeper.SetOwner(ctx, "") // TODO
haloKeeper.SetAggregatorOwner(ctx, "") // TODO
haloKeeper.SetEntitlementsOwner(ctx, "") // TODO
haloKeeper.SetOwner(ctx, "noble184afdqq8x575e4m4khm0e52p4duxe6lxaxju3f")
haloKeeper.SetAggregatorOwner(ctx, "noble184afdqq8x575e4m4khm0e52p4duxe6lxaxju3f")
haloKeeper.SetEntitlementsOwner(ctx, "noble184afdqq8x575e4m4khm0e52p4duxe6lxaxju3f")
default:
return vm, fmt.Errorf("%s upgrade not allowed to execute on %s chain", UpgradeName, ctx.ChainID())
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/noble-assets/forwarding v1.1.0
github.com/noble-assets/halo v1.0.0-alpha.0
github.com/noble-assets/halo v1.0.0
github.com/ondoprotocol/usdy-noble v1.0.0
github.com/rs/zerolog v1.27.0
github.com/spf13/cast v1.5.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,8 @@ github.com/noble-assets/cosmos-sdk v0.45.16-send-restrictions h1:oQwbCoejkXp2/oz
github.com/noble-assets/cosmos-sdk v0.45.16-send-restrictions/go.mod h1:bScuNwWAP0TZJpUf+SHXRU3xGoUPp+X9nAzfeIXts40=
github.com/noble-assets/forwarding v1.1.0 h1:2TXBs2Y9vWqgHyDKtdcHht6i7OT+pLaVHE3bPvfpmJY=
github.com/noble-assets/forwarding v1.1.0/go.mod h1:o64ZfzCHteRDhOlkpi7GeKAcjlcbWUihC7Y34Er2/3U=
github.com/noble-assets/halo v1.0.0-alpha.0 h1:i5HBbMVi+GQul/aMxRtfFMfn6B4LKbYj10BFIZ0C3u8=
github.com/noble-assets/halo v1.0.0-alpha.0/go.mod h1:zWcppKjRH5v0ZTRXPtxEhoO1XRFE7wi5GhxtnGeFy6I=
github.com/noble-assets/halo v1.0.0 h1:JG5TAZZcuLArYgl/9dgwJJ9KAOIo2f03/S010WRVNV8=
github.com/noble-assets/halo v1.0.0/go.mod h1:AUFdixNgPdce0soYfT6aNggwW9PUVFxaIkCC83M26Sk=
github.com/nunnatsa/ginkgolinter v0.14.0 h1:XQPNmw+kZz5cC/HbFK3mQutpjzAQv1dHregRA+4CGGg=
github.com/nunnatsa/ginkgolinter v0.14.0/go.mod h1:cm2xaqCUCRd7qcP4DqbVvpcyEMkuLM9CF0wY6VASohk=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
Expand Down
40 changes: 31 additions & 9 deletions testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package network

import (
"fmt"
fiattokenfactorytypes "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"testing"
"time"

Expand All @@ -14,15 +16,11 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/staking"
tmrand "github.com/tendermint/tendermint/libs/rand"
tmdb "github.com/tendermint/tm-db"

cctptypes "github.com/circlefin/noble-cctp/x/cctp/types"
genutil "github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/noble-assets/noble/v6/app"
"github.com/noble-assets/noble/v6/cmd"
Expand Down Expand Up @@ -56,11 +54,35 @@ func New(t *testing.T, configs ...network.Config) *network.Network {
// DefaultConfig will initialize config for the network with custom application,
// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig
func DefaultConfig() network.Config {
// app doesn't have this modules anymore, but we need them for test setup, which uses gentx and MsgCreateValidator
app.ModuleBasics[genutiltypes.ModuleName] = genutil.AppModuleBasic{}
app.ModuleBasics[stakingtypes.ModuleName] = staking.AppModuleBasic{}

encoding := cmd.MakeEncodingConfig(app.ModuleBasics)

genesisState := app.ModuleBasics.DefaultGenesis(encoding.Marshaler)
bankGenesisState := banktypes.DefaultGenesisState()
bankGenesisState.DenomMetadata = []banktypes.Metadata{
{
Description: "Circle USD Coin",
DenomUnits: []*banktypes.DenomUnit{
{
Denom: "uusdc",
Exponent: 0,
Aliases: []string{"microusdc"},
},
{
Denom: "usdc",
Exponent: 6,
},
},
Base: "uusdc",
Display: "usdc",
Name: "Circle USD Coin",
Symbol: "USDC",
},
}
genesisState[banktypes.ModuleName] = encoding.Marshaler.MustMarshalJSON(bankGenesisState)
ftfGenesisState := fiattokenfactorytypes.DefaultGenesis()
ftfGenesisState.MintingDenom = &fiattokenfactorytypes.MintingDenom{Denom: "uusdc"}
genesisState[fiattokenfactorytypes.ModuleName] = encoding.Marshaler.MustMarshalJSON(ftfGenesisState)

cfg := network.Config{
Codec: encoding.Marshaler,
TxConfig: encoding.TxConfig,
Expand All @@ -76,7 +98,7 @@ func DefaultConfig() network.Config {
baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
)
},
GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler),
GenesisState: genesisState,
TimeoutCommit: 2 * time.Second,
ChainID: "chain-" + tmrand.NewRand().Str(6),
// Some changes are introduced to make the tests run as if Noble is a standalone chain.
Expand Down
14 changes: 6 additions & 8 deletions x/tokenfactory/client/cli/query_minting_denom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ func networkWithMintingDenomObjects(t *testing.T) (*network.Network, types.Minti
Denom: testDenom,
}

bankState := banktypes.DefaultGenesisState()
bankState.DenomMetadata = []banktypes.Metadata{{
var bankState banktypes.GenesisState
cfg.Codec.MustUnmarshalJSON(cfg.GenesisState[banktypes.ModuleName], &bankState)
bankState.DenomMetadata = append(bankState.DenomMetadata, banktypes.Metadata{
Base: testDenom,
}}
})
cfg.GenesisState[banktypes.ModuleName] = cfg.Codec.MustMarshalJSON(&bankState)

buf, err := cfg.Codec.MarshalJSON(bankState)
require.NoError(t, err)
cfg.GenesisState[banktypes.ModuleName] = buf

buf, err = cfg.Codec.MarshalJSON(&state)
buf, err := cfg.Codec.MarshalJSON(&state)
require.NoError(t, err)
cfg.GenesisState[types.ModuleName] = buf

Expand Down

0 comments on commit 4ffb44b

Please sign in to comment.