0xMiden / 0xMiden/clob-example

Payback note recipient is built with SWAPP.masm instead of P2ID.masm

Đang mở
#5 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
3
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Summary

`build_p2id_recipient()` is intended to build the recipient for the payback P2ID note created after a SWAPP note is consumed, but it currently loads `scripts/SWAPP.masm` instead of `scripts/P2ID.masm`.

### Why this matters

The resulting payback note recipient digest commits to the SWAPP script root while the note inputs are shaped like a P2ID note. That makes the payback note inconsistent: consuming it as a normal P2ID note will not match the committed script root, while consuming it with SWAPP logic expects the SWAPP input shape.

This affects the core CLOB example flow because the payback note is how proceeds are returned to the matched counterparty.

### Code path

`backend/order-book/src/note/mod.rs`:

```rust
fn build_p2id_recipient(target: AccountId, serial_num: Word) -> Result {
let assembler = TransactionKernel::assembler();
let note_code = include_str!("scripts/SWAPP.masm");
...
}
```

The same directory already contains `scripts/P2ID.masm`, which matches the one-input P2ID recipient built by this helper.

### Expected behavior

`build_p2id_recipient()` should load `scripts/P2ID.masm` so the payback note recipient digest commits to the P2ID script that can consume the payback note.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.