Open
Description
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);
}