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

Conversation

cymqqqq
Copy link
Contributor

@cymqqqq cymqqqq commented Jul 2, 2024

Description:

In rgb20 Inflation asset iface, there are issuedSupply and maxSupply in the global state, here I try to add the maxSupply method for the rgb-interface.

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

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

Max supply can be absent - depending on specific RGB20 interface used. For instance, it is absent for non-inflatible assets. Thus, this method should default to the issued supply value if the max supply is not found

@dr-orlovsky dr-orlovsky added the enhancement New feature or request label Jul 2, 2024
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@baafff6). Learn more about missing BASE report.

Files Patch % Lines
src/rgb20/wrapper.rs 0.0% 12 Missing ⚠️
src/rgb20/issuer.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             master      #5   +/-   ##
========================================
  Coverage          ?   39.9%           
========================================
  Files             ?      17           
  Lines             ?    1887           
  Branches          ?       0           
========================================
  Hits              ?     753           
  Misses            ?    1134           
  Partials          ?       0           
Flag Coverage Δ
rust 39.9% <0.0%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

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

one last small thing and I can merge this

Comment on lines 259 to 260
.unwrap_or(
self.0
Copy link
Member

Choose a reason for hiding this comment

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

We need this not to do an unnecessary secondary call to global if we have maxSupply in place

Suggested change
.unwrap_or(
self.0
.unwrap_or_else(|| self.0

@dr-orlovsky dr-orlovsky merged commit 05166e9 into RGB-WG:master Jul 11, 2024
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants