Skip to content

Is it possible to append some data directly onto the state? #38

Open
@levackt

Description

@levackt

forum post

In the tutorial example, when adding a new address to MILLIONAIRES, get all the millionaires, append the new one to them, and override the current state. I think in the case that the data is large, it seems memory consuming.
The best would be to be able to append directly to the state, rather than overriding the entire state.
Does enigma protocol provide such a functionality? Or is it technically implausible?

fn add_millionaire(address: H160, net_worth: U256) {
let mut millionaires = Self::get_millionaires();
millionaires.push(Millionaire {
address,
net_worth,
});
write_state!(MILLIONAIRES => millionaires);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions