fixes lint
This commit is contained in:
parent
dedf422a76
commit
ebde6e8467
|
@ -1,7 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# RLWallet is subclass of Wallet
|
# RLWallet is subclass of Wallet
|
||||||
from binascii import hexlify
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import time
|
import time
|
||||||
from secrets import token_bytes
|
from secrets import token_bytes
|
||||||
|
@ -9,7 +8,6 @@ from typing import Optional, List, Tuple, Any
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from blspy import PrivateKey, AugSchemeMPL, G1Element
|
from blspy import PrivateKey, AugSchemeMPL, G1Element
|
||||||
from src.util.clvm import run_program
|
|
||||||
from clvm_tools import binutils
|
from clvm_tools import binutils
|
||||||
from src.types.coin import Coin
|
from src.types.coin import Coin
|
||||||
from src.types.coin_solution import CoinSolution
|
from src.types.coin_solution import CoinSolution
|
||||||
|
@ -342,10 +340,7 @@ class RLWallet(AbstractWallet):
|
||||||
height = lca.height
|
height = lca.height
|
||||||
assert self.rl_info.limit is not None
|
assert self.rl_info.limit is not None
|
||||||
unlocked = int(
|
unlocked = int(
|
||||||
(
|
((height - self.rl_coin_record.confirmed_block_index) / self.rl_info.interval)
|
||||||
(height - self.rl_coin_record.confirmed_block_index)
|
|
||||||
/ self.rl_info.interval
|
|
||||||
)
|
|
||||||
* int(self.rl_info.limit)
|
* int(self.rl_info.limit)
|
||||||
)
|
)
|
||||||
total_amount = self.rl_coin_record.coin.amount
|
total_amount = self.rl_coin_record.coin.amount
|
||||||
|
|
|
@ -49,7 +49,6 @@ class TestRLWallet:
|
||||||
await full_node.farm_new_block(FarmNewBlockProtocol(ph))
|
await full_node.farm_new_block(FarmNewBlockProtocol(ph))
|
||||||
for i in range(0, num_blocks + 1):
|
for i in range(0, num_blocks + 1):
|
||||||
await full_node.farm_new_block(FarmNewBlockProtocol(32 * b"\0"))
|
await full_node.farm_new_block(FarmNewBlockProtocol(32 * b"\0"))
|
||||||
fund_owners_initial_balance = await wallet.get_confirmed_balance()
|
|
||||||
|
|
||||||
api_user = WalletRpcApi(wallet_node_1)
|
api_user = WalletRpcApi(wallet_node_1)
|
||||||
val = await api_user.create_new_wallet(
|
val = await api_user.create_new_wallet(
|
||||||
|
@ -143,13 +142,11 @@ class TestRLWallet:
|
||||||
await full_node.farm_new_block(FarmNewBlockProtocol(32 * b"\0"))
|
await full_node.farm_new_block(FarmNewBlockProtocol(32 * b"\0"))
|
||||||
await time_out_assert(15, check_balance, 97, api_user, user_wallet_id)
|
await time_out_assert(15, check_balance, 97, api_user, user_wallet_id)
|
||||||
await time_out_assert(15, receiving_wallet.get_spendable_balance, 3)
|
await time_out_assert(15, receiving_wallet.get_spendable_balance, 3)
|
||||||
utxo = [c for c in await full_node.coin_store.get_unspent_coin_records() if not c.coinbase]
|
|
||||||
val = await api_admin.add_rate_limited_funds({"wallet_id": admin_wallet_id, "amount": 100})
|
val = await api_admin.add_rate_limited_funds({"wallet_id": admin_wallet_id, "amount": 100})
|
||||||
assert val["status"] == "SUCCESS"
|
assert val["status"] == "SUCCESS"
|
||||||
for i in range(0, 50):
|
for i in range(0, 50):
|
||||||
await full_node.farm_new_block(FarmNewBlockProtocol(32 * b"\0"))
|
await full_node.farm_new_block(FarmNewBlockProtocol(32 * b"\0"))
|
||||||
await time_out_assert(15, check_balance, 197, api_user, user_wallet_id)
|
await time_out_assert(15, check_balance, 197, api_user, user_wallet_id)
|
||||||
utxo_2 = [c for c in await full_node.coin_store.get_unspent_coin_records() if not c.coinbase]
|
|
||||||
|
|
||||||
# test spending
|
# test spending
|
||||||
val = await api_user.send_transaction(
|
val = await api_user.send_transaction(
|
||||||
|
|
Loading…
Reference in New Issue