Skip to content

Commit

Permalink
chore(deps): upgrade fvm_shared and cid (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 authored Nov 28, 2024
1 parent eec199d commit a866482
Show file tree
Hide file tree
Showing 64 changed files with 144 additions and 167 deletions.
76 changes: 38 additions & 38 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ members = [
resolver = "2"

[workspace.package]
version = "17.0.3"
version = "18.0.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ChainSafe/fil-actor-states"
authors = [
Expand All @@ -37,63 +37,63 @@ keywords = ["filecoin", "web3", "wasm"]
ahash = "0.8"
anyhow = "1.0"
base64 = "0.22"
bitflags = "2.4.2"
byteorder = "1.4.3"
cid = { version = "0.10", default-features = false, features = ["std"] }
frc42_dispatch = "7.0.0"
frc42_macros = "5"
frc46_token = "11"
fvm_ipld_amt = "0.6.1"
fvm_ipld_bitfield = "0.6"
fvm_ipld_blockstore = "0.2"
fvm_ipld_encoding = "0.4"
fvm_ipld_hamt = "0.9.0"
bitflags = "2"
byteorder = "1"
cid = { version = "0.11", default-features = false, features = ["std"] }
frc42_dispatch = "8"
frc42_macros = "6"
frc46_token = "12"
fvm_ipld_amt = "0.7"
fvm_ipld_bitfield = "0.7"
fvm_ipld_blockstore = "0.3"
fvm_ipld_encoding = "0.5"
fvm_ipld_hamt = "0.10"
fvm_shared = { version = "~2", default-features = false }
fvm_shared3 = { package = "fvm_shared", version = "~3", default-features = false }
fvm_shared4 = { package = "fvm_shared", version = "~4", default-features = false }
hex = "0.4.3"
hex = "0.4"
hex-literal = "0.4"
indexmap = { version = "2", features = ["serde"] }
integer-encoding = { version = "4", default-features = false }
ipld-core = { version = "0.4", features = ["serde"] }
itertools = "0.13"
lazy_static = "1.4"
libipld-core = "0.16"
lazy_static = "1"
log = "0.4"
multihash = "0.18"
num = "0.4.0"
num-bigint = { version = "0.4.3", features = ["serde"] }
multihash-codetable = { version = "0.1", features = ["sha2"] }
num = "0.4"
num-bigint = { version = "0.4", features = ["serde"] }
num-derive = "0.4"
num-traits = "0.2"
parking_lot = "0.12"
paste = "1.0.9"
pretty_assertions = "1.3.0"
paste = "1"
pretty_assertions = "1"
quickcheck = "1"
quickcheck_macros = "1"
rand = "0.8"
regex = "1.10"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
serde_repr = "0.1.18"
serde_tuple = "1.0"
serde_repr = "0.1"
serde_tuple = "1"
serde_yaml = "0.9"
sha2 = "0.10.8"
thiserror = "1.0"
sha2 = "0.10"
thiserror = "2"
toml = "0.8"
uint = { version = "0.9.3", default-features = false }
uint = { version = "0.10", default-features = false }
unsigned-varint = "0.8"

fil_actor_account_state = { version = "17.0.3", path = "./actors/account" }
fil_actor_cron_state = { version = "17.0.3", path = "./actors/cron" }
fil_actor_datacap_state = { version = "17.0.3", path = "./actors/datacap" }
fil_actor_evm_state = { version = "17.0.3", path = "./actors/evm" }
fil_actor_init_state = { version = "17.0.3", path = "./actors/init" }
fil_actor_market_state = { version = "17.0.3", path = "./actors/market" }
fil_actor_miner_state = { version = "17.0.3", path = "./actors/miner" }
fil_actor_multisig_state = { version = "17.0.3", path = "./actors/multisig" }
fil_actor_power_state = { version = "17.0.3", path = "./actors/power" }
fil_actor_reward_state = { version = "17.0.3", path = "./actors/reward" }
fil_actor_system_state = { version = "17.0.3", path = "./actors/system" }
fil_actor_verifreg_state = { version = "17.0.3", path = "./actors/verifreg" }
fil_actors_shared = { version = "17.0.3", path = "./fil_actors_shared" }
fil_actor_account_state = { version = "18.0.0", path = "./actors/account" }
fil_actor_cron_state = { version = "18.0.0", path = "./actors/cron" }
fil_actor_datacap_state = { version = "18.0.0", path = "./actors/datacap" }
fil_actor_evm_state = { version = "18.0.0", path = "./actors/evm" }
fil_actor_init_state = { version = "18.0.0", path = "./actors/init" }
fil_actor_market_state = { version = "18.0.0", path = "./actors/market" }
fil_actor_miner_state = { version = "18.0.0", path = "./actors/miner" }
fil_actor_multisig_state = { version = "18.0.0", path = "./actors/multisig" }
fil_actor_power_state = { version = "18.0.0", path = "./actors/power" }
fil_actor_reward_state = { version = "18.0.0", path = "./actors/reward" }
fil_actor_system_state = { version = "18.0.0", path = "./actors/system" }
fil_actor_verifreg_state = { version = "18.0.0", path = "./actors/verifreg" }
fil_actors_shared = { version = "18.0.0", path = "./fil_actors_shared" }

fil_actors_test_utils = { path = "./fil_actors_test_utils" }
5 changes: 2 additions & 3 deletions actors/evm/src/evm_shared/v10/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ pub struct EthAddress(#[serde(with = "strict_bytes")] pub [u8; 20]);
/// Per the EVM spec, this simply discards the high bytes.
impl From<U256> for EthAddress {
fn from(v: U256) -> Self {
let mut bytes = [0u8; 32];
v.to_big_endian(&mut bytes);
let bytes = v.to_big_endian();
Self(bytes[12..].try_into().unwrap())
}
}
Expand Down Expand Up @@ -128,7 +127,7 @@ mod tests {
#[test]
fn $name() {
let evm_bytes = $input.concat();
let evm_addr = EthAddress::from(U256::from(evm_bytes.as_slice()));
let evm_addr = EthAddress::from(U256::from_big_endian(evm_bytes.as_slice()));
assert_eq!(
evm_addr.as_id(),
$expectation
Expand Down
14 changes: 5 additions & 9 deletions actors/evm/src/evm_shared/v10/uints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ impl U256 {
}

pub fn to_bytes(&self) -> [u8; 32] {
let mut buf = [0u8; 32];
self.to_big_endian(&mut buf);
buf
self.to_big_endian()
}

/// Returns the low 64 bits, saturating the value to u64 max if it is larger
Expand All @@ -175,7 +173,7 @@ impl U512 {
impl From<&TokenAmount> for U256 {
fn from(amount: &TokenAmount) -> U256 {
let (_, bytes) = amount.atto().to_bytes_be();
U256::from(bytes.as_slice())
U256::from_big_endian(bytes.as_slice())
}
}

Expand All @@ -188,8 +186,7 @@ impl From<U256> for U512 {

impl From<&U256> for TokenAmount {
fn from(ui: &U256) -> TokenAmount {
let mut bits = [0u8; 32];
ui.to_big_endian(&mut bits);
let bits = ui.to_big_endian();
TokenAmount::from_atto(BigInt::from_bytes_be(
fvm_shared3::bigint::Sign::Plus,
&bits,
Expand All @@ -202,8 +199,7 @@ impl Serialize for U256 {
where
S: serde::Serializer,
{
let mut bytes = [0u8; 32];
self.to_big_endian(&mut bytes);
let bytes = self.to_big_endian();
serializer.serialize_bytes(zeroless_view(&bytes))
}
}
Expand Down Expand Up @@ -316,7 +312,7 @@ mod tests {
let one = U256::ONE.i256_neg();
assert!(one.i256_is_negative());

let neg_one = U256::from(&[0xff; 32]);
let neg_one = U256::from_big_endian(&[0xff; 32]);
let pos_one = neg_one.i256_neg();
assert_eq!(pos_one, U256::ONE);
}
Expand Down
5 changes: 2 additions & 3 deletions actors/evm/src/evm_shared/v11/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ pub struct EthAddress(#[serde(with = "strict_bytes")] pub [u8; 20]);
/// Per the EVM spec, this simply discards the high bytes.
impl From<U256> for EthAddress {
fn from(v: U256) -> Self {
let mut bytes = [0u8; 32];
v.to_big_endian(&mut bytes);
let bytes = v.to_big_endian();
Self(bytes[12..].try_into().unwrap())
}
}
Expand Down Expand Up @@ -128,7 +127,7 @@ mod tests {
#[test]
fn $name() {
let evm_bytes = $input.concat();
let evm_addr = EthAddress::from(U256::from(evm_bytes.as_slice()));
let evm_addr = EthAddress::from(U256::from_big_endian(evm_bytes.as_slice()));
assert_eq!(
evm_addr.as_id(),
$expectation
Expand Down
14 changes: 5 additions & 9 deletions actors/evm/src/evm_shared/v11/uints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ impl U256 {
}

pub fn to_bytes(&self) -> [u8; 32] {
let mut buf = [0u8; 32];
self.to_big_endian(&mut buf);
buf
self.to_big_endian()
}

/// Returns the low 64 bits, saturating the value to u64 max if it is larger
Expand All @@ -176,7 +174,7 @@ impl U512 {
impl From<&TokenAmount> for U256 {
fn from(amount: &TokenAmount) -> U256 {
let (_, bytes) = amount.atto().to_bytes_be();
U256::from(bytes.as_slice())
U256::from_big_endian(bytes.as_slice())
}
}

Expand All @@ -189,8 +187,7 @@ impl From<U256> for U512 {

impl From<&U256> for TokenAmount {
fn from(ui: &U256) -> TokenAmount {
let mut bits = [0u8; 32];
ui.to_big_endian(&mut bits);
let bits = ui.to_big_endian();
TokenAmount::from_atto(BigInt::from_bytes_be(
fvm_shared3::bigint::Sign::Plus,
&bits,
Expand All @@ -203,8 +200,7 @@ impl Serialize for U256 {
where
S: serde::Serializer,
{
let mut bytes = [0u8; 32];
self.to_big_endian(&mut bytes);
let bytes = self.to_big_endian();
serializer.serialize_bytes(zeroless_view(&bytes))
}
}
Expand Down Expand Up @@ -317,7 +313,7 @@ mod tests {
let one = U256::ONE.i256_neg();
assert!(one.i256_is_negative());

let neg_one = U256::from(&[0xff; 32]);
let neg_one = U256::from_big_endian(&[0xff; 32]);
let pos_one = neg_one.i256_neg();
assert_eq!(pos_one, U256::ONE);
}
Expand Down
5 changes: 2 additions & 3 deletions actors/evm/src/evm_shared/v12/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ pub struct EthAddress(#[serde(with = "strict_bytes")] pub [u8; 20]);
/// Per the EVM spec, this simply discards the high bytes.
impl From<U256> for EthAddress {
fn from(v: U256) -> Self {
let mut bytes = [0u8; 32];
v.to_big_endian(&mut bytes);
let bytes = v.to_big_endian();
Self(bytes[12..].try_into().unwrap())
}
}
Expand Down Expand Up @@ -128,7 +127,7 @@ mod tests {
#[test]
fn $name() {
let evm_bytes = $input.concat();
let evm_addr = EthAddress::from(U256::from(evm_bytes.as_slice()));
let evm_addr = EthAddress::from(U256::from_big_endian(evm_bytes.as_slice()));
assert_eq!(
evm_addr.as_id(),
$expectation
Expand Down
14 changes: 5 additions & 9 deletions actors/evm/src/evm_shared/v12/uints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ impl U256 {
}

pub fn to_bytes(&self) -> [u8; 32] {
let mut buf = [0u8; 32];
self.to_big_endian(&mut buf);
buf
self.to_big_endian()
}

/// Returns the low 64 bits, saturating the value to u64 max if it is larger
Expand All @@ -170,7 +168,7 @@ impl U512 {
impl From<&TokenAmount> for U256 {
fn from(amount: &TokenAmount) -> U256 {
let (_, bytes) = amount.atto().to_bytes_be();
U256::from(bytes.as_slice())
U256::from_big_endian(bytes.as_slice())
}
}

Expand All @@ -183,8 +181,7 @@ impl From<U256> for U512 {

impl From<&U256> for TokenAmount {
fn from(ui: &U256) -> TokenAmount {
let mut bits = [0u8; 32];
ui.to_big_endian(&mut bits);
let bits = ui.to_big_endian();
TokenAmount::from_atto(BigInt::from_bytes_be(
fvm_shared4::bigint::Sign::Plus,
&bits,
Expand All @@ -197,8 +194,7 @@ impl Serialize for U256 {
where
S: serde::Serializer,
{
let mut bytes = [0u8; 32];
self.to_big_endian(&mut bytes);
let bytes = self.to_big_endian();
serializer.serialize_bytes(zeroless_view(&bytes))
}
}
Expand Down Expand Up @@ -315,7 +311,7 @@ mod tests {
let one = U256::ONE.i256_neg();
assert!(one.i256_is_negative());

let neg_one = U256::from(&[0xff; 32]);
let neg_one = U256::from_big_endian(&[0xff; 32]);
let pos_one = neg_one.i256_neg();
assert_eq!(pos_one, U256::ONE);
}
Expand Down
5 changes: 2 additions & 3 deletions actors/evm/src/evm_shared/v13/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ pub struct EthAddress(#[serde(with = "strict_bytes")] pub [u8; 20]);
/// Per the EVM spec, this simply discards the high bytes.
impl From<U256> for EthAddress {
fn from(v: U256) -> Self {
let mut bytes = [0u8; 32];
v.to_big_endian(&mut bytes);
let bytes = v.to_big_endian();
Self(bytes[12..].try_into().unwrap())
}
}
Expand Down Expand Up @@ -125,7 +124,7 @@ mod tests {
#[test]
fn $name() {
let evm_bytes = $input.concat();
let evm_addr = EthAddress::from(U256::from(evm_bytes.as_slice()));
let evm_addr = EthAddress::from(U256::from_big_endian(evm_bytes.as_slice()));
assert_eq!(
evm_addr.as_id(),
$expectation
Expand Down
14 changes: 5 additions & 9 deletions actors/evm/src/evm_shared/v13/uints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ impl U256 {
}

pub fn to_bytes(&self) -> [u8; 32] {
let mut buf = [0u8; 32];
self.to_big_endian(&mut buf);
buf
self.to_big_endian()
}

/// Returns the low 64 bits, saturating the value to u64 max if it is larger
Expand All @@ -167,7 +165,7 @@ impl U512 {
impl From<&TokenAmount> for U256 {
fn from(amount: &TokenAmount) -> U256 {
let (_, bytes) = amount.atto().to_bytes_be();
U256::from(bytes.as_slice())
U256::from_big_endian(bytes.as_slice())
}
}

Expand All @@ -180,8 +178,7 @@ impl From<U256> for U512 {

impl From<&U256> for TokenAmount {
fn from(ui: &U256) -> TokenAmount {
let mut bits = [0u8; 32];
ui.to_big_endian(&mut bits);
let bits = ui.to_big_endian();
TokenAmount::from_atto(BigInt::from_bytes_be(
fvm_shared4::bigint::Sign::Plus,
&bits,
Expand All @@ -194,8 +191,7 @@ impl Serialize for U256 {
where
S: serde::Serializer,
{
let mut bytes = [0u8; 32];
self.to_big_endian(&mut bytes);
let bytes = self.to_big_endian();
serializer.serialize_bytes(zeroless_view(&bytes))
}
}
Expand Down Expand Up @@ -312,7 +308,7 @@ mod tests {
let one = U256::ONE.i256_neg();
assert!(one.i256_is_negative());

let neg_one = U256::from(&[0xff; 32]);
let neg_one = U256::from_big_endian(&[0xff; 32]);
let pos_one = neg_one.i256_neg();
assert_eq!(pos_one, U256::ONE);
}
Expand Down
Loading

0 comments on commit a866482

Please sign in to comment.