Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
test on peaq-network-node 1208684949341989_merge_back
  • Loading branch information
jaypan committed Nov 10, 2024
1 parent 44a40b9 commit 3f0947f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
16 changes: 1 addition & 15 deletions tests/existential_deposits_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from substrateinterface import SubstrateInterface, Keypair
from tools.utils import get_existential_deposit
from tools.constants import WS_URL
from peaq.extrinsic import transfer


@pytest.mark.substrate
Expand All @@ -19,17 +18,4 @@ def setUp(self):

def test_local_token(self):
token = self.get_existential_deposit()
self.assertGreater(token, 2)
token /= 2

# Execute -> Send local token to another account but below the Exitential Deposits
receipt = transfer(
self.substrate,
self.alice,
self.kp.ss58_address,
token,
1
)

# Check: the error happens
self.assertFalse(receipt.is_success)
self.assertEqual(token, 0)
4 changes: 2 additions & 2 deletions tools/monkey/monkey_3rd_substrate_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def monkey_submit_extrinsic(self, extrinsic: GenericExtrinsic, wait_for_inclusio
included_block = None
tx_identifier = None
for i in range(5):
if now_block_num - i < 1 or tx_identifier:
break
print(f'Checking block {now_block_num - i}')
block_hash = self.get_block_hash(now_block_num - i)
block = self.get_block(block_hash)
Expand All @@ -43,8 +45,6 @@ def monkey_submit_extrinsic(self, extrinsic: GenericExtrinsic, wait_for_inclusio
print(f'Extrinsic {result.extrinsic_hash} is included in block {included_block}')
tx_identifier = f'{included_block}-{index}'
break
if tx_identifier:
break
if not tx_identifier:
raise SubstrateRequestException(
f'Extrinsic {result.extrinsic_hash} is not included in the block after 3 blocks, invalid')
Expand Down

0 comments on commit 3f0947f

Please sign in to comment.