From bff760cdf76054e973671865ac37a01770383aa2 Mon Sep 17 00:00:00 2001 From: Peilun Li Date: Mon, 5 Aug 2024 19:54:12 +0800 Subject: [PATCH] Fix tests. --- tests/shard_sync_test.py | 3 ++- tests/utility/simple_rpc_proxy.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/shard_sync_test.py b/tests/shard_sync_test.py index 6c1c468..bab9e8c 100755 --- a/tests/shard_sync_test.py +++ b/tests/shard_sync_test.py @@ -2,6 +2,7 @@ import time from test_framework.test_framework import TestFramework +from mine_with_market_test import PRICE_PER_SECTOR from utility.submission import create_submission, submit_data, data_to_segments from utility.utils import wait_until, assert_equal @@ -30,7 +31,7 @@ class PrunerTest(TestFramework): chunk_data = b"\x02" * 8 * 256 * 1024 submissions, data_root = create_submission(chunk_data) - self.contract.submit(submissions) + self.contract.submit(submissions, tx_prarams = {"value": int(len(chunk_data) / 256 * PRICE_PER_SECTOR * 1.1)}) wait_until(lambda: self.contract.num_submissions() == 1) wait_until(lambda: client.zgs_get_file_info(data_root) is not None) diff --git a/tests/utility/simple_rpc_proxy.py b/tests/utility/simple_rpc_proxy.py index 4694330..5b0628b 100644 --- a/tests/utility/simple_rpc_proxy.py +++ b/tests/utility/simple_rpc_proxy.py @@ -25,7 +25,7 @@ class RpcCaller: if isinstance(parsed, Ok): return parsed.result else: - print("Failed to call RPC, method = %s(%s), error = %s" % (self.method, str(*args), parsed)) + print("Failed to call RPC, method = %s(%s), error = %s" % (self.method, str(*args)[-1500:], parsed)) except Exception as ex: - print("Failed to call RPC, method = %s(%s), exception = %s" % (self.method, str(*args), ex)) + print("Failed to call RPC, method = %s(%s), exception = %s" % (self.method, str(*args)[-1500:], ex)) return None