-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new implementation of datalog pallet
- Loading branch information
Showing
6 changed files
with
275 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "pallet-robonomics-datalog" | ||
description = "Robonomics Network data logging Substrate runtime module" | ||
version = "0.2.0" | ||
version = "0.3.0" | ||
authors = ["Airalab <[email protected]>"] | ||
edition = "2018" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight}; | ||
|
||
pub trait WeightInfo { | ||
fn record() -> Weight; | ||
fn erase(win: u64) -> Weight; | ||
} | ||
|
||
impl WeightInfo for () { | ||
fn record() -> Weight { | ||
(500_000 as Weight) | ||
.saturating_add(DbWeight::get().reads(2 as Weight)) | ||
.saturating_add(DbWeight::get().writes(3 as Weight)) | ||
} | ||
|
||
fn erase(win: u64) -> Weight { | ||
(100_000 as Weight) | ||
.saturating_add(DbWeight::get().reads(1 as Weight)) | ||
.saturating_add(DbWeight::get().writes(1+win as Weight)) | ||
} | ||
} |
Oops, something went wrong.