Skip to content

Commit 4ad8725

Browse files
authored
fix: use network account target attachment (#2352)
1 parent 8e3e8da commit 4ad8725

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 0.13.3 (2026-01-27)
44

5+
- Fixed `CLAIM` note creation to use `NetworkAccountTarget` attachment ([#2352](https://github.com/0xMiden/miden-base/pull/2352)).
56
- Added standards for working with `NetworkAccountTarget` attachments ([#2338](https://github.com/0xMiden/miden-base/pull/2338)).
67
- Fixed `PartialBlockchain::add_block()` not adding block headers to the `blocks` map when `track=true`, which caused `prune_to()` to never untrack old blocks, leading to unbounded memory growth ([#2353](https://github.com/0xMiden/miden-base/pull/2353)).
78

crates/miden-agglayer/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
extern crate alloc;
44

5+
use alloc::string::ToString;
56
use alloc::vec;
67
use alloc::vec::Vec;
78

@@ -24,6 +25,7 @@ use miden_protocol::errors::NoteError;
2425
use miden_protocol::note::{
2526
Note,
2627
NoteAssets,
28+
NoteExecutionHint,
2729
NoteInputs,
2830
NoteMetadata,
2931
NoteRecipient,
@@ -33,6 +35,7 @@ use miden_protocol::note::{
3335
};
3436
use miden_standards::account::auth::NoAuth;
3537
use miden_standards::account::faucets::NetworkFungibleFaucet;
38+
use miden_standards::note::NetworkAccountTarget;
3639
use miden_utils_sync::LazyLock;
3740

3841
pub mod errors;
@@ -474,8 +477,13 @@ pub fn create_claim_note<R: FeltRng>(params: ClaimNoteParams<'_, R>) -> Result<N
474477

475478
let note_type = NoteType::Public;
476479

480+
let attachment =
481+
NetworkAccountTarget::new(params.agglayer_faucet_account_id, NoteExecutionHint::Always)
482+
.map_err(|e| NoteError::other(e.to_string()))?
483+
.into();
477484
// Use a default sender since we don't have sender anymore - create from destination address
478-
let metadata = NoteMetadata::new(params.claim_note_creator_account_id, note_type, tag);
485+
let metadata = NoteMetadata::new(params.claim_note_creator_account_id, note_type, tag)
486+
.with_attachment(attachment);
479487
let assets = NoteAssets::new(vec![])?;
480488
let recipient = NoteRecipient::new(serial_num, claim_script, inputs);
481489

0 commit comments

Comments
 (0)