Solidbyte Session Store

Very simple module we can use to store session-level data. This saves certain things from having to be passed through dozens of functions or objects.

This is not fully implemented project wide yet. Currently experimental.

class solidbyte.common.store.Keys[source]

Enum defining storage keys

DECRYPT_PASSPHRASE = 'decrypt'

The account decrypt passphrase that should be session-wide.

KEYSTORE_DIR = 'keystore'

The directory with the Ethereum secret store files

NETWORK_NAME = 'network_name'

The name of the network being used as defined in networks.yml

PROJECT_DIR = 'project_dir'

The project directory. Probably pwd.

solidbyte.common.store.defined(key: solidbyte.common.store.Keys) → bool[source]

Check if the key is defined and in STORAGE

Parameters:key – (Keys) The key to look for
Returns:(bool) If the key is defined in storage
solidbyte.common.store.get(key: solidbyte.common.store.Keys) → Optional[Any][source]

Get the value stored for the key

Parameters:key – (Keys) The key of the value to return
Returns:(Any) The value of the key
solidbyte.common.store.set(key: solidbyte.common.store.Keys, val: Any) → Optional[Any][source]

Set the value of the key and return the new value

Parameters:
  • key – (Keys) The key of the value to return
  • val – (Any) The value to set
Returns:

(Any) The value of the key