From aa2bc69acc54ef9db8b7ac16b21ddb74c66e8dce Mon Sep 17 00:00:00 2001 From: ramtinms Date: Wed, 16 Oct 2024 08:47:30 -0700 Subject: [PATCH] apply PR feedback --- fvm/evm/types/result.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fvm/evm/types/result.go b/fvm/evm/types/result.go index d33fa883a21..2ad16a0b5df 100644 --- a/fvm/evm/types/result.go +++ b/fvm/evm/types/result.go @@ -151,7 +151,7 @@ func (res *Result) RLPEncodedLogs() ([]byte, error) { if len(res.Logs) > 0 { encodedLogs, err = rlp.EncodeToBytes(res.Logs) if err != nil { - return nil, err + return encodedLogs, err } } return encodedLogs, nil @@ -170,11 +170,11 @@ func (res *Result) DeployedContractAddressString() string { // StateChangeChecksum constructs a checksum // based on the state change commitment on the result func (res *Result) StateChangeChecksum() [ChecksumLength]byte { - return BytesToChecksum(res.StateChangeCommitment) + return SliceToChecksumLength(res.StateChangeCommitment) } -// BytesToChecksum cuts the first 4 bytes of the input and convert it into checksum -func BytesToChecksum(input []byte) [ChecksumLength]byte { +// SliceToChecksumLength cuts the first 4 bytes of the input and convert it into checksum +func SliceToChecksumLength(input []byte) [ChecksumLength]byte { // the first 4 bytes of StateChangeCommitment is used as checksum var checksum [ChecksumLength]byte if len(input) >= ChecksumLength {