From 274000a09316d8141d6a413e49e39ca80fc3acb6 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 8 Jul 2025 19:25:22 +0300 Subject: [PATCH] feat: implement a fork to double withdrawals limit --- src/evo/creditpool.cpp | 4 +- src/evo/creditpool.h | 1 + test/functional/feature_asset_locks.py | 66 ++++++++++++++++++++++++-- 3 files changed, 67 insertions(+), 4 deletions(-) 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()