Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add max supply global state for inflation asset #5

Merged
merged 7 commits into from
Jul 11, 2024
Merged
10 changes: 10 additions & 0 deletions src/rgb20/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,16 @@
.sum()
}

// max_supply for the inflation asset
pub fn max_supply(&self) -> Amount {
self.0
.global("maxSupply")
.expect("RGB20 interface requires global `maxSupply`")
.iter()
.map(Amount::from_strict_val_unchecked)
.sum()
}

Check warning on line 262 in src/rgb20/wrapper.rs

View check run for this annotation

Codecov / codecov/patch

src/rgb20/wrapper.rs#L255-L262

Added lines #L255 - L262 were not covered by tests

pub fn total_burned_supply(&self) -> Amount {
self.0
.global("burnedSupply")
Expand Down
Loading