Skip to content

bug: .get() returns blockchain state instead of latest sate on internal call #1999

@laciferin2024

Description

@laciferin2024

Code

Code fails at https://github.com/laciferin2024/lottery.multiversex/blob/debug/participants-state-draw-winner/src/lottery.rs#L123 due to index error.

My Analysis

The state is not committed to the shard. But participants.len() is updated cuz the code enters the loop. The code fails with commented code iteration via .iter() as well.

Run at your end

just deploy
just i place_bet 1

Trace:

https://devnet-explorer.multiversx.com/transactions/c9f72471daf6f92e1d46a30ab84918609d54ccab999911fbf028ffe93d01724b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions