NewPluginStateManager
Creates a PluginStateManager initialized with the previous round's state.
def NewPluginStateManager(
prevState: []byte,
prevVersion: uint8
) - > *PluginStateManager
Creates a PluginStateManager initialized with the previous round's state. This function is used to restore the state of a plugin from a previous execution, allowing for continuity between rounds.
Parameters
| Name | Type | Description |
|---|---|---|
| prevState | []byte | The byte slice representing the serialized state from the previous round. This data is used to rehydrate the plugin's state. |
| prevVersion | uint8 | The version of the previous state. This allows for handling different state formats or migrations if the state structure changes over time. |
Returns
| Type | Description |
|---|---|
*PluginStateManager | A pointer to a new PluginStateManager instance, initialized with the provided previous state and version. |