Skip to content

Commit e961a23

Browse files
committed
Less bad replace logic
1 parent b42166a commit e961a23

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

chia/wallet/wallet_rpc_api.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,10 +1752,14 @@ async def select_coins(
17521752
# don't love this snippet of code
17531753
# but I think action scopes need to accept CoinSelectionConfigs
17541754
# instead of solely TXConfigs in order for this to be less ugly
1755+
autofilled_cs_config = request.autofill(
1756+
constants=self.service.wallet_state_manager.constants,
1757+
)
17551758
tx_config = DEFAULT_TX_CONFIG.override(
1756-
**request.autofill(
1757-
constants=self.service.wallet_state_manager.constants,
1758-
).__dict__
1759+
**{
1760+
field.name: getattr(autofilled_cs_config, field.name)
1761+
for field in dataclasses.fields(autofilled_cs_config)
1762+
}
17591763
)
17601764

17611765
if await self.service.wallet_state_manager.synced() is False:

0 commit comments

Comments
 (0)