Skip to content

Commit

Permalink
chore: update cid/multihash
Browse files Browse the repository at this point in the history
Pull in a large breaking change to cid & multihash, updating the FVM to
handle these changes as well.
  • Loading branch information
Stebalien committed Nov 20, 2024
1 parent 0f83651 commit 1c48e2b
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 17 deletions.
23 changes: 12 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,25 @@ members = [
[workspace.dependencies]
blake2b_simd = { version = "1.0.0" }
clap = { version = "4.3.21", features = ["derive"] }
cid = { version = "0.10.1", default-features = false, features = [
"serde-codec",
cid = { version = "0.11.1", default-features = false, features = [
"serde",
] }
fvm = { version = "~4.4", default-features = false }
fvm_integration_tests = "~4.4"
fvm_ipld_amt = "0.6.0"
fvm_ipld_bitfield = "0.6.0"
fvm_ipld_blockstore = "0.2.0"
fvm_ipld_encoding = "0.4.0"
fvm_ipld_hamt = "0.9.0"
fvm_sdk = "~4.4"
fvm_shared = "~4.4"
fvm = { version = "~4.5", default-features = false }
fvm_integration_tests = "~4.5"
fvm_ipld_amt = "0.7.2"
fvm_ipld_bitfield = "0.7.0"
fvm_ipld_blockstore = "0.3.0"
fvm_ipld_encoding = "0.5.0"
fvm_ipld_hamt = "0.10.2"
fvm_sdk = "~4.5"
fvm_shared = "~4.5"
serde = { version = "1.0.136", features = ["derive"] }
serde_tuple = { version = "0.5.0" }
thiserror = { version = "1.0.31" }
integer-encoding = { version = "4.0.0" }
num-traits = { version = "0.2.15" }
anyhow = { version = "1.0.56" }
multihash-codetable = { version = "0.1.4" }

# internal deps of published packages
frc42_dispatch = { version = "7.0.0", path = "./frc42_dispatch", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions frc46_token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fvm_ipld_hamt = { workspace = true }
fvm_ipld_encoding = { workspace = true }
fvm_sdk = { workspace = true }
fvm_shared = { workspace = true }
multihash-codetable = { workspace = true }
num-traits = { workspace = true }
serde = { workspace = true }
serde_tuple = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions frc46_token/src/token/state.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::collections::HashMap;
use std::ops::Neg;

use cid::multihash::Code;
use cid::Cid;
use fvm_ipld_blockstore::Block;
use fvm_ipld_blockstore::Blockstore;
Expand All @@ -16,6 +15,7 @@ use fvm_shared::econ::TokenAmount;
use fvm_shared::error::ExitCode;
use fvm_shared::ActorID;
use integer_encoding::VarInt;
use multihash_codetable::Code;
use thiserror::Error;

/// This value has been chosen to optimise to reduce gas-costs when accessing the balances map. Non-
Expand Down Expand Up @@ -788,12 +788,12 @@ pub struct StateSummary {

#[cfg(test)]
mod test {
use cid::multihash::Code;
use cid::Cid;
use fvm_ipld_blockstore::{Block, Blockstore, MemoryBlockstore};
use fvm_ipld_encoding::DAG_CBOR;
use fvm_shared::econ::TokenAmount;
use fvm_shared::{bigint::Zero, ActorID};
use multihash_codetable::Code;

use super::TokenState;
use crate::token::state::{actor_id_key, OwnerAllowanceMap, StateError, StateInvariantError};
Expand Down
1 change: 1 addition & 0 deletions frc53_nft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fvm_ipld_encoding = { workspace = true }
fvm_sdk = { workspace = true }
fvm_shared = { workspace = true }
integer-encoding = { workspace = true }
multihash-codetable = { workspace = true }
num-traits = { workspace = true }
serde = { workspace = true }
serde_tuple = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion frc53_nft/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::collections::HashMap;
use std::mem;
use std::vec;

use cid::multihash::Code;
use cid::Cid;
use fvm_actor_utils::receiver::ReceiverHookError;
use fvm_ipld_amt::Amt;
Expand All @@ -20,6 +19,7 @@ use fvm_ipld_hamt::Error as HamtError;
use fvm_ipld_hamt::Hamt;
use fvm_shared::ActorID;
use integer_encoding::VarInt;
use multihash_codetable::Code;
use thiserror::Error;

use crate::types::ActorIDSet;
Expand Down
1 change: 1 addition & 0 deletions fvm_actor_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fvm_ipld_blockstore = { workspace = true }
fvm_ipld_encoding = { workspace = true }
fvm_shared = { workspace = true }
fvm_sdk = { workspace = true }
multihash-codetable = { workspace = true }
num-traits = { workspace = true }
serde = { workspace = true }
serde_tuple = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion fvm_actor_utils/src/blockstore.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use anyhow::anyhow;
use anyhow::Result;
use cid::multihash::Code;
use cid::Cid;
use fvm_ipld_blockstore::Block;
use fvm_sdk::ipld;
use multihash_codetable::Code;

/// A blockstore that delegates to IPLD syscalls.
#[derive(Default, Debug, Copy, Clone)]
Expand Down
1 change: 1 addition & 0 deletions testing/test_actors/actors/basic_transfer_actor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fvm_ipld_blockstore = { workspace = true }
fvm_ipld_encoding = { workspace = true }
fvm_sdk = { workspace = true }
fvm_shared = { workspace = true }
multihash-codetable = { workspace = true }
serde = { workspace = true }
serde_tuple = { workspace = true }

Expand Down
3 changes: 2 additions & 1 deletion testing/test_actors/actors/basic_transfer_actor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cid::{multihash::Code, Cid};
use cid::Cid;
use frc42_dispatch::{match_method, method_hash};
use frc46_token::receiver::{FRC46TokenReceived, FRC46_TOKEN_TYPE};
use frc46_token::token::types::TransferParams;
Expand All @@ -10,6 +10,7 @@ use fvm_ipld_encoding::{de::DeserializeOwned, RawBytes, DAG_CBOR};
use fvm_sdk as sdk;
use fvm_shared::sys::SendFlags;
use fvm_shared::{address::Address, bigint::Zero, econ::TokenAmount, error::ExitCode};
use multihash_codetable::Code;
use sdk::NO_DATA_BLOCK_ID;

/// Grab the incoming parameters and convert from [`RawBytes`] to the deserialized struct.
Expand Down
1 change: 1 addition & 0 deletions testing/test_actors/actors/frc46_factory_token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fvm_ipld_blockstore = { workspace = true }
fvm_ipld_encoding = { workspace = true }
fvm_sdk = { workspace = true }
fvm_shared = { workspace = true }
multihash-codetable = { workspace = true }
serde = { workspace = true }
serde_tuple = { workspace = true }
thiserror = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fvm_ipld_blockstore = { workspace = true }
fvm_ipld_encoding = { workspace = true }
fvm_sdk = { workspace = true }
fvm_shared = { workspace = true }
multihash-codetable = { workspace = true }
serde = { workspace = true }
serde_tuple = { workspace = true }
thiserror = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cid::{multihash::Code, Cid};
use cid::Cid;
use frc42_dispatch::match_method;
use frc46_token::token::{
state::{StateError, TokenState},
Expand All @@ -24,6 +24,7 @@ use fvm_ipld_encoding::{
use fvm_sdk::error::{StateReadError, StateUpdateError};
use fvm_sdk::{self as sdk, sys::ErrorNumber, NO_DATA_BLOCK_ID};
use fvm_shared::{address::Address, econ::TokenAmount, error::ExitCode, ActorID};
use multihash_codetable::Code;
use serde::{de::DeserializeOwned, ser::Serialize};
use thiserror::Error;

Expand Down

0 comments on commit 1c48e2b

Please sign in to comment.