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

ifaces: use correct fungible builder type #112

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

TheWaWaR
Copy link
Contributor

@TheWaWaR TheWaWaR commented Dec 12, 2023

Since Terminal.seals is a SmallXxx collection, so the seal quantity may reach up to 65535, then the corresponding builder should allow seal quantity up to 65535.

pub struct Terminal {
    pub seals: SmallOrdSet<TerminalSeal>,
    pub tx: Option<Tx>,
}

It's not a protocol change, if you wish I can port this fix to v0.10 branch.

@dr-orlovsky
Copy link
Member

You are right that we should allow up to 2^16 assignments in the operation builder, but this is not related to terminal seals, and is instead related to the number of assignments inside the genesis/state transition, which is 2^16.

Terminal seals can be collected from multiple state transition, thus limit there is unrelated to this one.

Anyway, thank you for spotting that. Can you please also update data, rights and attach in the same way?

Thank you for finding this!

@dr-orlovsky dr-orlovsky added the bug Something isn't working label Dec 15, 2023
@dr-orlovsky dr-orlovsky self-assigned this Dec 15, 2023
@TheWaWaR
Copy link
Contributor Author

I can only find rights(commented)/fungible/data, but not attach.

pub struct OperationBuilder<Seal: ExposedSeal> {
    // TODO: use references instead of owned values
    schema: SubSchema,
    iface: Iface,
    iimpl: IfaceImpl,
    asset_tags: TinyOrdMap<AssignmentType, AssetTag>,

    global: GlobalState,
    // rights: TinyOrdMap<AssignmentType, Confined<HashSet<BuilderSeal<Seal>>, 1, U8>>,
    fungible:
        TinyOrdMap<AssignmentType, Confined<HashMap<BuilderSeal<Seal>, RevealedValue>, 1, U8>>,
    data: TinyOrdMap<AssignmentType, Confined<HashMap<BuilderSeal<Seal>, RevealedData>, 1, U8>>,
    // TODO: add attachments
    // TODO: add valencies
}

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.

ACK d428466

Thank you!

@dr-orlovsky dr-orlovsky merged commit f560515 into RGB-WG:master Dec 16, 2023
1 of 19 checks passed
@dr-orlovsky dr-orlovsky added this to the v0.11.0 milestone Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants