MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / BenchmarkTransactionHashTxn

Function BenchmarkTransactionHashTxn

transaction_benchmark_test.go:267–277  ·  view source on GitHub ↗

BenchmarkTransactionHashTxn measures transaction hash generation

(b *testing.B)

Source from the content-addressed store, hash-verified

265
266// BenchmarkTransactionHashTxn measures transaction hash generation
267func BenchmarkTransactionHashTxn(b *testing.B) {
268 txn := createTestTransaction("source-001", "dest-001", "ref-001", 100.00)
269 txn.TransactionID = "txn-benchmark-001"
270 txn.CreatedAt = time.Now()
271 txn.PreciseAmount = big.NewInt(10000)
272
273 b.ResetTimer()
274 for i := 0; i < b.N; i++ {
275 _ = txn.HashTxn()
276 }
277}
278
279// BenchmarkApplyPrecision measures precision application to transactions
280func BenchmarkApplyPrecision(b *testing.B) {

Callers

nothing calls this directly

Calls 2

createTestTransactionFunction · 0.85
HashTxnMethod · 0.80

Tested by

no test coverage detected