Stop assuming that all transparent addresses are on mainnet #1187
Labels
A-consensus
Area: Consensus rule updates
A-rust
Area: Updates to Rust code
C-bug
Category: This is a bug
Milestone
Currently,
From<Script> for Address
assumes that all addresses are on mainnet.But Zebra needs to support mainnet and testnet.
We should delete
From<Script> for Address
, and use theFrom<ScriptAndNetwork> for Address
in PR #1170.We should also check for any other places in Zebra where we've assumed Mainnet.
Basically, given a script hash alone (as
lock_script
, the one we get from transaction outputs) it is not possible to know to which network it belongs, so i had to create a new typeScriptForNetwork
and implementimpl From<ScriptForNetwork> for Address
to do the conversion.Originally posted by @oxarbitrage in #1170 (comment)
The text was updated successfully, but these errors were encountered: