Skip to content

Commit

Permalink
chore: fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddyMc committed Aug 31, 2022
1 parent 4b0cc77 commit 5d80e17
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions x/credential/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"strconv"
"testing"

"github.com/google/uuid"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand Down Expand Up @@ -407,15 +408,16 @@ func (s *IntegrationTestSuite) TestNewIssuePublicCredentialCmd() {
true,
val,
)
createDidDocument(s, "issuer", val)
issuerDidID := uuid.New().String()
createDidDocument(s, issuerDidID, val)

// copy the credential to a new file, with updated issuer DID with current chainID
credentialBytes, err := os.ReadFile("testdata/credential.json")
s.Require().NoError(err)
var credentialJSON map[string]interface{}
err = json.Unmarshal(credentialBytes, &credentialJSON)
s.Require().NoError(err)
credentialJSON["issuer"] = did.NewChainDID(s.cfg.ChainID, "issuer")
credentialJSON["issuer"] = did.NewChainDID(s.cfg.ChainID, issuerDidID)

updatedCredentialBytes, err := json.Marshal(credentialJSON)
s.Require().NoError(err)
Expand Down Expand Up @@ -504,7 +506,7 @@ func (s *IntegrationTestSuite) TestNewCreateRevocationListCmd() {
val := s.network.Validators[0]

// shared by all test cases
didID := "revoc-issuer"
didID := uuid.New().String()
createDidDocument(s, didID, val)

testCases := []struct {
Expand Down Expand Up @@ -634,7 +636,7 @@ func (s *IntegrationTestSuite) TestNewUpdateRevocationListCmd() {
val := s.network.Validators[0]

// shared by all test cases
didID := "revoc-issuer-updater"
didID := uuid.New().String()
createDidDocument(s, didID, val)
credDefID := "https://w3id.org/vc-revocation-list-2020/v1"
publishCredentialDefinition(s,
Expand Down

0 comments on commit 5d80e17

Please sign in to comment.