From 68207c5bfe74e3460e8ced7c997e2ea7c5e4e9ae Mon Sep 17 00:00:00 2001 From: Chung Wu Date: Wed, 4 Jan 2023 11:45:07 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Update=20ISCN=20authz=20test=20case?= =?UTF-8?q?=20(and=20also=20some=20error=20message)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- x/iscn/app_test.go | 8 ++++---- x/iscn/types/authz.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/iscn/app_test.go b/x/iscn/app_test.go index 8c76c4e83..60bdb8c86 100644 --- a/x/iscn/app_test.go +++ b/x/iscn/app_test.go @@ -910,8 +910,8 @@ func TestUpdateAuthorization(t *testing.T) { Stakeholders: []types.IscnInput{stakeholder1, stakeholder2}, ContentMetadata: contentMetadata2, } - msg = types.NewMsgCreateIscnRecord(addr3, &record) - result = app.DeliverMsgNoError(t, msg, priv3) + msg = types.NewMsgCreateIscnRecord(addr1, &record) + result = app.DeliverMsgNoError(t, msg, priv1) iscnId3 := testutil.GetIscnIdFromResult(t, result) record = types.IscnRecord{ @@ -921,9 +921,9 @@ func TestUpdateAuthorization(t *testing.T) { ContentMetadata: contentMetadata2, } - updateMsg = types.NewMsgUpdateIscnRecord(addr3, iscnId3, &record) + updateMsg = types.NewMsgUpdateIscnRecord(addr1, iscnId3, &record) msgExec = authz.NewMsgExec(addr2, []sdk.Msg{updateMsg}) msg = &msgExec _, _, simErr, _ = app.DeliverMsg(msg, priv2) - require.ErrorContains(t, simErr, "authorization not found") + require.ErrorContains(t, simErr, "ISCN ID prefix mismatch") } diff --git a/x/iscn/types/authz.go b/x/iscn/types/authz.go index 79a7f9453..519e08aa8 100644 --- a/x/iscn/types/authz.go +++ b/x/iscn/types/authz.go @@ -32,7 +32,7 @@ func (a UpdateAuthorization) Accept(ctx sdk.Context, msg sdk.Msg) (authz.AcceptR return authz.AcceptResponse{}, sdkerrors.ErrLogic.Wrapf("authorization has invalid ISCN ID prefix: %v", err) } if !iscnId.PrefixEqual(&authIscnIdPrefix) { - return authz.AcceptResponse{}, sdkerrors.ErrUnauthorized.Wrap("iscn id prefix mismatch") + return authz.AcceptResponse{}, sdkerrors.ErrUnauthorized.Wrap("ISCN ID prefix mismatch") } return authz.AcceptResponse{Accept: true}, nil