Skip to content

Commit 7916107

Browse files
committed
fix cache tx err
1 parent 010cc13 commit 7916107

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

test_cases/feature/test_test_tx_pool_accept.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,34 @@ def test_TransactionFailedToResolve(self):
218218
fee=1000000 - i * 1000,
219219
api_url=self.node.getClient().url)
220220
response = self.node.getClient().test_tx_pool_accept(tx, "passthrough")
221-
expected_error_message = "TransactionFailedToResolve"
222-
assert expected_error_message in exc_info.value.args[0], \
223-
f"Expected substring '{expected_error_message}' not found in actual string '{exc_info.value.args[0]}'"
224-
with pytest.raises(Exception) as exc_info:
225-
self.node.getClient().send_transaction(tx)
221+
expected_error_message = "TransactionFailedToResolve"
222+
assert expected_error_message in exc_info.value.args[0], \
223+
f"Expected substring '{expected_error_message}' not found in actual string '{exc_info.value.args[0]}'"
224+
with pytest.raises(Exception) as exc_info:
225+
self.node.getClient().send_transaction(tx)
226+
227+
def test_change_cache_tx(self):
228+
account = self.Ckb_cli.util_key_info_by_private_key(self.Config.ACCOUNT_PRIVATE_1)
229+
father_tx_hash = self.Ckb_cli.wallet_transfer_by_private_key(self.Config.ACCOUNT_PRIVATE_1,
230+
account["address"]["testnet"], 100000,
231+
self.node.getClient().url, "1500000")
232+
233+
tx = self.Tx.build_send_transfer_self_tx_with_input([father_tx_hash], ['0x0'], self.Config.ACCOUNT_PRIVATE_1,
234+
output_count=15,
235+
fee=15000,
236+
api_url=self.node.getClient().url)
237+
tx_hash = self.node.getClient().send_transaction(tx)
238+
self.node.getClient().remove_transaction(tx_hash)
239+
tx['witnesses'][0] = "0x00"
240+
with pytest.raises(Exception) as exc_info:
241+
tx_hash = self.node.getClient().send_transaction(tx)
242+
expected_error_message = "ValidationFailure"
243+
assert expected_error_message in exc_info.value.args[0], \
244+
f"Expected substring '{expected_error_message}' not found in actual string '{exc_info.value.args[0]}'"
245+
with pytest.raises(Exception) as exc_info:
246+
tx_hash = self.node.getClient().test_tx_pool_accept(tx,"passthrough")
247+
expected_error_message = "ValidationFailure"
248+
assert expected_error_message in exc_info.value.args[0], \
249+
f"Expected substring '{expected_error_message}' not found in actual string '{exc_info.value.args[0]}'"
250+
251+

0 commit comments

Comments
 (0)