Add test for parsing super large transaction (#4849)

This commit is contained in:
benthecarman 2022-10-17 16:08:14 -05:00 committed by GitHub
parent f483e356cb
commit 8431b697a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
package org.bitcoins.core.protocol.blockchain
import org.bitcoins.core.protocol.transaction.Transaction
import org.bitcoins.testkitcore.gen.BlockchainElementsGenerator
import org.bitcoins.testkitcore.util.BitcoinSJvmTest
@ -43,6 +44,14 @@ class BlockTest extends BitcoinSJvmTest {
assert(time <= 15000)
}
it must "parse a large transaction 7393096d97bfee8660f4100ffd61874d62f9a65de9fb6acf740c4c386990ef73" in {
val fileName =
"/7393096d97bfee8660f4100ffd61874d62f9a65de9fb6acf740c4c386990ef73.txt"
val lines = Source.fromURL(getClass.getResource(fileName)).mkString.trim
val tx = Transaction.fromHex(lines)
assert(tx.hex == lines)
}
it must "have serialization symmetry" in {
forAllParallel(BlockchainElementsGenerator.block) { block =>
assert(Block(block.hex) == block)