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
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ jobs:
latest=auto
tags: |
type=semver,pattern={{version}},value=${{ needs.release-guard.outputs.RELEASE_VERSION }}
type=raw,value=production-latest
type=raw,value=production-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
type=raw,value=staging-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-') }}
type=sha,format=long
labels: |
org.opencontainers.image.vendor="Cheqd Foundation Limited"
Expand Down
6 changes: 6 additions & 0 deletions networks/mainnet/upgrades/upgrade-v4-minor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"binaries": {
"linux/amd64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-amd64.tar.gz?checksum=sha256:a1a967caba0cc9e06dc86378bdd7126e6fb91ee0080117f4c1b7acd1cd525842",
"linux/arm64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-arm64.tar.gz?checksum=sha256:88232d36ecb9216ee128121784c966efe69841e4e98368f201e6b5d07f93dd11"
}
}
6 changes: 6 additions & 0 deletions networks/testnet/upgrades/upgrade-v4-minor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"binaries": {
"linux/amd64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-amd64.tar.gz?checksum=sha256:a1a967caba0cc9e06dc86378bdd7126e6fb91ee0080117f4c1b7acd1cd525842",
"linux/arm64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-arm64.tar.gz?checksum=sha256:88232d36ecb9216ee128121784c966efe69841e4e98368f201e6b5d07f93dd11"
}
}
2 changes: 1 addition & 1 deletion tests/fee-abs/fee-abs-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ docker compose exec -d osmosis osmosisd start

info "Waiting for chains"
# TODO: Get rid of this
sleep 20
sleep 10

info "Checking statuses"
CHEQD_STATUS=$(docker compose exec cheqd cheqd-noded status 2>&1)
Expand Down
15 changes: 12 additions & 3 deletions tests/integration/cli_diddoc_pricing_negative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() {
var payload didcli.DIDDocument
var signInputs []didcli.SignInput

makeLowerFee := func(required sdk.Coin) sdk.Coin {
lower := required.Amount.Sub(sdkmath.NewInt(1_000_000_000)) // subtract 1 CHEQ
if lower.IsNegative() {
lower = sdkmath.ZeroInt()
}

return sdk.NewCoin(required.Denom, lower)
}

BeforeEach(func() {
tmpDir = GinkgoT().TempDir()

Expand Down Expand Up @@ -151,7 +160,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() {
feeInNCheq, err := cli.ResolveFeeFromParams(feeParams.CreateDid, useMin)
Expect(err).To(BeNil())

lowerTax := sdk.NewCoin(feeInNCheq.Denom, sdkmath.NewInt(feeInNCheq.Amount.Int64()-10000000000))
lowerTax := makeLowerFee(feeInNCheq)
res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, "", testdata.BASE_ACCOUNT_4, helpers.GenerateFees(lowerTax.String()))
Expect(err).To(BeNil())
Expect(res.Code).To(BeEquivalentTo(1))
Expand Down Expand Up @@ -185,7 +194,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() {
useMin = true
feeInNCheq, err = cli.ResolveFeeFromParams(feeParams.UpdateDid, useMin)
Expect(err).To(BeNil())
lowerTax := sdk.NewCoin(feeInNCheq.Denom, sdkmath.NewInt(feeInNCheq.Amount.Int64()-10000000000))
lowerTax := makeLowerFee(feeInNCheq)
res, err = cli.UpdateDidDoc(tmpDir, payload2, signInputs, "", testdata.BASE_ACCOUNT_5, helpers.GenerateFees(lowerTax.String()))
Expect(err).To(BeNil())
Expect(res.Code).To(BeEquivalentTo(1))
Expand All @@ -209,7 +218,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() {
useMin = true
feeInNCheq, err = cli.ResolveFeeFromParams(feeParams.DeactivateDid, useMin)
Expect(err).To(BeNil())
lowerTax := sdk.NewCoin(feeInNCheq.Denom, sdkmath.NewInt(feeInNCheq.Amount.Int64()-1000000000))
lowerTax := makeLowerFee(feeInNCheq)
res, err = cli.DeactivateDidDoc(tmpDir, payload2, signInputs, "", testdata.BASE_ACCOUNT_5, helpers.GenerateFees(lowerTax.String()))
Expect(err).To(BeNil())
Expect(res.Code).To(BeEquivalentTo(1))
Expand Down
9 changes: 6 additions & 3 deletions tests/integration/cli_resource_pricing_negative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() {
useMin := true
tax, err := cli.ResolveFeeFromParams(resourceFeeParams.Json, useMin)
Expect(err).To(BeNil())
lowerTax := sdk.NewCoin(tax.Denom, sdkmath.NewInt(tax.Amount.Int64()-1000000000))
lowerAmount := sdkmath.MaxInt(sdkmath.NewInt(1), sdkmath.NewInt(tax.Amount.Int64()-1000000000))
lowerTax := sdk.NewCoin(tax.Denom, lowerAmount)
res, err := cli.CreateResource(tmpDir, resourcetypes.MsgCreateResourcePayload{
CollectionId: collectionID,
Id: resourceID,
Expand All @@ -212,7 +213,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() {
useMin := true
tax, err := cli.ResolveFeeFromParams(resourceFeeParams.Image, useMin)
Expect(err).To(BeNil())
lowerTax := sdk.NewCoin(tax.Denom, sdkmath.NewInt(tax.Amount.Int64()-1000000000))
lowerAmount := sdkmath.MaxInt(sdkmath.NewInt(1), sdkmath.NewInt(tax.Amount.Int64()-1000000000))
lowerTax := sdk.NewCoin(tax.Denom, lowerAmount)

res, err := cli.CreateResource(tmpDir, resourcetypes.MsgCreateResourcePayload{
CollectionId: collectionID,
Expand All @@ -238,7 +240,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() {
useMin := true
tax, err := cli.ResolveFeeFromParams(resourceFeeParams.Default, useMin)
Expect(err).To(BeNil())
lowerTax := sdk.NewCoin(tax.Denom, sdkmath.NewInt(tax.Amount.Int64()-1000000000))
lowerAmount := sdkmath.MaxInt(sdkmath.NewInt(1), sdkmath.NewInt(tax.Amount.Int64()-1000000000))
lowerTax := sdk.NewCoin(tax.Denom, lowerAmount)
res, err := cli.CreateResource(tmpDir, resourcetypes.MsgCreateResourcePayload{
CollectionId: collectionID,
Id: resourceID,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/helpers/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type HumanReadableEvent struct {
}

func ReadableEvents(events []types.Event) []HumanReadableEvent {
readableEvents := make([]HumanReadableEvent, len(events))
readableEvents := make([]HumanReadableEvent, 0, len(events))
for _, event := range events {
readableAttributes := make([]HumanReadableEventAttribute, len(event.Attributes))
for i, attribute := range event.Attributes {
Expand Down
6 changes: 3 additions & 3 deletions tests/upgrade/integration/v4/param_change_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() {
Expect(err).To(BeNil())

By("waiting for the proposal to be included in a block")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*3)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand Down Expand Up @@ -81,7 +81,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() {
Expect(err).To(BeNil())

By("waiting for the proposal to pass")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand Down Expand Up @@ -129,7 +129,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() {
Expect(err).To(BeNil())

By("waiting for the proposal to be included in a block")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*2)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand Down
4 changes: 2 additions & 2 deletions tests/upgrade/integration/v4/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var _ = Describe("Upgrade - Post", func() {
Expect(err).To(BeNil())

By("waiting for 10 blocks to be produced on top, after the upgrade")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*6)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2)
Expect(err).To(BeNil())
})

Expand Down Expand Up @@ -87,7 +87,7 @@ var _ = Describe("Upgrade - Post", func() {
Expect(err).To(BeNil())

By("waiting for 10 blocks to be produced on top")
err = cli.WaitForChainHeight(cli.Validator2, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*8)
err = cli.WaitForChainHeight(cli.Validator2, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2)
Expect(err).To(BeNil())
})

Expand Down
16 changes: 8 additions & 8 deletions tests/upgrade/integration/v4/pre_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var _ = Describe("Upgrade - Pre", func() {
Context("Before a software upgrade execution is initiated", func() {
It("should wait for chain to bootstrap", func() {
By("pinging the node status until the voting end height is reached")
err := cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, cli.BootstrapHeight, cli.BootstrapPeriod+20)
err := cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, cli.BootstrapHeight, cli.BootstrapPeriod+5)
Expect(err).To(BeNil())
})

Expand Down Expand Up @@ -67,7 +67,7 @@ var _ = Describe("Upgrade - Pre", func() {
By("waiting for an additional set of blocks to be produced")
height, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CliBinaryName)
Expect(err).To(BeNil())
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*6)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*2)
Expect(err).To(BeNil())
}
})
Expand Down Expand Up @@ -107,7 +107,7 @@ var _ = Describe("Upgrade - Pre", func() {
By("waiting for an additional set of blocks to be produced")
height, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CliBinaryName)
Expect(err).To(BeNil())
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*6)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*2)
Expect(err).To(BeNil())
}
})
Expand Down Expand Up @@ -137,7 +137,7 @@ var _ = Describe("Upgrade - Pre", func() {
Expect(err).To(BeNil())

By("waiting for 10 blocks to be produced on top, after the upgrade")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*3)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand All @@ -154,7 +154,7 @@ var _ = Describe("Upgrade - Pre", func() {
Expect(err).To(BeNil())

By("waiting for the proposal to be included in a block")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*3)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand All @@ -171,7 +171,7 @@ var _ = Describe("Upgrade - Pre", func() {
Expect(err).To(BeNil())

By("waiting for 10 blocks to be produced on top, after the upgrade")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand All @@ -188,7 +188,7 @@ var _ = Describe("Upgrade - Pre", func() {
Expect(err).To(BeNil())

By("waiting for 10 blocks to be produced on top, after the upgrade")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand All @@ -205,7 +205,7 @@ var _ = Describe("Upgrade - Pre", func() {
Expect(err).To(BeNil())

By("waiting for 10 blocks to be produced on top, after the upgrade")
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2)
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1)
Expect(err).To(BeNil())
})

Expand Down
Loading