Skip to content

feat: WIP - upgrade resource and did modules to v0.50.x #876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 44 commits into
base: akhil/v0.50_bump
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
cea4c59
wip: upgrade resource module
PrathyushaLakkireddy Apr 11, 2025
024ce02
fix typo
PrathyushaLakkireddy Apr 11, 2025
9b5f316
fix conflicts
PrathyushaLakkireddy Apr 11, 2025
cbdebd0
fix
PrathyushaLakkireddy Apr 11, 2025
861bd93
update test setup
PrathyushaLakkireddy Apr 14, 2025
234c521
change types
PrathyushaLakkireddy Apr 14, 2025
62ba2b8
wip
PrathyushaLakkireddy Apr 14, 2025
234ca98
Merge branch 'akhil/v0.50_bump' of https://github.com/cheqd/cheqd-nod…
PrathyushaLakkireddy Apr 15, 2025
275e312
add migrations
PrathyushaLakkireddy Apr 15, 2025
fac391a
remove validate basic
PrathyushaLakkireddy Apr 15, 2025
928eede
Merge branch 'akhil/v0.50_bump' of https://github.com/cheqd/cheqd-nod…
PrathyushaLakkireddy Apr 15, 2025
1131204
fix
PrathyushaLakkireddy Apr 15, 2025
f6419bd
fix test setup
PrathyushaLakkireddy Apr 15, 2025
b17ffc2
fix
PrathyushaLakkireddy Apr 16, 2025
3078a04
feat!: upgrade did module to v0.50.x (#878)
vishal-kanna Apr 16, 2025
93e1006
Merge branch 'akhil/v0.50_bump' of https://github.com/cheqd/cheqd-nod…
PrathyushaLakkireddy Apr 16, 2025
786f1da
fix
PrathyushaLakkireddy Apr 16, 2025
aa5b6c3
setconfig
PrathyushaLakkireddy Apr 16, 2025
af480c6
Merge branch 'akhil/v0.50_bump' of https://github.com/cheqd/cheqd-nod…
PrathyushaLakkireddy Apr 16, 2025
b056fea
fix proto annotations
PrathyushaLakkireddy Apr 16, 2025
8b9d904
feat: change functions
vishal-kanna Apr 16, 2025
2c2d397
chore: fix param_change_proposal tests
vishal-kanna Apr 17, 2025
8921323
chore: remove comment
vishal-kanna Apr 17, 2025
7ca2db6
fix keeper tests
PrathyushaLakkireddy Apr 17, 2025
ed8e48e
Merge branch 'prathyusha/upgrade_resource' of https://github.com/cheq…
PrathyushaLakkireddy Apr 17, 2025
5b0d7d9
feat: implement customgetsigner
vishal-kanna Apr 17, 2025
88f3f00
wip
PrathyushaLakkireddy Apr 21, 2025
6f20be5
Merge branch 'prathyusha/upgrade_resource' of https://github.com/cheq…
PrathyushaLakkireddy Apr 21, 2025
d245bc5
chore: added query params func and updated the params key
vishal-kanna Apr 21, 2025
3ec6872
add custom signers
PrathyushaLakkireddy Apr 21, 2025
2a340b8
fix key
PrathyushaLakkireddy Apr 21, 2025
d27f888
fix
PrathyushaLakkireddy Apr 21, 2025
6d5a948
chore: add params to autocli
vishal-kanna Apr 21, 2025
6cd6360
add params
PrathyushaLakkireddy Apr 21, 2025
116dc9f
Merge branch 'prathyusha/upgrade_resource' of https://github.com/cheq…
PrathyushaLakkireddy Apr 21, 2025
e0bf7f0
fix autocli
PrathyushaLakkireddy Apr 21, 2025
a16219f
fix typo
PrathyushaLakkireddy Apr 21, 2025
cf873ab
fix
PrathyushaLakkireddy Apr 21, 2025
1b109cf
fix
PrathyushaLakkireddy Apr 23, 2025
1962451
Merge branch 'akhil/v0.50_bump' into prathyusha/upgrade_resource
akhilkumarpilli Apr 23, 2025
10e0a51
Merge branch 'akhil/v0.50_bump' into prathyusha/upgrade_resource
akhilkumarpilli Apr 23, 2025
d0975f7
fix lint and errors
akhilkumarpilli Apr 23, 2025
0c18c7e
update golangci lint version in gha
akhilkumarpilli Apr 23, 2025
ab7f2e7
fix tests setup
akhilkumarpilli Apr 24, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.60.3
args: --config .github/linters/.golangci.yaml

proto-lint:
Expand Down
4 changes: 2 additions & 2 deletions ante/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
)

type DidKeeper interface {
GetParams(ctx sdk.Context) (params didtypes.FeeParams)
GetParams(ctx context.Context) (didtypes.FeeParams, error)
}

type ResourceKeeper interface {
GetParams(ctx sdk.Context) (params resourcetypes.FeeParams)
GetParams(ctx context.Context) (params resourcetypes.FeeParams, err error)
}
type AccountKeeper interface {
GetParams(ctx context.Context) (params authtypes.Params)
Expand Down
14 changes: 9 additions & 5 deletions ante/fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ var _ = Describe("Fee tests on DeliverTx", func() {
Expect(err).To(BeNil(), "Tx errored when fee payer had sufficient funds and provided sufficient fee while subtracting tax on deliverTx")

// get fee params
feeParams := s.app.DidKeeper.GetParams(s.ctx)
feeParams, err := s.app.DidKeeper.GetParams(s.ctx)
Expect(err).To(BeNil())

// check balance of fee payer
balance := s.app.BankKeeper.GetBalance(s.ctx, addr1, didtypes.BaseMinimalDenom)
Expand Down Expand Up @@ -378,7 +379,8 @@ var _ = Describe("Fee tests on DeliverTx", func() {
Expect(err).To(BeNil(), "Tx errored when fee payer had sufficient funds and provided sufficient fee while subtracting tax on deliverTx")

// get fee params
feeParams := s.app.ResourceKeeper.GetParams(s.ctx)
feeParams, err := s.app.ResourceKeeper.GetParams(s.ctx)
Expect(err).To(BeNil())

// check balance of fee payer
balance := s.app.BankKeeper.GetBalance(s.ctx, addr1, didtypes.BaseMinimalDenom)
Expand Down Expand Up @@ -1311,7 +1313,7 @@ var _ = Describe("Fee abstraction along with fee market", func() {
Status: types.HostChainFeeAbsStatus_UPDATED,
}

var feeabsModAcc authtypes.ModuleAccountI
var feeabsModAcc sdk.ModuleAccountI

var decorators []sdk.AnteDecorator
BeforeEach(func() {
Expand Down Expand Up @@ -1456,7 +1458,8 @@ var _ = Describe("Fee abstraction along with fee market", func() {
Expect(err).To(BeNil(), "Tx errored when fee payer had sufficient funds and provided sufficient fee while subtracting tax on deliverTx")

// get fee params
feeParams := s.app.DidKeeper.GetParams(s.ctx)
feeParams, err := s.app.DidKeeper.GetParams(s.ctx)
Expect(err).To(BeNil())

// check balance of fee payer
balance := s.app.BankKeeper.GetBalance(s.ctx, addr1, didtypes.BaseMinimalDenom)
Expand Down Expand Up @@ -1588,7 +1591,8 @@ var _ = Describe("Fee abstraction along with fee market", func() {
Expect(err).To(BeNil(), "Tx errored when fee payer had sufficient funds and provided sufficient fee while subtracting tax on deliverTx")

// get fee params
feeParams := s.app.DidKeeper.GetParams(s.ctx)
feeParams, err := s.app.DidKeeper.GetParams(s.ctx)
Expect(err).To(BeNil())

// check balance of fee payer
balance := s.app.BankKeeper.GetBalance(s.ctx, addr1, didtypes.BaseMinimalDenom)
Expand Down
17 changes: 10 additions & 7 deletions ante/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var (

// TestAccount represents an account used in the tests in x/auth/ante.
type TestAccount struct {
acc authtypes.AccountI
acc sdk.AccountI
priv cryptotypes.PrivKey
}

Expand Down Expand Up @@ -90,9 +90,12 @@ func createTestApp(isCheckTx bool) (*cheqdapp.TestApp, sdk.Context, error) {

// cheqd specific params
didFeeParams := didtypes.DefaultGenesis().FeeParams
app.DidKeeper.SetParams(ctx, *didFeeParams)
err = app.DidKeeper.SetParams(ctx, *didFeeParams)
if err != nil {
return nil, sdk.Context{}, err
}
resourceFeeParams := resourcetypes.DefaultGenesis().FeeParams
app.ResourceKeeper.SetParams(ctx, *resourceFeeParams)
_ = app.ResourceKeeper.SetParams(ctx, *resourceFeeParams)
err = app.FeeMarketKeeper.SetParams(ctx, types.NewParams(DefaultWindow, DefaultAlpha, DefaultBeta, DefaultGamma, DefaultDelta,
DefaultMaxBlockUtilization, DefaultMinBaseGasPrice, DefaultMinLearningRate, DefaultMaxLearningRate, DefaultFeeDenom, true,
))
Expand Down Expand Up @@ -217,13 +220,13 @@ func (s *AnteTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint
}

// SetDidFeeParams is a helper function to set did fee params.
func (s *AnteTestSuite) SetDidFeeParams(feeParams didtypes.FeeParams) {
s.app.DidKeeper.SetParams(s.ctx, feeParams)
func (s *AnteTestSuite) SetDidFeeParams(feeParams didtypes.FeeParams) error {
return s.app.DidKeeper.SetParams(s.ctx, feeParams)
}

// SetResourceFeeParams is a helper function to set resource fee params.
func (s *AnteTestSuite) SetResourceFeeParams(feeParams resourcetypes.FeeParams) {
s.app.ResourceKeeper.SetParams(s.ctx, feeParams)
func (s *AnteTestSuite) SetResourceFeeParams(feeParams resourcetypes.FeeParams) error {
return s.app.ResourceKeeper.SetParams(s.ctx, feeParams)
}

func (s *AnteTestSuite) SetFeeMarketFeeDenom() error {
Expand Down
10 changes: 8 additions & 2 deletions ante/tx_msg_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,18 @@ func GetResourceTaxableMsgFee(ctx sdk.Context, msg *resourcetypes.MsgCreateResou
}

func checkFeeParamsFromSubspace(ctx sdk.Context, didKeeper DidKeeper, resourceKeeper ResourceKeeper) bool {
didParams := didKeeper.GetParams(ctx)
didParams, err := didKeeper.GetParams(ctx)
if err != nil {
return false
}
TaxableMsgFees[MsgCreateDidDoc] = sdk.NewCoins(didParams.CreateDid)
TaxableMsgFees[MsgUpdateDidDoc] = sdk.NewCoins(didParams.UpdateDid)
TaxableMsgFees[MsgDeactivateDidDoc] = sdk.NewCoins(didParams.DeactivateDid)

resourceParams := resourceKeeper.GetParams(ctx)
resourceParams, err := resourceKeeper.GetParams(ctx)
if err != nil {
return false
}
TaxableMsgFees[MsgCreateResourceImage] = sdk.NewCoins(resourceParams.Image)
TaxableMsgFees[MsgCreateResourceJSON] = sdk.NewCoins(resourceParams.Json)
TaxableMsgFees[MsgCreateResourceDefault] = sdk.NewCoins(resourceParams.Default)
Expand Down
2 changes: 1 addition & 1 deletion ante/tx_msg_filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

var _ = Describe("TxMsgFilters", func() {
var rounds int = 1_000_000
rounds := 1_000_000

BeforeEach(func() {
ante.TaxableMsgFees = ante.TaxableMsgFee{
Expand Down
74 changes: 38 additions & 36 deletions api/cheqd/did/v2/fee.pulsar.go

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

Loading
Loading