@@ -0,0 +1,2790 @@
+package io.bisq.core.dao.blockchain.parse;%0A%0Aimport io.bisq.common.proto.persistable.PersistenceProtoResolver;%0Aimport io.bisq.core.dao.blockchain.vo.*;%0Aimport mockit.Expectations;%0Aimport mockit.Injectable;%0Aimport mockit.Tested;%0Aimport mockit.integration.junit4.JMockit;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport java.io.File;%0Aimport java.util.ArrayList;%0Aimport java.util.Date;%0Aimport java.util.List;%0Aimport java.util.Optional;%0A%0Aimport static org.junit.Assert.*;%0A%0A@RunWith(JMockit.class)%0Apublic class BsqParserTest %7B%0A    @Tested(availableDuringSetup = true)%0A    BsqBlockChain bsqBlockChain;%0A    @Tested(fullyInitialized = true, availableDuringSetup = true)%0A    BsqParser bsqParser;%0A%0A    @Injectable%0A    PersistenceProtoResolver persistenceProtoResolver;%0A    @Injectable%0A    File storageDir;%0A%0A    @Injectable%0A    RpcService rpcService;%0A    @Injectable%0A    OpReturnVerification opReturnVerification;%0A    @Injectable%0A    IssuanceVerification issuanceVerification;%0A%0A    @Test%0A    public void testIsBsqTx() %7B%0A        // Setup a basic transaction with two inputs%0A        int height = 200;%0A        String hash = %22abc123%22;%0A        long time = new Date().getTime();%0A        List%3CTxInput%3E inputs = new ArrayList%3CTxInput%3E();%0A        inputs.add(new TxInput(%22tx1%22, 0));%0A        inputs.add(new TxInput(%22tx1%22, 1));%0A        List%3CTxOutput%3E outputs = new ArrayList%3CTxOutput%3E();%0A        outputs.add(new TxOutput(0, 101, %22tx1%22, null, null, null, height));%0A        TxVo txVo = new TxVo(%22vo%22, height, hash, time);%0A        Tx tx = new Tx(txVo, inputs, outputs);%0A%0A        // Return one spendable txoutputs with value, for three test cases%0A        // 1) - null, 0     -%3E not BSQ transaction%0A        // 2) - 100, null   -%3E BSQ transaction%0A        // 3) - 0, 100      -%3E BSQ transaction%0A        new Expectations(bsqBlockChain) %7B%7B%0A            bsqBlockChain.getSpendableTxOutput(new TxIdIndexTuple(%22tx1%22, 0));%0A            result = Optional.empty();%0A            result = Optional.of(new TxOutput(0, 100, %22txout1%22, null, null, null, height));%0A            result = Optional.of(new TxOutput(0, 0, %22txout1%22, null, null, null, height));%0A%0A            bsqBlockChain.getSpendableTxOutput(new TxIdIndexTuple(%22tx1%22, 1));%0A            result = Optional.of(new TxOutput(0, 0, %22txout2%22, null, null, null, height));%0A            result = Optional.empty();%0A            result = Optional.of(new TxOutput(0, 100, %22txout2%22, null, null, null, height));%0A        %7D%7D;%0A%0A        // First time there is no BSQ value to spend so it's not a bsq transaction%0A        assertFalse(bsqParser.isBsqTx(height, tx));%0A        // Second time there is BSQ in the first txout%0A        assertTrue(bsqParser.isBsqTx(height, tx));%0A        // Third time there is BSQ in the second txout%0A        assertTrue(bsqParser.isBsqTx(height, tx));%0A    %7D%0A%7D%0A

add test for isBsqTx