mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 16:08:51 +03:00
Switch format for RPC proofs_of_inclusion for DL offers
This commit is contained in:
parent
2f75afb7c0
commit
f22a7e0d7c
@ -1272,10 +1272,9 @@ class DataLayerWallet:
|
||||
asserted_root: Optional[str] = None
|
||||
proofs_of_inclusion = []
|
||||
for value in values:
|
||||
for root in solver["proofs_of_inclusion"].info:
|
||||
proof: Tuple[int, List[bytes32]] = tuple( # type: ignore
|
||||
solver["proofs_of_inclusion"][root]
|
||||
)
|
||||
for proof_of_inclusion in solver["proofs_of_inclusion"]:
|
||||
root = proof_of_inclusion[0]
|
||||
proof = tuple(proof_of_inclusion[1:])
|
||||
if simplify_merkle_proof(value, proof) == bytes32.from_hexstr(root):
|
||||
proofs_of_inclusion.append(proof)
|
||||
if asserted_root is None:
|
||||
|
@ -143,10 +143,10 @@ async def test_dl_offers(wallets_prefarm: Any, trusted: bool) -> None:
|
||||
},
|
||||
],
|
||||
},
|
||||
"proofs_of_inclusion": {
|
||||
maker_root.hex(): [str(maker_proof[0]), ["0x" + sibling.hex() for sibling in maker_proof[1]]],
|
||||
taker_root.hex(): [str(taker_proof[0]), ["0x" + sibling.hex() for sibling in taker_proof[1]]],
|
||||
},
|
||||
"proofs_of_inclusion": [
|
||||
[maker_root.hex(), str(maker_proof[0]), ["0x" + sibling.hex() for sibling in maker_proof[1]]],
|
||||
[taker_root.hex(), str(taker_proof[0]), ["0x" + sibling.hex() for sibling in taker_proof[1]]],
|
||||
],
|
||||
}
|
||||
),
|
||||
fee=uint64(2000000000000),
|
||||
@ -411,10 +411,10 @@ async def test_multiple_dl_offers(wallets_prefarm: Any, trusted: bool) -> None:
|
||||
},
|
||||
],
|
||||
},
|
||||
"proofs_of_inclusion": {
|
||||
maker_root.hex(): [str(maker_proof[0]), ["0x" + sibling.hex() for sibling in maker_proof[1]]],
|
||||
taker_root.hex(): [str(taker_proof[0]), ["0x" + sibling.hex() for sibling in taker_proof[1]]],
|
||||
},
|
||||
"proofs_of_inclusion": [
|
||||
[maker_root.hex(), str(maker_proof[0]), ["0x" + sibling.hex() for sibling in maker_proof[1]]],
|
||||
[taker_root.hex(), str(taker_proof[0]), ["0x" + sibling.hex() for sibling in taker_proof[1]]],
|
||||
],
|
||||
}
|
||||
),
|
||||
fee=uint64(2000000000000),
|
||||
|
Loading…
Reference in New Issue
Block a user