Skip to content

Unable to use unsafe.Sizeof() if struct contains a Uint128 #8

@lucasoares

Description

@lucasoares

If a struct contains bin.Uint128 fields, the result of unsafe.Sizeof for the struct will be 16 bytes higher for each bin.Uint128 field it contains... The result of unsafe.Offsetof will also differ based on the location of the struct's fields.

How can we use unsafe helpers when using the Solana SDK to filter requests (subscriptions, etc) when using the Uint128?

It seems this library is not a good option to use when working with Solana programs for now, but how can we make it be? For now I'm using a slice of uint64 with 2 positions to represent uint128 :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions