rvv040 #67

Merged
pitmutt merged 4 commits from rvv040 into dev040 2024-04-24 17:00:41 +00:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit ebfac8438f - Show all commits

View file

@ -159,8 +159,8 @@ encodeExchangeAddress net tr = do
Just vhash Just vhash
_ -> Nothing _ -> Nothing
-- | Decode an Exchange Address into a TransparentAddress -- | Decode an Exchange Address into a ExchangeAddress
decodeExchangeAddress:: T.Text-> Maybe TransparentAddress decodeExchangeAddress:: T.Text-> Maybe ExchangeAddress
decodeExchangeAddress ex = do decodeExchangeAddress ex = do
if (T.length ex ) > 1 if (T.length ex ) > 1
then do then do
@ -174,12 +174,12 @@ decodeExchangeAddress ex = do
let transparentReceiver = bytes rawd let transparentReceiver = bytes rawd
if hr == tMain if hr == tMain
then Just $ then Just $
TransparentAddress MainNet $ ExchangeAddress MainNet $
TransparentReceiver P2PKH (fromRawBytes transparentReceiver) TransparentReceiver P2PKH (fromRawBytes transparentReceiver)
else do else do
if hr == tTest if hr == tTest
then Just $ then Just $
TransparentAddress TestNet $ ExchangeAddress TestNet $
TransparentReceiver P2PKH (fromRawBytes transparentReceiver) TransparentReceiver P2PKH (fromRawBytes transparentReceiver)
else Nothing else Nothing
else Nothing else Nothing

View file

@ -1081,8 +1081,8 @@ main = do
case exch of case exch of
Nothing -> assertFailure "Failed to encode Exchange address" Nothing -> assertFailure "Failed to encode Exchange address"
Just addr -> do Just addr -> do
let tadr = decodeExchangeAddress addr let eadr = decodeExchangeAddress addr
tadr `shouldNotBe` Nothing eadr `shouldNotBe` Nothing
-- | Properties -- | Properties
prop_PhraseLength :: Property prop_PhraseLength :: Property