From 7c2741a4b43952a19c4dabb0f16f17ef7a4bb5f2 Mon Sep 17 00:00:00 2001 From: Christian Lohr Date: Mon, 6 Nov 2023 15:32:50 +0100 Subject: [PATCH] fix: gravity message logging format (#1027) * fix: gravity message logging format * fix: GCI --- x/evm/keeper/msg_assigner_test.go | 8 ++++---- x/gravity/keeper/msg_server.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/evm/keeper/msg_assigner_test.go b/x/evm/keeper/msg_assigner_test.go index aa90195d..0696e6c7 100644 --- a/x/evm/keeper/msg_assigner_test.go +++ b/x/evm/keeper/msg_assigner_test.go @@ -586,7 +586,7 @@ func TestPickValidatorForMessage(t *testing.T) { Uptime: "0.5", Fee: "0.5", }, - chainID: "test-chain", + chainID: "test-chain", expected: sdk.ValAddress("testvalidator1").String(), }, { @@ -620,7 +620,9 @@ func TestPickValidatorForMessage(t *testing.T) { expectedErr: errors.New("no snapshot found"), }, { - name: "assigns a consistent pseudo-random validator in the happy path when no weights exist (cold start)", + chainID: "test-chain", + expected: sdk.ValAddress("testvalidator1").String(), + name: "assigns a consistent pseudo-random validator in the happy path when no weights exist (cold start)", setup: func() MsgAssigner { msgAssigner := MsgAssigner{} @@ -663,8 +665,6 @@ func TestPickValidatorForMessage(t *testing.T) { return msgAssigner }, - chainID: "test-chain", - expected: sdk.ValAddress("testvalidator1").String(), }, { name: "applies validator filtering based on job requirements", diff --git a/x/gravity/keeper/msg_server.go b/x/gravity/keeper/msg_server.go index 23c15197..9ecb9453 100644 --- a/x/gravity/keeper/msg_server.go +++ b/x/gravity/keeper/msg_server.go @@ -157,9 +157,9 @@ func (k msgServer) claimHandlerCommon(ctx sdk.Context, msgAny *codectypes.Any, m // Emit the handle message event return ctx.EventManager().EmitTypedEvent( &types.EventClaim{ - Message: string(msg.GetType()), - ClaimHash: string(hash), - AttestationId: string(types.GetAttestationKey(msg.GetEventNonce(), hash)), + Message: msg.GetType().String(), + ClaimHash: fmt.Sprintf("%x", hash), + AttestationId: fmt.Sprintf("%x", types.GetAttestationKey(msg.GetEventNonce(), hash)), }, ) }