Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified database frontend #1661

Merged
merged 8 commits into from
Jul 31, 2023
Prev Previous commit
Next Next commit
Support compiler exception warnings for CoreDbRef base methods.
  • Loading branch information
mjfh committed Jul 31, 2023
commit 435ec57b057e866ce47a14b167530d8e05809808
15 changes: 15 additions & 0 deletions nimbus/db/core_db/base.nim
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ proc init*(db: CoreDbCaptRef; parent: CoreDbRef; flags: set[CoreDbCaptFlags]) =
# ------------------------------------------------------------------------------

proc dbType*(db: CoreDbRef): CoreDbType =
db.kvt.dbType

proc dbType*(db: CoreDbKvtRef): CoreDbType =
db.dbType

proc kvt*(db: CoreDbRef): CoreDbKvtRef =
Expand Down Expand Up @@ -231,6 +234,8 @@ method mptPrune*(

# -----

{.push hint[XCannotRaiseY]: off.}

method get*(
db: CoreDbMptRef;
key: openArray[byte];
Expand Down Expand Up @@ -265,6 +270,8 @@ method contains*(
{.base, raises: [RlpError].} =
db.parent.notImplemented "contains/mpt"

{.pop.}

method rootHash*(
db: CoreDbMptRef;
): Hash256
Expand Down Expand Up @@ -330,6 +337,8 @@ method phkPrune*(

# -----------

{.push hint[XCannotRaiseY]: off.}

method get*(
db: CoreDbPhkRef;
key: openArray[byte];
Expand Down Expand Up @@ -364,6 +373,8 @@ method contains*(
{.base, raises: [RlpError].} =
db.parent.notImplemented "contains/phk"

{.pop.}

method rootHash*(
db: CoreDbPhkRef;
): Hash256
Expand Down Expand Up @@ -395,13 +406,17 @@ method dispose*(t: CoreDbTxRef) {.base.} =
method safeDispose*(t: CoreDbTxRef) {.base.} =
t.parent.notImplemented "safeDispose"

{.push hint[XCannotRaiseY]: off.}

method shortTimeReadOnly*(
db: CoreDbRef;
id: CoreDbTxID;
action: proc() {.gcsafe, raises: [CatchableError].};
) {.base, raises: [CatchableError].} =
db.notImplemented "shortTimeReadOnly"

{.pop.}

# ------------------------------------------------------------------------------
# End
# ------------------------------------------------------------------------------