diff --git a/src/evo/creditpool.cpp b/src/evo/creditpool.cpp index 639aa1b1d5de..ab664bc06c80 100644 --- a/src/evo/creditpool.cpp +++ b/src/evo/creditpool.cpp @@ -189,7 +189,9 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const gsl::not_null node_wallet.getblockcount(): + self.check_mempool_result(tx=asset_unlock_tx, result_expected={'allowed': True, 'fees': {'base': Decimal(str(tiny_amount / COIN))}}) + break + else: + self.check_mempool_result(tx=asset_unlock_tx, result_expected={'allowed': False, 'reject-reason' : 'bad-assetunlock-too-late'}) + self.log.info("Asset Unlock tx expired, let's try again...") + index += 1 + + self.log.info("Generate one more quorum after which signing quorum becomes too old") + self.mine_quorum_2_nodes() + self.check_mempool_result(tx=asset_unlock_tx, result_expected={'allowed': False, 'reject-reason': 'bad-assetunlock-too-old-quorum'}) + + asset_unlock_tx = self.create_assetunlock(620, 4000 * COIN + 1, pubkey) + txid_in_block = self.send_tx(asset_unlock_tx) + self.log.info(f"{txid_in_block} should not be mined") + tip_hash = self.generate(node, 1)[0] + assert txid_in_block not in node.getblock(tip_hash)['tx'] + + asset_unlock_tx = self.create_assetunlock(621, 4000 * COIN, pubkey) + txid_in_block = self.send_tx(asset_unlock_tx) + self.log.info(f"{txid_in_block} should be mined") + tip_hash = self.generate(node, 1)[0] + assert txid_in_block in node.getblock(tip_hash)['tx'] + + asset_unlock_tx = self.create_assetunlock(622, COIN, pubkey) + txid_in_block = self.send_tx(asset_unlock_tx) + self.log.info(f"{txid_in_block} should not be mined") + tip_hash = self.generate(node, 1)[0] + assert txid_in_block not in node.getblock(tip_hash)['tx'] + + if __name__ == '__main__': AssetLocksTest().main()