Skip to content

Commit 259eab7

Browse files
author
Joshua Mir
committed
fix node build
1 parent 3dcfdc1 commit 259eab7

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

datdot-node/node/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ path = "src/main.rs"
1515

1616
[dependencies]
1717
derive_more = "0.15.0"
18-
futures = "0.3.1"
19-
structopt = "0.3.8"
18+
futures = "0.3.5"
19+
structopt = "0.3.15"
2020
futures01 = { package = "futures", version = "0.1.29" }
21-
ctrlc = { version = "3.1.3", features = ["termination"] }
21+
ctrlc = { version = "3.1.4", features = ["termination"] }
2222
log = "0.4.8"
2323
tokio = "0.1.22"
2424
exit-future = "0.2.0"

datdot-node/node/src/service.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceEr
6969
.map_err(sp_consensus::error::Error::InherentData)?;
7070

7171
let builder = new_full_start!(config);
72-
let service = builder.build()?;
72+
let service = builder.build_full()?;
7373

7474
// Initialize seed for signing transaction using off-chain workers
7575
#[cfg(feature = "ocw")]
@@ -153,5 +153,5 @@ pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceE
153153
},
154154
)?
155155
.with_finality_proof_provider(|_client, _backend| Ok(Arc::new(()) as _))?
156-
.build()
156+
.build_light()
157157
}

datdot-node/pallets/datdot/src/lib.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ pub trait Trait: system::Trait{
9696
MaybeSerializeDeserialize + Debug;
9797
type AttestationId: Parameter + Member + AtLeast32Bit + BaseArithmetic + EncodeLike<u32> + Codec + Default + Copy +
9898
MaybeSerializeDeserialize + Debug;
99-
type ChunkIndex: Parameter + Member + AtLeast32Bit + BaseArithmetic + EncodeLike<u32> + Codec + Default + Copy +
100-
MaybeSerializeDeserialize + Debug;
10199
// ---
102100
}
103101

@@ -112,7 +110,6 @@ decl_event!(
112110
<T as Trait>::ContractId,
113111
<T as Trait>::PlanId,
114112
<T as Trait>::ChallengeId,
115-
<T as Trait>::ChunkIndex
116113
{
117114
/// New data feed registered
118115
NewFeed(FeedId),
@@ -139,6 +136,7 @@ decl_event!(
139136
);
140137

141138
type RoleValue = Option<u32>;
139+
type ChunkIndex = u64;
142140

143141
#[derive(Decode, PartialEq, Eq, Encode, Clone, RuntimeDebug)]
144142
enum Role {
@@ -192,14 +190,14 @@ struct Plan<T: Trait> {
192190
id: T::PlanId,
193191
feed: T::FeedId,
194192
publisher: T::UserId,
195-
ranges: Ranges<T::ChunkIndex>
193+
ranges: Ranges<ChunkIndex>
196194
}
197195

198196
#[derive(Decode, PartialEq, Eq, Encode, Clone, Default, RuntimeDebug)]
199197
struct Contract<T: Trait> {
200198
id: T::ContractId,
201199
plan: T::PlanId,
202-
ranges: Ranges<T::ChunkIndex>,
200+
ranges: Ranges<ChunkIndex>,
203201
encoder: T::UserId,
204202
hoster: T::UserId
205203
}
@@ -208,7 +206,7 @@ struct Contract<T: Trait> {
208206
struct Challenge<T: Trait> {
209207
id: T::ChallengeId,
210208
contract: T::ContractId,
211-
chunks: Vec<T::ChunkIndex>
209+
chunks: Vec<ChunkIndex>
212210
}
213211

214212

@@ -430,7 +428,7 @@ decl_module!{
430428
}
431429

432430
#[weight = (100000, Operational, Pays::No)] //todo weight
433-
fn publish_feed_and_plan(origin, merkle_root: (Public, TreeHashPayload, H512), ranges: Ranges<T::ChunkIndex>){
431+
fn publish_feed_and_plan(origin, merkle_root: (Public, TreeHashPayload, H512), ranges: Ranges<ChunkIndex>){
434432
let user_address = ensure_signed(origin)?;
435433
if let Some(user_id) = <GetIDByUser<T>>::get(&user_address){
436434
let mut feed_id : T::FeedId;
@@ -654,7 +652,7 @@ impl<T: Trait> Module<T> {
654652
}
655653
}
656654

657-
fn random_from_ranges(ranges: Ranges<T::ChunkIndex>) -> Vec<T::ChunkIndex>{
655+
fn random_from_ranges(ranges: Ranges<ChunkIndex>) -> Vec<ChunkIndex>{
658656
//TODO, currently only returns first chunk of every available range,
659657
//should return some random selection.
660658
ranges.iter().map(|x|x.0).collect()

datdot-node/runtime/src/lib.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ impl system::Trait for Runtime {
183183
type OnKilledAccount = ();
184184
/// The data to be stored in an account.
185185
type AccountData = balances::AccountData<Balance>;
186+
type BaseCallFilter = ();
186187
}
187188

188189
parameter_types! {
@@ -239,17 +240,18 @@ parameter_types! {
239240
pub const ChallengeDelay: u32 = 5;
240241
}
241242

243+
type DatDotIdType = u32;
244+
242245
impl dat_verify::Trait for Runtime {
243246
type Event = Event;
244247
type Hash = Hash;
245248
type Randomness = RandomnessCollectiveFlip;
246-
type ForceOrigin = dat_verify::EnsureSeeder<Runtime>;
247-
type AttestorsPerChallenge = AttestorsPerChallenge;
248-
type MinEncodersPerHoster = MinEncodersPerHoster;
249-
type MinHostersPerArchive = MinHostersPerArchive;
250-
type ChallengeDelay = ChallengeDelay;
251-
type Proposal = Call;
252-
type Scheduler = Scheduler;
249+
type FeedId = DatDotIdType;
250+
type UserId = DatDotIdType;
251+
type ContractId = DatDotIdType;
252+
type ChallengeId = DatDotIdType;
253+
type PlanId = DatDotIdType;
254+
type AttestationId = DatDotIdType;
253255

254256
}
255257

0 commit comments

Comments
 (0)