From a0e81fd9342ff8553eda0287a5992ccccef55309 Mon Sep 17 00:00:00 2001 From: Ardit Marku Date: Wed, 21 Feb 2024 18:39:08 +0200 Subject: [PATCH] Return check-summed variant for deployed contract address --- fvm/evm/types/events.go | 2 +- fvm/evm/types/events_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fvm/evm/types/events.go b/fvm/evm/types/events.go index 57095390783..b3cd35134c8 100644 --- a/fvm/evm/types/events.go +++ b/fvm/evm/types/events.go @@ -143,7 +143,7 @@ func (p *TransactionExecutedPayload) CadenceEvent() (cadence.Event, error) { cadence.String(p.Result.VMErrorString()), cadence.NewUInt8(p.Result.TxType), cadence.NewUInt64(p.Result.GasConsumed), - cadence.String(hex.EncodeToString(p.Result.DeployedContractAddress.Bytes())), + cadence.String(p.Result.DeployedContractAddress.ToCommon().Hex()), cadence.String(hex.EncodeToString(p.Result.ReturnedValue)), cadence.String(hex.EncodeToString(encodedLogs)), }, diff --git a/fvm/evm/types/events_test.go b/fvm/evm/types/events_test.go index a4c2af12cd7..3610be867cd 100644 --- a/fvm/evm/types/events_test.go +++ b/fvm/evm/types/events_test.go @@ -155,7 +155,7 @@ func TestEVMTransactionExecutedEventCCFEncodingDecoding(t *testing.T) { assert.Equal( t, tep.DeployedContractAddress, - hex.EncodeToString(txResult.DeployedContractAddress.Bytes()), + txResult.DeployedContractAddress.ToCommon().Hex(), ) assert.Equal(t, tep.ReturnedValue, data) @@ -207,7 +207,7 @@ func TestEVMTransactionExecutedEventCCFEncodingDecoding(t *testing.T) { assert.Equal( t, tep.DeployedContractAddress, - hex.EncodeToString(txResult.DeployedContractAddress.Bytes()), + txResult.DeployedContractAddress.ToCommon().Hex(), ) assert.Equal(t, tep.ReturnedValue, data)