actors_runtime/util/chaos/
state.rs

1// Copyright 2019-2022 ChainSafe Systems
2// SPDX-License-Identifier: Apache-2.0, MIT
3
4use fvm_shared::encoding::tuple::*;
5use fvm_shared::encoding::Cbor;
6
7use crate::util::unmarshallable::UnmarshallableCBOR;
8
9#[derive(Default, Serialize_tuple, Deserialize_tuple)]
10pub struct State {
11    // Value can be updated by chaos actor methods to test illegal state
12    // mutations when the state is in readonly mode for example.
13    pub value: String,
14
15    // Unmarshallable is a sentinel value. If the slice contains no values, the
16    // State struct will encode as CBOR without issue. If the slice is non-nil,
17    // CBOR encoding will fail.
18    pub unmarshallable: Vec<UnmarshallableCBOR>,
19}
20
21impl Cbor for State {}