Created
January 16, 2025 14:54
-
-
Save fcecin/2fe336e9f76900f37be89a35e5ebac62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* types/tx.go: | |
** No import(...) no topo do arquivo, adicionar: | |
"github.com/ethereum/go-ethereum/crypto" | |
** E logo abaixo: | |
// Hash computes the TMHASH hash of the wire encoded transaction. | |
// | |
// func (tx Tx) Hash() []byte { | |
// return tmhash.Sum(tx) | |
// } | |
func (tx Tx) Hash() []byte { | |
return crypto.Keccak256(tx) | |
} | |
// func (tx Tx) Key() TxKey { | |
// return sha256.Sum256(tx) | |
// } | |
// | |
// Key returns the Keccak256-based fixed-length key for indexing. | |
func (tx Tx) Key() TxKey { | |
var key TxKey | |
copy(key[:], crypto.Keccak256(tx)) | |
return key | |
} | |
* go.mod: | |
** Adicionar no primeiro grupo de require(...): | |
github.com/ethereum/go-ethereum v1.14.12 | |
** Ir no cmd line e digitar: | |
go mod tidy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment