RGB-WG / rgb-std

RGB standard libs for WASM & low-level integrations (no FS/networking)

Home Page:https://rgb.tech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create interfaces to allow external access to the values inside the Allocation.

EthanShang8989 opened this issue · comments

I am filtering Allocation inside rgb21 from inside contractIface.data.state. tried to extract the data inside but found it to be private.
Suggest to expose the interface.
pub struct Allocation(TokenIndex, OwnedFraction);

impl Allocation {
    pub fn with(index: TokenIndex, fraction: OwnedFraction) -> Allocation {
        Allocation(index, fraction)
    }
    pub fn token_id(self) -> TokenIndex { self.0 }
    pub fn fraction(self) -> OwnedFraction { self.1 }
}

Done in #127

Closing since the fixing PR is already merged