local resource state without a hash

Motivation

As a Hash Core developer, I need to enable resource developers to save some data directly in the state of a resource without specifying the hash for it, this will enable them to get an overview of current state without needing to know what was the value for the hash before.

Current state

There is no way for a resource developer to see the current state of a resource if the hash changed, it doesn't know what the previous value for the hash was.

Desired state

A resource developer can ask Hash Core to store some state for a resource that is independent from the hash and he can later query it and act upon it.

Steps

  • Add a new key to the state called local and make sure to fix tests for State class after adding it.
  • Enable resource developer to use the local key in the action's return dictionary to specify what to put in this local state.
  • Fill this local state with some data from hash core, e.g. what is the hash of the last time an action was called. etc...
  • Add tests for this functionality.