pub fn update(input: UpdateInput) -> ExternResult<ActionHash>
Expand description
General function that can update any entry type.
This is used under the hood by update_entry
, update_cap_grant
and update_cap_claim
.
@todo implement update_cap_claim
The host builds an Update
action for the passed entry value and commits a new update to the
chain.
Usually you don’t need to use this function directly; it is the most general way to update an entry and standardizes the internals of higher level update functions.
Examples found in repository?
More examples
src/entry.rs (line 170)
160 161 162 163 164 165 166 167 168 169 170 171
pub fn update_entry<I, E>(hash: ActionHash, input: I) -> ExternResult<ActionHash>
where
Entry: TryFrom<I, Error = E>,
WasmError: From<E>,
{
let input = UpdateInput {
original_action_address: hash,
entry: input.try_into()?,
chain_top_ordering: ChainTopOrdering::default(),
};
update(input)
}