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

Function TestCertHandlerCreateOwnerMismatch

x/cert/handler/handler_test.go:100–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestCertHandlerCreateOwnerMismatch(t *testing.T) {
101 suite := setupTestSuite(t)
102
103 owner := testutil.AccAddress(t)
104 cert := testutil.Certificate(t, owner)
105
106 msg := &types.MsgCreateCertificate{
107 Owner: testutil.AccAddress(t).String(),
108 Cert: cert.PEM.Cert,
109 Pubkey: cert.PEM.Pub,
110 }
111
112 res, err := suite.handler(suite.ctx, msg)
113 require.Error(t, err, types.ErrInvalidCertificateValue.Error())
114 require.Nil(t, res)
115
116 _, exists := suite.keeper.GetCertificateByID(suite.ctx, types.CertID{
117 Owner: owner,
118 Serial: cert.Serial,
119 })
120 require.False(t, exists)
121
122 _, exists = suite.keeper.GetCertificateByID(suite.ctx, types.CertID{
123 Owner: owner,
124 })
125 require.False(t, exists)
126}
127
128func TestCertHandlerDuplicate(t *testing.T) {
129 suite := setupTestSuite(t)

Callers

nothing calls this directly

Calls 5

setupTestSuiteFunction · 0.70
ErrorMethod · 0.65
GetCertificateByIDMethod · 0.65
StringMethod · 0.45
handlerMethod · 0.45

Tested by

no test coverage detected