This commit is contained in:
Yostra 2020-04-28 14:03:21 -07:00
parent 9fff0eb26d
commit adb5708619
2 changed files with 5 additions and 5 deletions

View File

@ -193,10 +193,10 @@ class TradeManager:
return True
async def respond_to_offer(self, file_path: Path) -> bool:
async def respond_to_offer(self, file_path: Path) -> Tuple[bool, Optional[str]]:
has_wallets = await self.maybe_create_wallets_for_offer(file_path)
if not has_wallets:
return False
return False, "Unknown Error"
trade_offer_hex = file_path.read_text()
trade_offer = SpendBundle.from_bytes(bytes.fromhex(trade_offer_hex))

View File

@ -337,7 +337,7 @@ class TestWalletSimulator:
assert offer["chia"] == -10
assert offer[colour] == 30
success = await trade_manager_2.respond_to_offer(file_path)
success, reason = await trade_manager_2.respond_to_offer(file_path)
assert success is True
@ -520,7 +520,7 @@ class TestWalletSimulator:
assert offer[red] == 30
assert offer[blue] == -50
success = await trade_manager_2.respond_to_offer(file_path)
success, reason = await trade_manager_2.respond_to_offer(file_path)
assert success is True
for i in range(0, num_blocks):
@ -617,7 +617,7 @@ class TestWalletSimulator:
assert offer["chia"] == 10
assert offer[colour] == -30
success = await trade_manager_1.respond_to_offer(file_path)
success, reason = await trade_manager_1.respond_to_offer(file_path)
assert success is True