(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestTransaction_HashTxn(t *testing.T) { |
| 28 | txn := &Transaction{ |
| 29 | Amount: 100.0, |
| 30 | Reference: "ref123", |
| 31 | Currency: "USD", |
| 32 | Source: "source_account", |
| 33 | Destination: "dest_account", |
| 34 | } |
| 35 | data := "100.000000ref123USDsource_accountdest_account" |
| 36 | expectedHash := sha256.Sum256([]byte(data)) |
| 37 | expectedHashStr := hex.EncodeToString(expectedHash[:]) |
| 38 | |
| 39 | txnHash := txn.HashTxn() |
| 40 | assert.Equal(t, expectedHashStr, txnHash) |
| 41 | } |
| 42 | |
| 43 | func TestCompare(t *testing.T) { |
| 44 | value := big.NewInt(10) |