Skip to content

Commit

Permalink
use PAYLOAD_HASH_LEN for EAM subaddress
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs committed Apr 14, 2023
1 parent da9f4fe commit b175d54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions utils/forest_shim/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use fvm_shared::address::Address as Address_v2;
use fvm_shared3::address::Address as Address_v3;
pub use fvm_shared3::address::{
current_network, set_current_network, Error, Network, Payload, Protocol, BLS_PUB_LEN,
PAYLOAD_HASH_LEN,
};
use serde::{Deserialize, Serialize};

Expand Down
11 changes: 8 additions & 3 deletions vm/state_migration/src/nv18/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ use cid::{multihash::Code::Blake2b256, Cid};
use fil_actor_init_v10::State as StateV10;
use fil_actor_init_v9::State as StateV9;
use fil_actors_runtime_v10::{make_map_with_root, Map};
use forest_shim::{address::Address, state_tree::ActorID};
use forest_shim::{
address::{Address, PAYLOAD_HASH_LEN},
state_tree::ActorID,
};
use forest_utils::db::BlockstoreExt;
use fvm_ipld_blockstore::Blockstore;

Expand Down Expand Up @@ -38,8 +41,10 @@ impl<BS: Blockstore + Clone + Send + Sync> ActorMigration<BS> for InitMigrator {
.map_err(|e| anyhow::anyhow!("{e}"))?;

let actor_id = in_state.next_id;
let eth_zero_addr =
Address::new_delegated(Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR.id()?, &[0; 20])?;
let eth_zero_addr = Address::new_delegated(
Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR.id()?,
&[0; PAYLOAD_HASH_LEN],
)?;
in_addr_map.set(eth_zero_addr.to_bytes().into(), actor_id)?;

let out_state = StateV10 {
Expand Down

0 comments on commit b175d54

Please sign in to comment.