IconScoreDatabase

class IconScoreDatabase(address: Address, context_db: ContextDatabase, prefix: bytes = None)

It is used in IconScore

IconScore can access its states only through IconScoreDatabase

delete(key: bytes)

Deletes the key/value pair for the specified key.

Parameters:key – key to delete
get(key: bytes) → bytes

Gets the value for the specified key

Parameters:key – key to retrieve
Returns:value for the specified key, or None if not found
get_sub_db(prefix: bytes) → iconservice.database.db.IconScoreDatabase

Returns sub db with a prefix

Parameters:prefix – The prefix used by this sub db.
Returns:sub db
put(key: bytes, value: bytes)

Sets a value for the specified key.

Parameters:
  • key – key to set
  • value – value to set