-select_coins(0) now works
This commit is contained in:
parent
04ba5de65e
commit
cccf6e4226
|
@ -381,7 +381,7 @@ class CCWallet:
|
|||
return None
|
||||
if exclude is None:
|
||||
exclude = []
|
||||
coins = await self.standard_wallet.select_coins(1, exclude)
|
||||
coins = await self.standard_wallet.select_coins(0, exclude)
|
||||
if coins is None:
|
||||
return None
|
||||
|
||||
|
@ -455,7 +455,7 @@ class CCWallet:
|
|||
self.wallet_info.id
|
||||
)
|
||||
for coinrecord in unspent:
|
||||
if sum >= amount:
|
||||
if sum >= amount and len(used_coins) > 0:
|
||||
break
|
||||
if coinrecord.coin.name() in unconfirmed_removals:
|
||||
continue
|
||||
|
@ -706,7 +706,7 @@ class CCWallet:
|
|||
if cc_amount < 0:
|
||||
cc_spends = await self.select_coins(abs(cc_amount))
|
||||
else:
|
||||
cc_spends = await self.select_coins(1)
|
||||
cc_spends = await self.select_coins(0)
|
||||
if cc_spends is None:
|
||||
return None
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ class Wallet:
|
|||
self.wallet_info.id
|
||||
)
|
||||
for coinrecord in unspent:
|
||||
if sum >= amount:
|
||||
if sum >= amount and len(used_coins) > 0:
|
||||
break
|
||||
if coinrecord.coin.name() in unconfirmed_removals:
|
||||
continue
|
||||
|
@ -371,7 +371,7 @@ class Wallet:
|
|||
if chia_amount < 0:
|
||||
utxos = await self.select_coins(abs(chia_amount))
|
||||
else:
|
||||
utxos = await self.select_coins(1)
|
||||
utxos = await self.select_coins(0)
|
||||
|
||||
if utxos is None:
|
||||
return None
|
||||
|
|
|
@ -49,7 +49,7 @@ class TestWalletSimulator:
|
|||
3, 2, {"COINBASE_FREEZE_PERIOD": 0}
|
||||
):
|
||||
yield _
|
||||
"""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_colour_creation(self, two_wallet_nodes):
|
||||
num_blocks = 10
|
||||
|
@ -87,8 +87,7 @@ class TestWalletSimulator:
|
|||
|
||||
assert confirmed_balance == 100
|
||||
assert unconfirmed_balance == 100
|
||||
"""
|
||||
"""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_cc_spend(self, two_wallet_nodes):
|
||||
num_blocks = 10
|
||||
|
@ -170,8 +169,7 @@ class TestWalletSimulator:
|
|||
|
||||
assert confirmed_balance == 55
|
||||
assert unconfirmed_balance == 55
|
||||
"""
|
||||
"""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_wallet_for_colour(self, two_wallet_nodes):
|
||||
num_blocks = 10
|
||||
|
@ -209,8 +207,7 @@ class TestWalletSimulator:
|
|||
await wallet_node.wallet_state_manager.get_wallet_for_colour(colour)
|
||||
== cc_wallet
|
||||
)
|
||||
"""
|
||||
"""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_generate_zero_val(self, two_wallet_nodes):
|
||||
num_blocks = 10
|
||||
|
@ -273,7 +270,6 @@ class TestWalletSimulator:
|
|||
)
|
||||
assert len(unspent) == 1
|
||||
assert unspent.pop().coin.amount == 0
|
||||
"""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_cc_trade(self, two_wallet_nodes):
|
||||
|
@ -307,7 +303,6 @@ class TestWalletSimulator:
|
|||
cc_wallet: CCWallet = await CCWallet.create_new_cc(
|
||||
wallet_node.wallet_state_manager, wallet, uint64(100)
|
||||
)
|
||||
cc_colour = cc_wallet.cc_info.my_colour_name
|
||||
|
||||
for i in range(1, num_blocks):
|
||||
await full_node_1.farm_new_block(FarmNewBlockProtocol(ph))
|
||||
|
@ -356,7 +351,7 @@ class TestWalletSimulator:
|
|||
assert offer is not None
|
||||
|
||||
assert offer["chia"] == -10
|
||||
assert offer[cc_colour] == 30
|
||||
assert offer[colour] == 30
|
||||
|
||||
success = await trade_manager_2.respond_to_offer(file)
|
||||
|
||||
|
|
Loading…
Reference in New Issue