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

Update substrate #1038

Merged
merged 18 commits into from
Jun 12, 2022
2,882 changes: 1,307 additions & 1,575 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ gear-core = { path = "../core" }

# Substrate deps

sp-core = { version = "6.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false }
sp-io = { version = "6.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false }
sp-std = { version = "4.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false }
sp-arithmetic = { version = "5.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false }
frame-support = { version = "4.0.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false, optional = true }
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false, optional = true }
sp-core = { version = "6.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false }
sp-io = { version = "6.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false }
sp-std = { version = "4.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false }
sp-arithmetic = { version = "5.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false }
frame-support = { version = "4.0.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false, optional = true }
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false, optional = true }
gear-runtime-interface = { path = "../runtime-interface", default-features = false }
parity-wasm = { version = "0.42.2", default-features = false, optional = true }
derive_more = "0.99.17"
Expand Down
4 changes: 2 additions & 2 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use core::fmt;
use frame_support::{
dispatch::{DispatchError, DispatchResult},
traits::Imbalance,
weights::{IdentityFee, WeightToFeePolynomial},
weights::{IdentityFee, WeightToFee},
};
use gear_core::{
ids::{CodeId, MessageId, ProgramId},
Expand Down Expand Up @@ -134,7 +134,7 @@ pub trait GasPrice {
/// A price for the `gas` amount of gas.
/// In general case, this doesn't necessarily has to be constant.
fn gas_price(gas: u64) -> Self::Balance {
IdentityFee::<Self::Balance>::calc(&gas)
IdentityFee::<Self::Balance>::weight_to_fee(&gas)
}
}

Expand Down
6 changes: 3 additions & 3 deletions common/src/storage/complex/mailbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub trait Mailbox {
fn remove(key1: Self::Key1, key2: Self::Key2) -> Result<Self::Value, Self::OutputError>;

/// Removes all values from all key's mailboxes.
fn remove_all();
fn clear();
}

/// Represents store of mailbox's action callbacks.
Expand Down Expand Up @@ -138,8 +138,8 @@ where
}
}

fn remove_all() {
T::remove_all()
fn clear() {
T::clear()
}
}

Expand Down
6 changes: 3 additions & 3 deletions common/src/storage/complex/messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ pub trait Messenger {
Self::Sent::reset();
Self::Dequeued::reset();
Self::QueueProcessing::allow();
Self::Queue::remove_all();
Self::Mailbox::remove_all();
Self::Waitlist::remove_all();
Self::Queue::clear();
Self::Mailbox::clear();
Self::Waitlist::clear();
}
}
6 changes: 3 additions & 3 deletions common/src/storage/complex/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait Queue {
fn queue(value: Self::Value) -> Result<(), Self::OutputError>;

/// Removes all values from queue.
fn remove_all();
fn clear();

/// Inserts given value at the beginning of the queue.
///
Expand Down Expand Up @@ -87,8 +87,8 @@ where
T::push_back(key, value).map_err(Into::into)
}

fn remove_all() {
T::remove_all()
fn clear() {
T::clear()
}

fn requeue(value: Self::Value) -> Result<(), Self::OutputError> {
Expand Down
6 changes: 3 additions & 3 deletions common/src/storage/complex/waitlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub trait Waitlist {
) -> Result<(Self::Value, Self::BlockNumber), Self::OutputError>;

/// Removes all values from all key's waitlisted.
fn remove_all();
fn clear();
}

/// Represents store of waitlist's action callbacks.
Expand Down Expand Up @@ -156,8 +156,8 @@ where
}
}

fn remove_all() {
T::remove_all()
fn clear() {
T::clear()
}
}

Expand Down
8 changes: 4 additions & 4 deletions common/src/storage/complicated/dequeue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub trait Dequeue {
fn push_front(key: Self::Key, value: Self::Value) -> Result<(), Self::Error>;

/// Removes all values.
fn remove_all();
fn clear();
}

/// Represents store of dequeue's action callbacks.
Expand All @@ -77,7 +77,7 @@ pub trait DequeueCallbacks {
type OnPushBack: Callback<Self::Value>;
/// Callback on success `push_front`.
type OnPushFront: Callback<Self::Value>;
/// Callback on success `remove_all`.
/// Callback on success `clear`.
type OnRemoveAll: EmptyCallback;
ukint-vs marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down Expand Up @@ -308,10 +308,10 @@ where
}
}

fn remove_all() {
fn clear() {
HVS::kill();
TVS::kill();
MS::remove_all();
MS::clear();
Callbacks::OnRemoveAll::call();
}
}
Expand Down
6 changes: 3 additions & 3 deletions common/src/storage/primitives/double_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub trait DoubleMapStorage {
fn remove(key1: Self::Key1, key2: Self::Key2);

/// Removes all values.
fn remove_all();
fn clear();

/// Gets value stored under given keys, if present,
/// and removes it from storage.
Expand Down Expand Up @@ -127,8 +127,8 @@ macro_rules! wrap_storage_double_map {
$storage::<T>::remove(key1, key2)
}

fn remove_all() {
$storage::<T>::remove_all(None);
fn clear() {
$storage::<T>::clear(u32::MAX, None);
}

fn take(key1: Self::Key1, key2: Self::Key2) -> Option<Self::Value> {
Expand Down
6 changes: 3 additions & 3 deletions common/src/storage/primitives/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub trait MapStorage {
fn remove(key: Self::Key);

/// Removes all values.
fn remove_all();
fn clear();

/// Gets value stored under given key, if present,
/// and removes it from storage.
Expand Down Expand Up @@ -118,8 +118,8 @@ macro_rules! wrap_storage_map {
$storage::<T>::remove(key)
}

fn remove_all() {
$storage::<T>::remove_all($($rm_arg)?);
fn clear() {
$storage::<T>::clear(u32::MAX, None);
}

fn take(key: Self::Key) -> Option<Self::Value> {
Expand Down
2 changes: 1 addition & 1 deletion core-backend/sandbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gear-core-errors = { path = "../../core-errors", features = ["codec"] }
gear-backend-common = { path = "../common" }

parity-wasm = { version = "0.42.2", default-features = false }
sp-sandbox = { version = "0.10.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-stable", default-features = false, features = ["host-sandbox"] }
sp-sandbox = { version = "0.10.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-latest", default-features = false, features = ["host-sandbox"] }
log = { version = "0.4.17", default-features = false }
derive_more = "0.99.17"
codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false }
Expand Down
Loading