commit inicial do projeto

This commit is contained in:
Júnior
2025-05-23 10:44:32 -03:00
commit 8f04473c0b
106 changed files with 5673 additions and 0 deletions

View File

@ -0,0 +1,39 @@
package transactions_test
import (
"dejo_node/internal/transactions"
"testing"
)
func TestTransaction_Hash(t *testing.T) {
tx := transactions.Transaction{
From: "0xabc",
To: "0xdef",
Value: 100,
Nonce: 1,
Gas: 21000,
Signature: "0xsig",
}
hash := tx.Hash()
if hash == "" {
t.Fatal("hash não pode ser vazio")
}
}
func TestTransaction_IsZero(t *testing.T) {
tx := transactions.Transaction{}
if !tx.IsZero() {
t.Error("transação vazia deveria retornar true para IsZero")
}
tx = transactions.Transaction{
From: "0xabc",
To: "0xdef",
Value: 10,
Signature: "0xsig",
}
if tx.IsZero() {
t.Error("transação válida retornou true para IsZero")
}
}