Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
atheeshp committed Feb 22, 2024
1 parent 1467cbb commit 2cb71bc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
1 change: 0 additions & 1 deletion tests/integration/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func QueryTxn(hash string) (sdk.TxResponse, error) {

var resp sdk.TxResponse
err = helpers.Codec.UnmarshalJSON([]byte(res), &resp)

if err != nil {
return sdk.TxResponse{}, err
}
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/cli_diddoc_negative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ var _ = Describe("cheqd cli - negative did", func() {

// c. missing payload, account
_, err = cli.CreateDidDoc(tmpDir, didcli.DIDDocument{}, signInputs2, "", "", helpers.GenerateFees(feeParams.CreateDid.String()))
Expect(err).ToNot(BeNil())

// d. missing sign inputs, account
_, err = cli.CreateDidDoc(tmpDir, payload2, []didcli.SignInput{}, "", "", helpers.GenerateFees(feeParams.CreateDid.String()))
Expect(err).ToNot(BeNil())

// e. missing payload
_, err = cli.CreateDidDoc(tmpDir, didcli.DIDDocument{}, signInputs2, "", testdata.BASE_ACCOUNT_2, helpers.GenerateFees(feeParams.CreateDid.String()))
Expand Down Expand Up @@ -145,6 +147,7 @@ var _ = Describe("cheqd cli - negative did", func() {
PrivKey: privKey,
},
}, "", testdata.BASE_ACCOUNT_2, helpers.GenerateFees(feeParams.CreateDid.String()))
Expect(err).ToNot(BeNil())

AddReportEntry("Integration", fmt.Sprintf("%sNegative: %s", cli.Purple, "cannot create diddoc with non-supported VM type"))
// Fail to create a new DID Doc with non-supported VM type
Expand Down
17 changes: 12 additions & 5 deletions tests/integration/cli_diddoc_pricing_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build integration

package integration

import (
Expand Down Expand Up @@ -85,7 +83,10 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() {
Expect(diff).To(Equal(tax.Amount))

By("exporting a readable tx event log")
events := helpers.ReadableEvents(res.Events)
txResp, err := cli.QueryTxn(res.TxHash)
Expect(err).To(BeNil())

events := helpers.ReadableEvents(txResp.Events)

By("ensuring the events contain the expected tax event")
Expect(events).To(ContainElement(
Expand Down Expand Up @@ -166,7 +167,10 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() {
Expect(diff).To(Equal(tax.Amount))

By("exporting a readable tx event log")
events := helpers.ReadableEvents(res.Events)
txResp, err := cli.QueryTxn(res.TxHash)
Expect(err).To(BeNil())

events := helpers.ReadableEvents(txResp.Events)

By("ensuring the events contain the expected tax event")
Expect(events).To(ContainElement(
Expand Down Expand Up @@ -237,7 +241,10 @@ var _ = Describe("cheqd cli - positive diddoc pricing", func() {
Expect(diff).To(Equal(tax.Amount))

By("exporting a readable tx event log")
events := helpers.ReadableEvents(res.Events)
txResp, err := cli.QueryTxn(res.TxHash)
Expect(err).To(BeNil())

events := helpers.ReadableEvents(txResp.Events)

By("ensuring the events contain the expected tax event")
Expect(events).To(ContainElement(
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cli_resource_negative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ var _ = Describe("cheqd cli - negative resource", func() {
Version: resourceVersion,
ResourceType: resourceType,
}, signInputs, resourceFile, testdata.BASE_ACCOUNT_1, helpers.GenerateFees(resourceFeeParams.Json.String()))
Expect(err).ToNot(BeNil())

// b. missing resource id - works because it is generated by the cli
_, err = cli.CreateResource(tmpDir, resourcetypes.MsgCreateResourcePayload{
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/cli_resource_pricing_negative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() {

By("querying the fee payer account balance after the transaction")
balanceAfter, err := cli.QueryBalance(testdata.BASE_ACCOUNT_4_ADDR, resourcetypes.BaseMinimalDenom)
Expect(err).ToNot(BeNil())

By("checking that the fee payer account balance has been decreased by the tax")
diff := balanceBefore.Amount.Sub(balanceAfter.Amount)
Expand Down Expand Up @@ -349,6 +350,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() {

By("querying the fee payer account balance after the transaction")
balanceAfter, err := cli.QueryBalance(testdata.BASE_ACCOUNT_4_ADDR, resourcetypes.BaseMinimalDenom)
Expect(err).ToNot(BeNil())

By("checking that the fee payer account balance has been decreased by the tax")
diff := balanceBefore.Amount.Sub(balanceAfter.Amount)
Expand Down Expand Up @@ -382,6 +384,7 @@ var _ = Describe("cheqd cli - negative resource pricing", func() {

By("querying the fee payer account balance after the transaction")
balanceAfter, err := cli.QueryBalance(testdata.BASE_ACCOUNT_4_ADDR, resourcetypes.BaseMinimalDenom)
Expect(err).ToNot(BeNil())

By("checking that the fee payer account balance has been decreased by the tax")
diff := balanceBefore.Amount.Sub(balanceAfter.Amount)
Expand Down

0 comments on commit 2cb71bc

Please sign in to comment.