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

fix: sort imports to trigger release #61

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/distro/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use maplit::hashmap;
use std::collections::HashMap;
use serde_json::{json, Value as JValue};

use fluence_spell_dtos::trigger_config::TriggerConfig;
use maplit::hashmap;
use serde_json::{json, Value as JValue};

const CONNECTOR: &'static [u8] =
include_bytes!("../decider-spell/fluence_aurora_connector.wasm");
pub use build_info::PKG_VERSION as VERSION;

const CONNECTOR: &'static [u8] = include_bytes!("../decider-spell/fluence_aurora_connector.wasm");
const CURL_ADAPTER: &'static [u8] = include_bytes!("../decider-spell/curl_adapter.wasm");
const CONFIG: &'static [u8] = include_bytes!("../decider-spell/Config.toml");

Expand All @@ -15,15 +17,13 @@ pub mod build_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}

pub use build_info::PKG_VERSION as VERSION;

pub struct DistrService {
pub name: &'static str,
pub config: &'static [u8],
pub modules: HashMap<&'static str, &'static [u8]>,
pub name: &'static str,
pub config: &'static [u8],
pub modules: HashMap<&'static str, &'static [u8]>,
}

pub fn connector_service_modules() -> DistrService {
pub fn connector_service_modules() -> DistrService {
DistrService {
// The name is used by the decider, so we don't need to explicitly pass the service id of the connector service
// The name is taken from the config. Would be nice one day to automatically take it from the project itself.
Expand All @@ -32,7 +32,7 @@ pub fn connector_service_modules() -> DistrService {
modules: hashmap! {
"fluence_aurora_connector" => CONNECTOR,
"curl_adapter" => CURL_ADAPTER,
}
},
}
}

Expand Down Expand Up @@ -65,7 +65,7 @@ pub fn decider_spell(config: DeciderConfig) -> DistrSpell {

DistrSpell {
air: DECIDER_SPELL,
kv: hashmap!{
kv: hashmap! {
"worker_script" => json!(WORKER_SPELL),
"worker_config" => json!(worker_config),
"worker_ipfs" => json!(config.worker_ipfs_multiaddr),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// #![allow(improper_ctypes)]
use marine_rs_sdk::marine;
use marine_rs_sdk::module_manifest;

use marine_rs_sdk::MountedBinaryResult;

module_manifest!();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use marine_rs_sdk::marine;

use crate::chain::chain_data::ChainData;
use crate::chain::deal_changed::{DealChanged, DealChangedData};
use crate::chain::deal_created::{DealCreated, DealCreatedData};
use marine_rs_sdk::marine;

#[marine]
pub struct SupportedEvent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::cmp::{min, Ordering};

use marine_rs_sdk::marine;
use std::cmp::{Ordering, min};

/// Convert hex string to u64
pub fn hex_to_int(hex: &str) -> Option<u64> {
Expand Down Expand Up @@ -101,7 +102,7 @@ pub fn hex_cmp(hex_a: &str, hex_b: &str) -> HexCmp {
#[marine]
pub struct HexAdd {
pub hex: Vec<String>,
pub success: bool
pub success: bool,
}

impl HexAdd {
Expand Down Expand Up @@ -134,7 +135,7 @@ pub fn hex_add(hex: &str, add: u32) -> HexAdd {
#[marine]
pub struct HexMin {
pub hex: Vec<String>,
pub success: bool
pub success: bool,
}

impl HexMin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::chain::deal_created::DealCreated;
use marine_rs_sdk::marine;

use crate::chain::deal_created::DealCreated;

#[marine]
pub struct DealCreatedResult {
error: Vec<String>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::jsonrpc::JsonRpcError;
use thiserror::Error;
use url::Url;

use crate::jsonrpc::JsonRpcError;

#[derive(Debug, Error)]
pub enum RequestError {
#[error("`curl` returned error: {0}")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::{jsonrpc::{JsonRpcReq, get_logs::GetLogsReq}, chain::log::Log};
use crate::{
chain::log::Log,
jsonrpc::{get_logs::GetLogsReq, JsonRpcReq},
};

use super::*;

Expand Down