MCPcopy Create free account
hub / github.com/akash-network/node / TestProviderSignAndUpdate

Function TestProviderSignAndUpdate

x/audit/handler/handler_test.go:93–122  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func TestProviderSignAndUpdate(t *testing.T) {
94 suite := setupTestSuite(t)
95
96 owner := testutil.AccAddress(t)
97 auditor := testutil.AccAddress(t)
98 originAttr := testutil.Attributes(t)
99
100 msg := &types.MsgSignProviderAttributes{
101 Owner: owner.String(),
102 Auditor: auditor.String(),
103 Attributes: originAttr,
104 }
105
106 res, err := suite.handler(suite.ctx, msg)
107 require.NotNil(t, res)
108 require.NoError(t, err)
109
110 msg.Attributes = testutil.Attributes(t)
111 res, err = suite.handler(suite.ctx, msg)
112 require.NotNil(t, res)
113 require.NoError(t, err)
114 prov, exists := suite.keeper.GetProviderAttributes(suite.ctx, owner)
115
116 msg.Attributes = append(msg.Attributes, originAttr...)
117 // add some more attributes.
118 // if part below starts to fail it is due to testutil.Attributes
119 // may produce same attributes between multiple calls to it
120 require.True(t, exists)
121 require.Equal(t, prov, msgSignProviderAttributesToResponse(msg))
122}
123
124func TestProviderDeleteNonExisting(t *testing.T) {
125 suite := setupTestSuite(t)

Callers

nothing calls this directly

Calls 5

setupTestSuiteFunction · 0.70
GetProviderAttributesMethod · 0.65
StringMethod · 0.45
handlerMethod · 0.45

Tested by

no test coverage detected