Skip to content

Commit

Permalink
Fix versionned address limitation and add factory logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitu33 committed May 25, 2023
1 parent b175bab commit c96cfaf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion massa-models/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ impl AddressDeserializer {
/// Creates a new deserializer for `Address`
pub const fn new() -> Self {
Self {
type_deserializer: U64VarIntDeserializer::new(Included(0), Excluded(1)),
type_deserializer: U64VarIntDeserializer::new(Included(0), Included(1)),
version_deserializer: U64VarIntDeserializer::new(Included(0), Excluded(u64::MAX)),
hash_deserializer: HashDeserializer::new(),
}
Expand Down
7 changes: 6 additions & 1 deletion massa-versioning/src/address_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use massa_hash::Hash;
use massa_models::address::{
Address, SCAddress, SCAddressV0, SCAddressV1, UserAddress, UserAddressV0, UserAddressV1,
};
use tracing::debug;

#[derive(Clone)]
pub struct AddressFactory {
Expand Down Expand Up @@ -46,9 +47,13 @@ impl VersioningFactory for AddressFactory {
},
1 => match args {
AddressArgs::User { hash } => {
debug!("(FACTORY LOG) UserAddressV1 created");
Address::User(UserAddress::UserAddressV1(UserAddressV1(*hash)))
}
AddressArgs::SC { hash } => Address::SC(SCAddress::SCAddressV1(SCAddressV1(*hash))),
AddressArgs::SC { hash } => {
debug!("(FACTORY LOG) SCAddressV1 created");
Address::SC(SCAddress::SCAddressV1(SCAddressV1(*hash)))
}
},
v => return Err(FactoryError::UnimplementedVersion(v)),
};
Expand Down

0 comments on commit c96cfaf

Please sign in to comment.