Skip to content

feat: get issuance from the store#96

Open
TomasArrachea wants to merge 10 commits intonextfrom
tomasarrachea-retrieve-issuance
Open

feat: get issuance from the store#96
TomasArrachea wants to merge 10 commits intonextfrom
tomasarrachea-retrieve-issuance

Conversation

@TomasArrachea
Copy link
Collaborator

Addresses #44.

@TomasArrachea TomasArrachea force-pushed the tomasarrachea-retrieve-issuance branch from 167d588 to e32af36 Compare September 19, 2025 22:04
@TomasArrachea TomasArrachea marked this pull request as ready for review September 19, 2025 22:05
@TomasArrachea TomasArrachea added the no changelog This PR does not require an entry in the `CHANGELOG.md` label Sep 19, 2025
@TomasArrachea TomasArrachea marked this pull request as draft September 22, 2025 23:07
@TomasArrachea TomasArrachea linked an issue Dec 11, 2025 that may be closed by this pull request
Comment on lines +492 to +498
let faucet_sysdata = self
.client
.new_storage_reader(self.id.account_id)
.get_item(AccountStorage::faucet_sysdata_slot().clone())
.await
.context("failed to get faucet sysdata slot")?;
let issuance_felt = faucet_sysdata[Account::ISSUANCE_ELEMENT_INDEX];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be improved once this issue is tackled in miden-base

@TomasArrachea TomasArrachea marked this pull request as ready for review February 2, 2026 20:18
Comment on lines 505 to 507
pub fn issuance(&self) -> &Arc<RwLock<AssetAmount>> {
&self.issuance
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: why do we need both issuance() and get_issuance()? Isn't the value in the store also updated after every transactions? Or can these diverge somehow?

Copy link
Collaborator Author

@TomasArrachea TomasArrachea Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The faucet keeps the issuance cached in-memory to expose it in the metadata endpoint. This way we avoid having to query the store on each request, and update it's value after each minting. The methods naming was a bit confusing though, refactored the API slightly in efd23da.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably get replaced by #224 anyway

@TomasArrachea TomasArrachea force-pushed the tomasarrachea-retrieve-issuance branch 2 times, most recently from 9f31dd4 to efd23da Compare February 11, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer no changelog This PR does not require an entry in the `CHANGELOG.md`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-up on supply tracking

3 participants