Skip to content

Commit

Permalink
Bump bee-block and improve vendoring (#88)
Browse files Browse the repository at this point in the history
* Better vendoring

* Bump `bee-block`

* Bump version

* Temp fix CI
  • Loading branch information
grtlr authored Jul 21, 2022
1 parent b06aa7d commit b8d182a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
strategy:
matrix:
rust: [stable]
os: [ubuntu-latest, macos-latest, windows-latest]
# os: [ubuntu-latest, macos-latest, windows-latest]
# Skip windows for now
os: [ubuntu-latest, macos-latest]
experimental: [false]

steps:
Expand Down
12 changes: 0 additions & 12 deletions rust/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "inx"
version = "1.0.0-beta.1"
version = "1.0.0-beta.2"
authors = [ "IOTA Stiftung" ]
edition = "2021"
description = "Rust bindings for IOTA node extensions (INX)"
Expand All @@ -16,7 +16,7 @@ tonic = { version = "0.7", default-features = false, features = [ "codegen", "pr
thiserror = { version = "1.0", default-features = false }

# optional
bee-block-stardust = { package = "bee-block", version = "1.0.0-beta.1", default-features = false, features = [ "std" ], optional = true }
bee-block-stardust = { package = "bee-block", version = "1.0.0-beta.2", default-features = false, features = [ "std" ], optional = true }
packable = { version = "0.5", default-features = false, optional = true }

[build-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
use std::env;

fn main() -> Result<(), std::io::Error> {
let out_dir = env::var("OUT_DIR").unwrap();
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();

std::fs::copy(
format!("{manifest_dir}/../proto/inx.proto"),
format!("{out_dir}/inx.proto"),
format!("{manifest_dir}/vendor/inx.proto"),
)?;
tonic_build::compile_protos(format!("{out_dir}/inx.proto"))?;
tonic_build::compile_protos(format!("{manifest_dir}/vendor/inx.proto"))?;
Ok(())
}
14 changes: 7 additions & 7 deletions rust/src/types/tangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
use super::Error;
use crate::proto;
use bee_block_stardust as stardust;
use stardust::output::ByteCostConfigBuilder;
use stardust::output::RentStructureBuilder;

impl From<proto::RentStructure> for stardust::output::ByteCostConfig {
impl From<proto::RentStructure> for stardust::output::RentStructure {
fn from(value: proto::RentStructure) -> Self {
ByteCostConfigBuilder::new()
.byte_cost(value.v_byte_cost as u64)
.data_factor(value.v_byte_factor_data as u64)
.key_factor(value.v_byte_factor_key as u64)
RentStructureBuilder::new()
.byte_cost(value.v_byte_cost as u32)
.data_factor(value.v_byte_factor_data as u8)
.key_factor(value.v_byte_factor_key as u8)
.finish()
}
}
Expand All @@ -30,7 +30,7 @@ pub struct ProtocolParameters {
/// The below max depth (BMD) parameter of the tip selection algorithm.
pub below_max_depth: u32,
/// Defines the parameters for the byte cost calculation
pub rent_structure: stardust::output::ByteCostConfig,
pub rent_structure: stardust::output::RentStructure,
/// The overall token supply.
pub token_supply: u64,
}
Expand Down
3 changes: 3 additions & 0 deletions rust/vendor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**
!.gitignore
!README.md
2 changes: 2 additions & 0 deletions rust/vendor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This folder is a target for vendored files. All contains will be generated
automatically and should not be changed manually.

0 comments on commit b8d182a

Please sign in to comment.