You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following is trying to parse a subnet ID copied from usage.md:
#[test]fnparse_subnet_id(){let id = "/r31415926/t2xwzbdu7z5sam6hc57xxwkctciuaz7oe5omipwbq";SubnetID::from_str(id).unwrap();}
it panics:
---- settings::tests::parse_subnet_id stdout ----
thread 'settings::tests::parse_subnet_id' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidID'
The reason turned out to be that t2 is unparseable, because the fvm_shared::address::network::Network::current_network() is Mainnet by default which has prefix f, and if the prefix is different it returns UnknownNetwork when it tries to parse.
It would be nice if parsing a subnet ID would return the most specific error it can find, because InvalidID is a catch-all for everything: if the rootnet ID isn't a u64, or if any of the children fail to parse. It could instead return the error and the offending part.
The text was updated successfully, but these errors were encountered:
The following is trying to parse a subnet ID copied from
usage.md
:it panics:
The reason turned out to be that
t2
is unparseable, because thefvm_shared::address::network::Network::current_network()
isMainnet
by default which has prefixf
, and if the prefix is different it returnsUnknownNetwork
when it tries to parse.It would be nice if parsing a subnet ID would return the most specific error it can find, because
InvalidID
is a catch-all for everything: if the rootnet ID isn't au64
, or if any of the children fail to parse. It could instead return the error and the offending part.The text was updated successfully, but these errors were encountered: