Skip to content

Commit

Permalink
apply PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ramtinms committed Oct 16, 2024
1 parent a3ed3ef commit aa2bc69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fvm/evm/types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit aa2bc69

Please sign in to comment.