Skip to content

Commit

Permalink
test removing PublisherIntent
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBolten committed Dec 14, 2023
1 parent 7d9f7bd commit 634840d
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions integration_tests/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func (s *IntegrationTestSuite) TestPubsub() {
s.Require().Equal(publisher.Domain, "example.com")

// set publisher intent for cellar
s.T().Log("Submitting PublisherIntent")
s.T().Log("Submitting AddPublisherIntent")
subscriptionID := fmt.Sprintf("1:%s", unusedGenesisContract.String())
publisherIntentMsg := types.MsgAddPublisherIntentRequest{
addPublisherIntentMsg := types.MsgAddPublisherIntentRequest{
PublisherIntent: &types.PublisherIntent{
SubscriptionId: subscriptionID,
PublisherDomain: publisher.Domain,
Expand All @@ -83,9 +83,9 @@ func (s *IntegrationTestSuite) TestPubsub() {
Signer: proposer.address().String(),
}

_, err = s.chain.sendMsgs(*proposerCtx, &publisherIntentMsg)
_, err = s.chain.sendMsgs(*proposerCtx, &addPublisherIntentMsg)
s.Require().NoError(err)
s.T().Log("PublisherIntent submitted successfully")
s.T().Log("AddPublisherIntent submitted successfully")

s.T().Log("Verifying PublisherIntent correctly added")
publisherIntentsResponse, err := pubsubQueryClient.QueryPublisherIntents(context.Background(), &types.QueryPublisherIntentsRequest{})
Expand Down Expand Up @@ -309,6 +309,23 @@ func (s *IntegrationTestSuite) TestPubsub() {
s.Require().NoError(err)
s.Require().Len(defaultSubscriptionsResponse.DefaultSubscriptions, 0)

// remove publisher intent for cellar
s.T().Log("Removing PublisherIntent")
removePublisherIntentMsg := types.MsgRemovePublisherIntentRequest{
SubscriptionId: subscriptionID,
PublisherDomain: publisher.Domain,
Signer: proposer.address().String(),
}

_, err = s.chain.sendMsgs(*proposerCtx, &removePublisherIntentMsg)
s.Require().NoError(err)
s.T().Log("RemovePublisherIntent submitted successfully")

s.T().Log("Verifying PublisherIntent correctly removed")
publisherIntentsResponse, err = pubsubQueryClient.QueryPublisherIntents(context.Background(), &types.QueryPublisherIntentsRequest{})
s.Require().NoError(err)
s.Require().Len(publisherIntentsResponse.PublisherIntents, 0)

// remove publisher prop
s.T().Log("Creating RemovePublisherProposal")
removePublisherProp := types.RemovePublisherProposal{
Expand Down

0 comments on commit 634840d

Please sign in to comment.