mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 16:08:51 +03:00
include wallet maker offer rpc call in transaction rollback region
This commit is contained in:
parent
e3db1b877c
commit
7844b6eee1
@ -663,34 +663,34 @@ class DataLayer:
|
||||
for our_offer_store in maker
|
||||
}
|
||||
|
||||
# Excluding wallet from transaction since failures in the wallet may occur
|
||||
# after the transaction is submitted to the chain. If we roll back data we
|
||||
# may lose published data.
|
||||
# Excluding wallet from transaction since failures in the wallet may occur
|
||||
# after the transaction is submitted to the chain. If we roll back data we
|
||||
# may lose published data.
|
||||
|
||||
wallet_offer, trade_record = await self.wallet_rpc.create_offer_for_ids(
|
||||
offer_dict=offer_dict,
|
||||
solver=solver,
|
||||
driver_dict={},
|
||||
fee=fee,
|
||||
validate_only=False,
|
||||
)
|
||||
if wallet_offer is None:
|
||||
raise Exception("offer is None despite validate_only=False")
|
||||
wallet_offer, trade_record = await self.wallet_rpc.create_offer_for_ids(
|
||||
offer_dict=offer_dict,
|
||||
solver=solver,
|
||||
driver_dict={},
|
||||
fee=fee,
|
||||
validate_only=False,
|
||||
)
|
||||
if wallet_offer is None:
|
||||
raise Exception("offer is None despite validate_only=False")
|
||||
|
||||
offer = Offer(
|
||||
trade_id=trade_record.trade_id,
|
||||
offer=bytes(wallet_offer),
|
||||
taker=taker,
|
||||
maker=tuple(our_store_proofs.values()),
|
||||
)
|
||||
offer = Offer(
|
||||
trade_id=trade_record.trade_id,
|
||||
offer=bytes(wallet_offer),
|
||||
taker=taker,
|
||||
maker=tuple(our_store_proofs.values()),
|
||||
)
|
||||
|
||||
# being extra careful and verifying the offer before returning it
|
||||
trading_offer = TradingOffer.from_bytes(offer.offer)
|
||||
summary = await DataLayerWallet.get_offer_summary(offer=trading_offer)
|
||||
# being extra careful and verifying the offer before returning it
|
||||
trading_offer = TradingOffer.from_bytes(offer.offer)
|
||||
summary = await DataLayerWallet.get_offer_summary(offer=trading_offer)
|
||||
|
||||
verify_offer(maker=offer.maker, taker=offer.taker, summary=summary)
|
||||
verify_offer(maker=offer.maker, taker=offer.taker, summary=summary)
|
||||
|
||||
return offer
|
||||
return offer
|
||||
|
||||
async def take_offer(
|
||||
self,
|
||||
|
Loading…
Reference in New Issue
Block a user