Skip to content

Commit

Permalink
Merge pull request #1298 from hyperledger/org-prop
Browse files Browse the repository at this point in the history
fix-1297
  • Loading branch information
nguyer authored Feb 12, 2024
2 parents 662feec + 765fd8b commit 22a7533
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func WaitForEvent(t *testing.T, c chan *core.EventDelivery, eventType core.Event
t.Logf("Detected '%s' event for ref '%s'", ed.Type, ed.Reference)
return
}
t.Logf("Ignored event '%s'", ed.ID)
t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type)
}
}

Expand All @@ -149,7 +149,7 @@ func WaitForMessageConfirmed(t *testing.T, c chan *core.EventDelivery, msgType c
t.Logf("Detected '%s' event for message '%s' of type '%s'", ed.Type, ed.Message.Header.ID, msgType)
return ed
}
t.Logf("Ignored event '%s'", ed.ID)
t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type)
}
}

Expand All @@ -160,7 +160,7 @@ func WaitForMessageRejected(t *testing.T, c chan *core.EventDelivery, msgType co
t.Logf("Detected '%s' event for message '%s' of type '%s'", ed.Type, ed.Message.Header.ID, msgType)
return ed
}
t.Logf("Ignored event '%s'", ed.ID)
t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type)
}
}

Expand All @@ -171,7 +171,7 @@ func WaitForIdentityConfirmed(t *testing.T, c chan *core.EventDelivery) *core.Ev
t.Logf("Detected '%s' event for identity '%s'", ed.Type, ed.Reference)
return ed
}
t.Logf("Ignored event '%s'", ed.ID)
t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type)
}
}

Expand Down
11 changes: 10 additions & 1 deletion test/e2e/multiparty/contract_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func runMigrationTest(suite *ContractMigrationTestSuite, address1, address2 stri
e2e.PollForUp(suite.T(), client1)
e2e.PollForUp(suite.T(), client2)

eventNames := "message_confirmed|blockchain_event_received"
eventNames := "message_confirmed|blockchain_event_received|identity_confirmed"
queryString := fmt.Sprintf("namespace=%s&ephemeral&autoack&filter.events=%s", testNamespace, eventNames)
received1 := e2e.WsReader(client1.WebSocket(suite.T(), queryString, nil))
received2 := e2e.WsReader(client2.WebSocket(suite.T(), queryString, nil))
Expand Down Expand Up @@ -149,6 +149,15 @@ func runMigrationTest(suite *ContractMigrationTestSuite, address1, address2 stri
client2.RegisterSelfOrg(suite.T(), true)
client2.RegisterSelfNode(suite.T(), true)

// Wait for the orgs to propagate (org2 to node1, and org1 to node 2)
orgConfs := append([]*core.EventDelivery{}, e2e.WaitForIdentityConfirmed(suite.T(), received1))
orgConfs = append(orgConfs, e2e.WaitForIdentityConfirmed(suite.T(), received1))
orgConfs = append(orgConfs, e2e.WaitForIdentityConfirmed(suite.T(), received2))
orgConfs = append(orgConfs, e2e.WaitForIdentityConfirmed(suite.T(), received2))
for _, oc := range orgConfs {
assert.Regexp(suite.T(), fmt.Sprintf("%s|%s", suite.testState.org1.Name, suite.testState.org2.Name), oc.Identity.DID)
}

// Migrate to the new contract
client1.NetworkAction(suite.T(), core.NetworkActionTerminate)
e2e.WaitForContractEvent(suite.T(), client1, received1, map[string]interface{}{
Expand Down

0 comments on commit 22a7533

Please sign in to comment.