Skip to content

Commit

Permalink
Fix pallet compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
akru committed Feb 10, 2022
1 parent 28167c6 commit dc3020c
Show file tree
Hide file tree
Showing 15 changed files with 605 additions and 1,226 deletions.
1,772 changes: 580 additions & 1,192 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions frame/datalog/Cargo.toml
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 = "1.0.2"
version = "1.1.0"
authors = ["Airalab <[email protected]>"]
edition = "2018"

Expand All @@ -23,7 +23,6 @@ pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "

[features]
default = ["std"]
storage-v0 = []
std = [
"serde",
"codec/std",
Expand Down
17 changes: 1 addition & 16 deletions frame/datalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ pub mod pallet {
use sp_std::prelude::*;

use super::*;
#[cfg(feature = "storage-v0")]
type DatalogHash = Blake2_128Concat;
#[cfg(not(feature = "storage-v0"))]
type DatalogHash = Twox64Concat;

#[pallet::config]
pub trait Config: frame_system::Config + TypeInfo {
Expand Down Expand Up @@ -76,16 +72,6 @@ pub mod pallet {
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}

/// Time tagged data of given account (deprecated).
#[pallet::storage]
#[pallet::getter(fn datalog)]
pub(super) type Datalog<T> = StorageMap<
_,
DatalogHash,
<T as frame_system::Config>::AccountId,
Vec<(<<T as Config>::Time as Time>::Moment, <T as Config>::Record)>,
>;

/// Ringbuffer start/end pointers
#[pallet::storage]
#[pallet::getter(fn datalog_index)]
Expand All @@ -110,6 +96,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::generate_store(pub (super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);

#[pallet::call]
Expand All @@ -124,7 +111,6 @@ pub mod pallet {
let sender = ensure_signed(origin)?;

// remove previous version from storage
Datalog::<T>::remove(&sender);
let now = T::Time::now();
let item = RingBufferItem(now, record);

Expand All @@ -145,7 +131,6 @@ pub mod pallet {
#[pallet::weight(T::WeightInfo::erase(T::WindowSize::get()))]
pub fn erase(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
Datalog::<T>::remove(&sender);

let mut idx = DatalogIndex::<T>::take(&sender);

Expand Down
2 changes: 1 addition & 1 deletion frame/digital-twin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-robonomics-digital-twin"
description = "Robonomics Network digital twin runtime module"
version = "0.2.1"
version = "0.2.2"
authors = ["Airalab <[email protected]>"]
edition = "2018"

Expand Down
1 change: 1 addition & 0 deletions frame/digital-twin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);

#[pallet::call]
Expand Down
2 changes: 1 addition & 1 deletion frame/launch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-robonomics-launch"
description = "Robonomics Network robot launch Substrate runtime module"
version = "0.3.0"
version = "0.3.1"
authors = ["Airalab <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion frame/launch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mod benchmarking;

#[frame_support::pallet]
pub mod pallet {

use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;

Expand All @@ -52,6 +51,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);

#[pallet::call]
Expand Down
2 changes: 1 addition & 1 deletion frame/liability/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-robonomics-liability"
description = "Robonomics Network Robot Liability Substrate runtime module"
version = "0.6.1"
version = "0.6.2"
authors = ["Airalab <[email protected]>"]
edition = "2018"

Expand Down
1 change: 1 addition & 0 deletions frame/liability/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);

#[pallet::call]
Expand Down
2 changes: 1 addition & 1 deletion frame/rws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-robonomics-rws"
description = "Robonomics Web Services subscription runtime module."
version = "1.1.0"
version = "1.1.1"
authors = ["Airalab <[email protected]>"]
edition = "2018"

Expand Down
13 changes: 11 additions & 2 deletions frame/rws/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Default for Subscription {
}
}

#[derive(PartialEq, Eq, Clone, Default, Encode, Decode, TypeInfo, RuntimeDebug)]
#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, RuntimeDebug)]
pub struct AuctionLedger<AccountId, Balance: HasCompact> {
/// Auction winner address.
pub winner: Option<AccountId>,
Expand All @@ -71,6 +71,14 @@ impl<AccountId, Balance: HasCompact + Default> AuctionLedger<AccountId, Balance>
kind,
}
}

pub fn empty() -> Self {
Self {
winner: None,
best_price: Default::default(),
kind: Default::default(),
}
}
}

#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, RuntimeDebug)]
Expand Down Expand Up @@ -227,6 +235,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);

#[pallet::hooks]
Expand Down Expand Up @@ -431,7 +440,7 @@ pub mod pallet {
let queue = Self::auction_queue();
let (finished, next): (Vec<_>, Vec<_>) = queue
.iter()
.map(|index| (index.clone(), Self::auction(index).unwrap_or_default()))
.map(|index| (index.clone(), Self::auction(index).unwrap_or(AuctionLedger::empty())))
.partition(|(_, auction)| auction.winner.is_some());

// store auction indexes without bids to queue
Expand Down
1 change: 1 addition & 0 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);

#[pallet::storage]
Expand Down
4 changes: 2 additions & 2 deletions protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ futures-timer = "3.0.2"
# subxt = { git = "https://github.com/paritytech/subxt", rev="c19d2e6", default-features = false, features = ["tokio02"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
libp2p = "0.39.1"
libp2p-swarm = "0.30.0"
libp2p = "0.40.0"
libp2p-swarm = "0.31.0"
futures = "0.3.15"
bincode = "1.3.1"
log = "0.4.11"
Expand Down
2 changes: 1 addition & 1 deletion release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let
(import "${ros_overlay}/overlay.nix")
];
};
rust-nightly = pkgs.rustChannelOfTargets "nightly" "2021-11-02" [ "wasm32-unknown-unknown" ];
rust-nightly = pkgs.rustChannelOfTargets "nightly" "2021-11-29" [ "wasm32-unknown-unknown" ];
in
with pkgs;
with rosPackages.noetic;
Expand Down
7 changes: 1 addition & 6 deletions runtime/alpha/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkad

# standard dependencies
pallet-assets = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false }
pallet-asset-tx-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false }
pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false }
pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false }
Expand Down Expand Up @@ -64,12 +65,6 @@ cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", bra
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
pallet-asset-tx-payment = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
cumulus-ping = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false }

# polkadot dependencies
Expand Down

0 comments on commit dc3020c

Please sign in to comment.