Skip to content

Implement DatabaseRef for State #2566

@cakevm

Description

@cakevm

I would suggest to have both traits (Database and DatabaseRef) implemented for State.

Currently State implements the Database trait, but not DatabaseRef. In case where e.g. an account is only read it seems more reasonable to just use the reference. This allows to reuse functions for the State that only accept DatabaseRef.

For State here:

#[derive(Debug)]
pub struct State<DB> {

Implement the equivalent of Database for DatabaseRef:

impl<DB: Database> Database for State<DB> {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions