Skip to content

Commit

Permalink
Fix farmer rewards checks and add observer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emlowe committed Apr 21, 2022
1 parent a376d99 commit 9991dc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions chia/farmer/farmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ async def update_pool_farmer_info() -> Tuple[Optional[GetFarmerResponse], Option
farmer_info, error_code = await update_pool_farmer_info()
if error_code == PoolErrorCode.FARMER_NOT_KNOWN:
# Make the farmer known on the pool with a POST /farmer
owner_sk_and_index: Optional[Tuple[PrivateKey, uint32]] = find_owner_sk(
owner_sk_and_index: Optional[Tuple[G1Element, uint32]] = find_owner_sk(
self.all_root_sks, pool_config.owner_public_key
)
assert owner_sk_and_index is not None
Expand All @@ -526,7 +526,7 @@ async def update_pool_farmer_info() -> Tuple[Optional[GetFarmerResponse], Option
and pool_config.payout_instructions.lower() != farmer_info.payout_instructions.lower()
)
if payout_instructions_update_required or error_code == PoolErrorCode.INVALID_SIGNATURE:
owner_sk_and_index: Optional[Tuple[PrivateKey, uint32]] = find_owner_sk(
owner_sk_and_index: Optional[Tuple[G1Element, uint32]] = find_owner_sk(
self.all_root_sks, pool_config.owner_public_key
)
assert owner_sk_and_index is not None
Expand Down
12 changes: 6 additions & 6 deletions chia/rpc/wallet_rpc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import dataclasses
import logging
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple, Set, Any
from typing import Any, Callable, Dict, List, Optional, Set, Tuple

from blspy import PrivateKey, G1Element
from blspy import G1Element, PrivateKey

from chia.consensus.block_rewards import calculate_base_farmer_reward
from chia.pools.pool_wallet import PoolWallet
from chia.pools.pool_wallet_info import create_pool_state, FARMING_TO_POOL, PoolWalletInfo, PoolState
from chia.pools.pool_wallet_info import FARMING_TO_POOL, PoolState, PoolWalletInfo, create_pool_state
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.server.outbound_message import NodeType, make_msg
from chia.simulator.simulator_protocol import FarmNewBlockProtocol
Expand All @@ -18,7 +18,8 @@
from chia.types.spend_bundle import SpendBundle
from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash
from chia.util.byte_types import hexstr_to_bytes
from chia.util.ints import uint32, uint64, uint8
from chia.util.config import load_config
from chia.util.ints import uint8, uint32, uint64
from chia.util.keychain import KeyringIsLocked, bytes_to_mnemonic, generate_mnemonic
from chia.util.path import path_from_root
from chia.util.ws_message import WsRpcMessage, create_payload_dict
Expand All @@ -31,16 +32,15 @@
master_sk_to_singleton_owner_sk,
match_address_to_sk,
)
from chia.wallet.rl_wallet.rl_wallet import RLWallet
from chia.wallet.did_wallet.did_wallet import DIDWallet
from chia.wallet.rl_wallet.rl_wallet import RLWallet
from chia.wallet.trade_record import TradeRecord
from chia.wallet.trading.offer import Offer
from chia.wallet.transaction_record import TransactionRecord
from chia.wallet.util.transaction_type import TransactionType
from chia.wallet.util.wallet_types import AmountWithPuzzlehash, WalletType
from chia.wallet.wallet_info import WalletInfo
from chia.wallet.wallet_node import WalletNode
from chia.util.config import load_config

# Timeout for response from wallet/full node for sending a transaction
TIMEOUT = 30
Expand Down

0 comments on commit 9991dc2

Please sign in to comment.