Skip to content

Commit

Permalink
WIP:
Browse files Browse the repository at this point in the history
  • Loading branch information
dkuanyshbaev committed Feb 13, 2025
1 parent e33237b commit 19eaa86
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
13 changes: 7 additions & 6 deletions frame/rws/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub mod pallet {
>>::Balance;

const DAYS_TO_MS: u32 = 24 * 60 * 60 * 1000;
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);

#[pallet::config]
pub trait Config: frame_system::Config {
Expand Down Expand Up @@ -242,6 +243,7 @@ pub mod pallet {
pub(super) type UnspendBondValue<T: Config> = StorageValue<_, BalanceOf<T>, ValueQuery>;

#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(PhantomData<T>);

#[pallet::hooks]
Expand Down Expand Up @@ -452,12 +454,11 @@ pub mod pallet {

// store auction indexes without bids to queue
//<AuctionQueue<T>>::put(next.iter().map(|(i, _)| i).collect::<Vec<_>>());

let indexes_without_bids = BoundedVec::new();
next.iter().map(|(i, _)| indexes_without_bids.try_push(i));
<AuctionQueue<T>>::put(&indexes_without_bids);

//----------------------------------------------------
let mut indexes_without_bids = BoundedVec::new();
next.iter()
.map(|(i, _)| indexes_without_bids.try_push(i.clone()));
<AuctionQueue<T>>::put(indexes_without_bids);
//------------------------------------------------

for (_, auction) in finished.iter() {
if let Some(subscription_id) = &auction.winner {
Expand Down
8 changes: 4 additions & 4 deletions runtime/dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ impl pallet_robonomics_rws::Config for Runtime {
type MaxAucionIndexLen = u64;
}

// impl pallet_robonomics_digital_twin::Config for Runtime {
// type RuntimeEvent = RuntimeEvent;
// }
//impl pallet_robonomics_digital_twin::Config for Runtime {
//type RuntimeEvent = RuntimeEvent;
//}

impl pallet_robonomics_liability::Config for Runtime {
type Agreement = pallet_robonomics_liability::SignedAgreement<
Expand Down Expand Up @@ -671,7 +671,7 @@ construct_runtime!(
Datalog: pallet_robonomics_datalog,
Launch: pallet_robonomics_launch,
RWS: pallet_robonomics_rws,
// DigitalTwin: pallet_robonomics_digital_twin,
//DigitalTwin: pallet_robonomics_digital_twin,
Liability: pallet_robonomics_liability,

// Sudo. Usable initially.
Expand Down
36 changes: 18 additions & 18 deletions runtime/main/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,22 +596,22 @@ parameter_types! {
pub const MinimalBid: Balance = 1 * XRT;
}

// impl pallet_robonomics_rws::Config for Runtime {
// type Call = RuntimeCall;
// type Time = Timestamp;
// type Moment = Moment;
// type AuctionIndex = u32;
// type AuctionCurrency = Balances;
// type RuntimeEvent = RuntimeEvent;
// type ReferenceCallWeight = ReferenceCallWeight;
// type AuctionDuration = AuctionDuration;
// type AuctionCost = AuctionCost;
// type MinimalBid = MinimalBid;
// }
//
// impl pallet_robonomics_digital_twin::Config for Runtime {
// type RuntimeEvent = RuntimeEvent;
// }
impl pallet_robonomics_rws::Config for Runtime {
type Call = RuntimeCall;
type Time = Timestamp;
type Moment = Moment;
type AuctionIndex = u32;
type AuctionCurrency = Balances;
type RuntimeEvent = RuntimeEvent;
type ReferenceCallWeight = ReferenceCallWeight;
type AuctionDuration = AuctionDuration;
type AuctionCost = AuctionCost;
type MinimalBid = MinimalBid;
}

//impl pallet_robonomics_digital_twin::Config for Runtime {
//type RuntimeEvent = RuntimeEvent;
//}

impl pallet_robonomics_liability::Config for Runtime {
type Agreement = pallet_robonomics_liability::SignedAgreement<
Expand Down Expand Up @@ -659,8 +659,8 @@ construct_runtime! {
// Robonomics Network pallets.
Datalog: pallet_robonomics_datalog = 51,
Launch: pallet_robonomics_launch = 52,
// DigitalTwin: pallet_robonomics_digital_twin = 54,
// RWS: pallet_robonomics_rws = 55,
//DigitalTwin: pallet_robonomics_digital_twin = 54,
RWS: pallet_robonomics_rws = 55,
Liability: pallet_robonomics_liability = 56,

// Block authoring gadget.
Expand Down

0 comments on commit 19eaa86

Please sign in to comment.