Skip to content

Commit

Permalink
Make the makeByronAddress arg order consistent with the Shelley one
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoutts committed Jul 8, 2020
1 parent 59caced commit 29b76aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cardano-api/src/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -709,13 +709,13 @@ instance SerialiseAddress StakeAddress where
deserialiseFromBech32 AsStakeAddress t


makeByronAddress :: VerificationKey ByronKey
-> NetworkId
makeByronAddress :: NetworkId
-> VerificationKey ByronKey
-> Address era
makeByronAddress (ByronVerificationKey vk) nid =
makeByronAddress nw (ByronVerificationKey vk) =
ByronAddress $
Byron.makeVerKeyAddress
(toByronNetworkMagic nid)
(toByronNetworkMagic nw)
vk


Expand Down
11 changes: 8 additions & 3 deletions cardano-api/test/Test/Cardano/Api/Typed/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ import Test.Cardano.Api.Gen (genSeed)
import Test.Cardano.Api.Orphans ()

genAddressByron :: Gen (Address Byron)
genAddressByron = makeByronAddress <$> genVerificationKey AsByronKey <*> genNetworkId
genAddressByron = makeByronAddress <$> genNetworkId
<*> genVerificationKey AsByronKey

genAddressShelley :: Gen (Address Shelley)
genAddressShelley =
Gen.choice
[ makeShelleyAddress <$> genNetworkId <*> genPaymentCredential <*> genStakeAddressReference
, makeByronAddress <$> genVerificationKey AsByronKey <*> genNetworkId
[ makeShelleyAddress <$> genNetworkId
<*> genPaymentCredential
<*> genStakeAddressReference

, makeByronAddress <$> genNetworkId
<*> genVerificationKey AsByronKey
]

genKESPeriod :: Gen KESPeriod
Expand Down

0 comments on commit 29b76aa

Please sign in to comment.