mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-12-24 15:25:17 +00:00
fix build dependency isuse (#12)
* fix build dependency isuse * cargo fmt * fix lint failure in CI * update toolchain
This commit is contained in:
parent
7667e02019
commit
a4abe2b2a4
4
.github/workflows/cc.yml
vendored
4
.github/workflows/cc.yml
vendored
@ -36,9 +36,7 @@ jobs:
|
||||
override: true
|
||||
|
||||
- name: Run unittest
|
||||
# Disable --all-features to avoid CI failure when download dependent lib (via yarn) for contract compilation.
|
||||
# run: cargo test --all-features --no-fail-fast
|
||||
run: cargo test --no-fail-fast
|
||||
run: cargo test --all-features --no-fail-fast
|
||||
env:
|
||||
CARGO_INCREMENTAL: '0'
|
||||
RUSTC_BOOTSTRAP: '1'
|
||||
|
1
.github/workflows/rust.yml
vendored
1
.github/workflows/rust.yml
vendored
@ -97,3 +97,4 @@ jobs:
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: -- -D warnings
|
@ -1,30 +1,30 @@
|
||||
use std::process::Command;
|
||||
// use std::process::Command;
|
||||
|
||||
const INSTALL_ERROR_MESSAGE: &str =
|
||||
"Install dependencies for contract fail, try to run `yarn` in folder 'zerog-storage-contracts'";
|
||||
const COMPILE_ERROR_MESSAGE: &str =
|
||||
"Compile solidity contracts fail, try to run `yarn compile` in folder 'zerog-storage-contracts'";
|
||||
// const INSTALL_ERROR_MESSAGE: &str =
|
||||
// "Install dependencies for contract fail, try to run `yarn` in folder 'zerog-storage-contracts'";
|
||||
// const COMPILE_ERROR_MESSAGE: &str =
|
||||
// "Compile solidity contracts fail, try to run `yarn compile` in folder 'zerog-storage-contracts'";
|
||||
|
||||
fn main() {
|
||||
if cfg!(feature = "compile-contracts") {
|
||||
println!("cargo:rerun-if-changed=../../zerog-storage-contracts/contracts/");
|
||||
println!("cargo:rerun-if-changed=../../zerog-storage-contracts/hardhat.config.ts");
|
||||
// if cfg!(feature = "compile-contracts") {
|
||||
// println!("cargo:rerun-if-changed=../../zerog-storage-contracts/contracts/");
|
||||
// println!("cargo:rerun-if-changed=../../zerog-storage-contracts/hardhat.config.ts");
|
||||
|
||||
let output = Command::new("yarn")
|
||||
.arg("--cwd")
|
||||
.arg("../../zerog-storage-contracts")
|
||||
.status()
|
||||
.expect(INSTALL_ERROR_MESSAGE);
|
||||
assert!(output.success(), "{}", INSTALL_ERROR_MESSAGE);
|
||||
// let output = Command::new("yarn")
|
||||
// .arg("--cwd")
|
||||
// .arg("../../zerog-storage-contracts")
|
||||
// .status()
|
||||
// .expect(INSTALL_ERROR_MESSAGE);
|
||||
// assert!(output.success(), "{}", INSTALL_ERROR_MESSAGE);
|
||||
|
||||
let output = Command::new("yarn")
|
||||
.arg("--cwd")
|
||||
.arg("../../zerog-storage-contracts")
|
||||
.arg("compile")
|
||||
.status()
|
||||
.expect(COMPILE_ERROR_MESSAGE);
|
||||
assert!(output.success(), "{}", COMPILE_ERROR_MESSAGE);
|
||||
} else {
|
||||
println!("cargo:rerun-if-changed=../../zerog-storage-contracts/artifacts/");
|
||||
}
|
||||
// let output = Command::new("yarn")
|
||||
// .arg("--cwd")
|
||||
// .arg("../../zerog-storage-contracts")
|
||||
// .arg("compile")
|
||||
// .status()
|
||||
// .expect(COMPILE_ERROR_MESSAGE);
|
||||
// assert!(output.success(), "{}", COMPILE_ERROR_MESSAGE);
|
||||
// } else {
|
||||
// println!("cargo:rerun-if-changed=../../zerog-storage-contracts/artifacts/");
|
||||
// }
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! Helper functions and an extension trait for Ethereum 2 ENRs.
|
||||
|
||||
pub use discv5::enr::{self, CombinedKey, EnrBuilder};
|
||||
pub use discv5::enr::{CombinedKey, EnrBuilder};
|
||||
|
||||
use super::enr_ext::CombinedKeyExt;
|
||||
use super::ENR_FILENAME;
|
||||
|
@ -24,7 +24,7 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
fn duration_since(timestamp: u32) -> chrono::Duration {
|
||||
let timestamp = i64::try_from(timestamp).expect("Should fit");
|
||||
let timestamp = i64::from(timestamp);
|
||||
let timestamp = chrono::NaiveDateTime::from_timestamp_opt(timestamp, 0).expect("should fit");
|
||||
let now = chrono::Utc::now().naive_utc();
|
||||
now.signed_duration_since(timestamp)
|
||||
|
@ -7,7 +7,7 @@ use network::{Enr, Multiaddr, NetworkGlobals};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use builder::ClientBuilder;
|
||||
pub use environment::{Environment, EnvironmentBuilder, RuntimeContext};
|
||||
pub use environment::{EnvironmentBuilder, RuntimeContext};
|
||||
|
||||
/// The core Zgs client.
|
||||
///
|
||||
|
@ -1 +1 @@
|
||||
1.73.0
|
||||
1.75.0
|
||||
|
5
rustlint.sh
Normal file
5
rustlint.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# keep consistent with CI-lint in rust.yml
|
||||
cargo fmt --all
|
||||
cargo clippy -- -D warnings
|
@ -26,7 +26,7 @@
|
||||
|
||||
pub use super::{
|
||||
bucket::{
|
||||
AppliedPending, ConnectionState, InsertResult, Node, NodeStatus, MAX_NODES_PER_BUCKET,
|
||||
AppliedPending, ConnectionState, InsertResult, Node, NodeStatus,
|
||||
},
|
||||
key::*,
|
||||
ConnectionDirection,
|
||||
|
Loading…
Reference in New Issue
Block a user