Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kirugan committed Jul 29, 2024
1 parent 6e20a05 commit 3b9e643
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions adapters/p2p2core/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func AdaptReceipt(r *spec.Receipt, txHash *felt.Felt) *core.TransactionReceipt {
TransactionHash: txHash,
Reverted: common.RevertReason != nil, // todo is it correct?
RevertReason: common.GetRevertReason(),
TotalGasConsumed: nil, // todo(kirill) set field after spec update
}
}

Expand Down
7 changes: 1 addition & 6 deletions core/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ type TransactionReceipt struct {
func (r *TransactionReceipt) Hash() (*felt.Felt, error) {
revertReasonHash := &felt.Zero
if r.Reverted {
// todo remove error because it's unneccessary
var err error
revertReasonHash, err = crypto.StarknetKeccak([]byte(r.RevertReason))
if err != nil {
return nil, err
}
revertReasonHash = crypto.StarknetKeccak([]byte(r.RevertReason))
}

var totalGasConsumed GasConsumed
Expand Down
3 changes: 2 additions & 1 deletion core/receipt_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package core

import (
"encoding/binary"
"testing"

"github.com/NethermindEth/juno/core/felt"
"github.com/NethermindEth/juno/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)

func TestReceiptHash(t *testing.T) {
Expand Down

0 comments on commit 3b9e643

Please sign in to comment.