MCPcopy Create free account
hub / github.com/chain/Core / benchGenBlock

Function benchGenBlock

core/txbuilder/finalize_test.go:293–375  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

291}
292
293func benchGenBlock(b *testing.B) {
294 const tx1hex = ("07" + // serflags
295 "01" + // transaction version
296 "0a" + // common fields extensible string length
297 "b0bbdcc705" + // common fields, mintime
298 "ffbfdcc705" + // common fields, maxtime
299 "00" + // common witness extensible string length
300 "01" + // inputs count
301 "01" + // input 0, asset version
302 "6c" + // input 0, input commitment length prefix
303 "01" + // input 0, input commitment, "spend" type+
304 "6a" + // input 0, spend input commitment, spend commitment length prefix
305 "dd385f6fe25d91d8c1bd0fa58951ad56b0c5229dcc01f61d9f9e8b9eb92d3292" + // input 0, spend input commitment, spend commitment, source ID
306 "0000000000000000000000000000000000000000000000000000000000000000" + // input 0, spend input commitment, spend commitment, asset id
307 "80a094a58d1d" + // input 0, spend input commitment, spend commitment, amount
308 "01" + // input 0, spend input commitment, spend commitment, source position
309 "01" + // input 0, spend input commitment, spend commitment, vm version
310 "0101" + // input 0, spend input commitment, spend commitment, control program
311 "0000000000000000000000000000000000000000000000000000000000000000" + // input 0, spend input commitment, spend commitment, reference data hash
312 "05696e707574" + // input 0, reference data
313 "01" + // input 0, input witness length prefix
314 "00" + // input 0, input witness, number of args
315 "02" + // outputs count
316 "01" + // output 0, asset version
317 "29" + // output 0, output commitment length
318 "a9b2b6c5394888ab5396f583ae484b8459486b14268e2bef1b637440335eb6c1" + // output 0, output commitment, asset id
319 "80e0a596bb11" + // output 0, output commitment, amount
320 "01" + // output 0, output commitment, vm version
321 "0101" + // output 0, output commitment, control program
322 "00" + // output 0, reference data
323 "00" + // output 0, output witness
324 "01" + // output 1, asset version
325 "29" + // output 1, output commitment length
326 "a9b2b6c5394888ab5396f583ae484b8459486b14268e2bef1b637440335eb6c1" + // output 1, output commitment, asset id
327 "80c0ee8ed20b" + // output 1, output commitment, amount
328 "01" + // output 1, vm version
329 "0102" + // output 1, output commitment, control program
330 "00" + // output 1, reference data
331 "00" + // output 1, output witness
332 "0c646973747269627574696f6e") // reference data
333
334 const tx2hex = ("07" + // serflags
335 "01" + // transaction version
336 "02" + // common fields extensible string length
337 "00" + // common fields, mintime
338 "00" + // common fields, maxtime
339 "00" + // common witness extensible string length
340 "00" + // inputs count
341 "00" + // outputs count
342 "00") // reference data
343
344 b.StopTimer()
345
346 ctx := context.Background()
347 c := prottest.NewChain(b)
348 g := generator.New(c, nil, pgtest.NewTx(b))
349
350 var tx1, tx2 legacy.Tx

Callers 1

BenchmarkGenerateBlockFunction · 0.85

Calls 4

UnmarshalTextMethod · 0.95
GenerateBlockMethod · 0.95
PendingTxsMethod · 0.80
SubmitMethod · 0.65

Tested by

no test coverage detected