Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/cargo/itertools-0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Nov 20, 2023
2 parents d719219 + 155139e commit 9fa1ace
Show file tree
Hide file tree
Showing 116 changed files with 23,886 additions and 466 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
on:
push: {}


name: Validate

jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
rust: [stable]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand All @@ -18,7 +24,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: ${{ matrix.rust }}
override: true

- name: Run cargo check
Expand Down Expand Up @@ -70,4 +76,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
args: -- -D warnings
29 changes: 16 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
[workspace]

resolver = "2"
members = [
"pallas-codec",
"pallas-addresses",
"pallas-network",
"pallas-crypto",
"pallas-primitives",
"pallas-traverse",
"pallas-utxorpc",
"pallas",
"examples/block-download",
"examples/block-decode",
"examples/n2n-miniprotocols",
"examples/n2c-miniprotocols",
"pallas-applying",
"pallas-codec",
"pallas-addresses",
"pallas-network",
"pallas-crypto",
"pallas-configs",
"pallas-primitives",
"pallas-rolldb",
"pallas-traverse",
"pallas-utxorpc",
"pallas",
"examples/block-download",
"examples/block-decode",
"examples/n2n-miniprotocols",
"examples/n2c-miniprotocols",
]
2 changes: 1 addition & 1 deletion examples/block-decode/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use pallas::ledger::traverse::MultiEraBlock;

fn main() {
let blocks = vec![
let blocks = [
include_str!("blocks/byron.block"),
include_str!("blocks/shelley.block"),
include_str!("blocks/mary.block"),
Expand Down
32 changes: 23 additions & 9 deletions examples/n2c-miniprotocols/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
use pallas::network::{
facades::NodeClient,
miniprotocols::{chainsync, localstate, Point, MAINNET_MAGIC},
miniprotocols::{chainsync, localstate::queries_v16, Point, PRE_PRODUCTION_MAGIC},

Check warning on line 3 in examples/n2c-miniprotocols/src/main.rs

View workflow job for this annotation

GitHub Actions / Check (windows-latest, stable)

unused import: `PRE_PRODUCTION_MAGIC`
};
use tracing::info;

async fn do_localstate_query(client: &mut NodeClient) {

Check warning on line 7 in examples/n2c-miniprotocols/src/main.rs

View workflow job for this annotation

GitHub Actions / Check (windows-latest, stable)

function `do_localstate_query` is never used
client.statequery().acquire(None).await.unwrap();
let client = client.statequery();

let result = client
.statequery()
.query(localstate::queries::RequestV10::GetSystemStart)
client.acquire(None).await.unwrap();

let result = queries_v16::get_chain_point(client).await.unwrap();
info!("result: {:?}", result);

let result = queries_v16::get_system_start(client).await.unwrap();
info!("result: {:?}", result);

let era = queries_v16::get_current_era(client).await.unwrap();
info!("result: {:?}", era);

let result = queries_v16::get_block_epoch_number(client, era)
.await
.unwrap();

info!("system start result: {:?}", result);
info!("result: {:?}", result);

client.send_release().await.unwrap();
}

async fn do_chainsync(client: &mut NodeClient) {

Check warning on line 30 in examples/n2c-miniprotocols/src/main.rs

View workflow job for this annotation

GitHub Actions / Check (windows-latest, stable)

function `do_chainsync` is never used
Expand Down Expand Up @@ -43,7 +54,11 @@ async fn do_chainsync(client: &mut NodeClient) {
}
}

#[cfg(target_family = "unix")]
// change the following to match the Cardano node socket in your local
// environment
const SOCKET_PATH: &str = "/tmp/node.socket";

Check warning on line 59 in examples/n2c-miniprotocols/src/main.rs

View workflow job for this annotation

GitHub Actions / Check (windows-latest, stable)

constant `SOCKET_PATH` is never used

#[cfg(unix)]
#[tokio::main]
async fn main() {
tracing::subscriber::set_global_default(
Expand All @@ -55,7 +70,7 @@ async fn main() {

// we connect to the unix socket of the local node. Make sure you have the right
// path for your environment
let mut client = NodeClient::connect("/tmp/node.socket", MAINNET_MAGIC)
let mut client = NodeClient::connect(SOCKET_PATH, PRE_PRODUCTION_MAGIC)
.await
.unwrap();

Expand All @@ -67,7 +82,6 @@ async fn main() {
}

#[cfg(not(target_family = "unix"))]

fn main() {
panic!("can't use n2c unix socket on non-unix systems");
}
8 changes: 5 additions & 3 deletions pallas-addresses/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallas-addresses"
description = "Ergonomic library to work with different Cardano addresses"
version = "0.19.0-alpha.1"
version = "0.19.1"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"
Expand All @@ -12,8 +12,10 @@ authors = ["Santiago Carmuega <[email protected]>"]

[dependencies]
hex = "0.4.3"
pallas-crypto = { version = "0.19.0-alpha.0", path = "../pallas-crypto" }
pallas-codec = { version = "0.19.0-alpha.0", path = "../pallas-codec" }
pallas-crypto = { version = "=0.19.1", path = "../pallas-crypto" }
pallas-codec = { version = "=0.19.1", path = "../pallas-codec" }
base58 = "0.2.0"
bech32 = "0.9.1"
thiserror = "1.0.31"
crc = "3.0.1"
sha3 = "0.10.8"
Loading

0 comments on commit 9fa1ace

Please sign in to comment.