Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose fromShelleyAddrIsSbe #3606

Merged
merged 1 commit into from Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions cardano-api/src/Cardano/Api/Address.hs
Expand Up @@ -55,6 +55,7 @@ module Cardano.Api.Address (
toShelleyStakeAddr,
toShelleyStakeCredential,
fromShelleyAddr,
fromShelleyAddrIsSbe,
fromShelleyPaymentCredential,
fromShelleyStakeAddr,
fromShelleyStakeCredential,
Expand Down Expand Up @@ -593,6 +594,15 @@ toShelleyStakeReference (StakeAddressByPointer ptr) =
toShelleyStakeReference NoStakeAddress =
Shelley.StakeRefNull

fromShelleyAddrIsSbe :: IsShelleyBasedEra era
=> Shelley.Addr StandardCrypto -> AddressInEra era
fromShelleyAddrIsSbe (Shelley.AddrBootstrap (Shelley.BootstrapAddress addr)) =
AddressInEra ByronAddressInAnyEra (ByronAddress addr)

fromShelleyAddrIsSbe (Shelley.Addr nw pc scr) =
AddressInEra
(ShelleyAddressInEra shelleyBasedEra)
(ShelleyAddress nw pc scr)

fromShelleyAddr
:: ShelleyBasedEra era
Expand Down
1 change: 1 addition & 0 deletions cardano-api/src/Cardano/Api/Shelley.hs
Expand Up @@ -24,6 +24,7 @@ module Cardano.Api.Shelley
Address(ShelleyAddress),
toShelleyAddr,
fromShelleyAddr,
fromShelleyAddrIsSbe,
toShelleyStakeCredential,
fromShelleyStakeCredential,
NetworkId(Mainnet, Testnet),
Expand Down