Skip to content

Commit a5d6e4c

Browse files
committed
Use fresh error codes for cardano errors
Signed-off-by: Simon Gellis <[email protected]>
1 parent 71673fd commit a5d6e4c

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

internal/blockchain/cardano/cardano_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func TestStartNamespaceStreamQueryError(t *testing.T) {
222222
assert.NoError(t, err)
223223

224224
err = c.StartNamespace(c.ctx, "ns1")
225-
assert.Regexp(t, "FF10282.*pop", err)
225+
assert.Regexp(t, "FF10484.*pop", err)
226226
}
227227

228228
func TestStartNamespaceStreamCreateError(t *testing.T) {
@@ -248,7 +248,7 @@ func TestStartNamespaceStreamCreateError(t *testing.T) {
248248
assert.NoError(t, err)
249249

250250
err = c.StartNamespace(c.ctx, "ns1")
251-
assert.Regexp(t, "FF10282.*pop", err)
251+
assert.Regexp(t, "FF10484.*pop", err)
252252
}
253253

254254
func TestStartNamespaceStreamUpdateError(t *testing.T) {
@@ -274,7 +274,7 @@ func TestStartNamespaceStreamUpdateError(t *testing.T) {
274274
assert.NoError(t, err)
275275

276276
err = c.StartNamespace(c.ctx, "ns1")
277-
assert.Regexp(t, "FF10282.*pop", err)
277+
assert.Regexp(t, "FF10484.*pop", err)
278278
}
279279

280280
func TestStartNamespaceWSConnectFail(t *testing.T) {
@@ -359,7 +359,7 @@ func TestVerifyCardanoAddress(t *testing.T) {
359359
assert.Regexp(t, "FF10354", err)
360360

361361
_, err = c.ResolveSigningKey(context.Background(), "baddr1cafed00d", blockchain.ResolveKeyIntentSign)
362-
assert.Regexp(t, "FF10140", err)
362+
assert.Regexp(t, "FF10483", err)
363363

364364
key, err := c.ResolveSigningKey(context.Background(), "addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3n0d3vllmyqwsx5wktcd8cc3sq835lu7drv2xwl2wywfgse35a3x", blockchain.ResolveKeyIntentSign)
365365
assert.NoError(t, err)
@@ -868,7 +868,7 @@ func TestDeleteContractListenerFail(t *testing.T) {
868868
httpmock.NewStringResponder(500, "oops"))
869869

870870
err := c.DeleteContractListener(context.Background(), sub, true)
871-
assert.Regexp(t, "FF10282", err)
871+
assert.Regexp(t, "FF10484", err)
872872
}
873873

874874
func TestGetContractListenerStatus(t *testing.T) {
@@ -917,7 +917,7 @@ func TestGetContractListenerErrorNotFound(t *testing.T) {
917917
httpmock.NewStringResponder(404, "no"))
918918

919919
_, _, _, err := c.GetContractListenerStatus(context.Background(), "ns1", "sb-1", false)
920-
assert.Regexp(t, "FF10282", err)
920+
assert.Regexp(t, "FF10484", err)
921921
}
922922

923923
func TestGetTransactionStatusSuccess(t *testing.T) {
@@ -1062,7 +1062,7 @@ func TestGetTransactionStatusError(t *testing.T) {
10621062
httpmock.NewStringResponder(500, "uh oh"))
10631063

10641064
_, err := c.GetTransactionStatus(context.Background(), op)
1065-
assert.Regexp(t, "FF10282", err)
1065+
assert.Regexp(t, "FF10484", err)
10661066
}
10671067

10681068
func TestGetTransactionStatusHandleReceipt(t *testing.T) {
@@ -1226,7 +1226,7 @@ func TestAddFireflySubscriptionListError(t *testing.T) {
12261226

12271227
ns := &core.Namespace{Name: "ns1", NetworkName: "ns1"}
12281228
_, err = c.AddFireflySubscription(c.ctx, ns, contract, "")
1229-
assert.Regexp(t, "FF10282", err)
1229+
assert.Regexp(t, "FF10484", err)
12301230
}
12311231

12321232
func TestAddFireflySubscriptionAlreadyExists(t *testing.T) {
@@ -1326,7 +1326,7 @@ func TestAddFireflySubscriptionCreateError(t *testing.T) {
13261326

13271327
ns := &core.Namespace{Name: "ns1", NetworkName: "ns1"}
13281328
_, err = c.AddFireflySubscription(c.ctx, ns, contract, "")
1329-
assert.Regexp(t, "FF10282", err)
1329+
assert.Regexp(t, "FF10484", err)
13301330
}
13311331

13321332
func TestInvokeContractOK(t *testing.T) {
@@ -1456,7 +1456,7 @@ func TestInvokeContractConnectorError(t *testing.T) {
14561456

14571457
rejected, err := c.InvokeContract(context.Background(), "opId", signingKey, fftypes.JSONAnyPtrBytes(locationBytes), parsedMethod, params, options, nil)
14581458
assert.True(t, rejected)
1459-
assert.Regexp(t, "FF10282", err)
1459+
assert.Regexp(t, "FF10484", err)
14601460
}
14611461

14621462
func TestQueryContractOK(t *testing.T) {
@@ -1587,7 +1587,7 @@ func TestQueryContractConnectorError(t *testing.T) {
15871587
assert.NoError(t, err)
15881588

15891589
_, err = c.QueryContract(context.Background(), signingKey, fftypes.JSONAnyPtrBytes(locationBytes), parsedMethod, params, options)
1590-
assert.Regexp(t, "FF10282", err)
1590+
assert.Regexp(t, "FF10484", err)
15911591
}
15921592

15931593
func TestQueryContractInvalidJson(t *testing.T) {
@@ -1653,7 +1653,7 @@ func TestDeployContractConnectorError(t *testing.T) {
16531653

16541654
rejected, err := c.DeployContract(context.Background(), nsOpId, signingKey, definition, contract, nil, nil)
16551655
assert.True(t, rejected)
1656-
assert.Regexp(t, "FF10282", err)
1656+
assert.Regexp(t, "FF10484", err)
16571657
}
16581658

16591659
func TestGetFFIParamValidator(t *testing.T) {

internal/coremsgs/en_error_messages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ var (
5959
MsgSerializationFailed = ffe("FF10137", "Serialization failed")
6060
MsgMissingPluginConfig = ffe("FF10138", "Missing configuration '%s' for %s")
6161
MsgMissingDataHashIndex = ffe("FF10139", "Missing data hash for index '%d' in message", 400)
62-
MsgInvalidCardanoAddress = ffe("FF10140", "Supplied cardano address is invalid", 400)
6362
MsgInvalidEthAddress = ffe("FF10141", "Supplied ethereum address is invalid", 400)
6463
MsgInvalidTezosAddress = ffe("FF10142", "Supplied tezos address is invalid", 400)
6564
Msg404NoResult = ffe("FF10143", "No result found", 404)
@@ -147,7 +146,6 @@ var (
147146
MsgAuthorOrgSigningKeyMismatch = ffe("FF10279", "Author organization '%s' is not associated with signing key '%s'")
148147
MsgCannotTransferToSelf = ffe("FF10280", "From and to addresses must be different", 400)
149148
MsgLocalOrgNotSet = ffe("FF10281", "Unable to resolve the local root org. Please ensure org.name is configured", 500)
150-
MsgCardanoconnectRESTErr = ffe("FF10282", "Error from cardano connector: %s")
151149
MsgTezosconnectRESTErr = ffe("FF10283", "Error from tezos connector: %s")
152150
MsgFabconnectRESTErr = ffe("FF10284", "Error from fabconnect: %s")
153151
MsgInvalidIdentity = ffe("FF10285", "Supplied Fabric signer identity is invalid", 400)
@@ -323,4 +321,6 @@ var (
323321
MsgInvalidIdentityPatch = ffe("FF10480", "A profile must be provided when updating an identity", 400)
324322
MsgNodeNotProvidedForCheck = ffe("FF10481", "Node not provided for check", 500)
325323
MsgNodeMissingProfile = ffe("FF10482", "Node provided for check does not have a profile", 500)
324+
MsgInvalidCardanoAddress = ffe("FF10483", "Supplied cardano address is invalid", 400)
325+
MsgCardanoconnectRESTErr = ffe("FF10484", "Error from cardano connector: %s")
326326
)

0 commit comments

Comments
 (0)