Skip to content
Permalink
Browse files

Rename Address { getAddress} to Address { unAddress }

to avoid naming collision with Binary.getAddress.
  • Loading branch information...
Anviking committed Jun 16, 2019
1 parent 688aa40 commit 1b3ff2905dc9b266acd8540ba14d7d982d8e4d46
@@ -527,7 +527,7 @@ isPending = (== Pending) . (status :: TxMeta -> TxStatus) . snd
-- layer and that the underlying encoding is rather agnostic to the underlying
-- backend.
newtype Address = Address
{ getAddress :: ByteString
{ unAddress :: ByteString
} deriving (Show, Generic, Eq, Ord)

instance NFData Address
@@ -538,7 +538,7 @@ instance Buildable Address where
instance ToText Address where
toText = T.decodeUtf8
. convertToBase Base16
. getAddress
. unAddress

instance FromText Address where
fromText = bimap textDecodingError Address
@@ -495,7 +495,7 @@ instance Arbitrary (Proxy DummyTarget) where
arbitrary = pure Proxy

instance EncodeAddress DummyTarget where
encodeAddress _ = T.decodeUtf8 . convertToBase Base16 . getAddress
encodeAddress _ = T.decodeUtf8 . convertToBase Base16 . unAddress

instance DecodeAddress DummyTarget where
decodeAddress _ = bimap decodingError Address
@@ -539,7 +539,7 @@ blockchain =
]
, outputs =
[ TxOut
{ address = Address { getAddress = "\130\216\CANXB\131X\FS!\148\NULDcB\r\237\202\255)\DLEe`\159\a\\-IG\"P\218\136\219i\244\134\161\SOHX\RSX\FS\202>U<\156c\197;\236\EOT\STXC\209\173\138\205B\EOT.\ENQ\ACKG@\174\206\185\ESC\206\NUL\SUB\230\150\192\165" }
{ address = Address { unAddress = "\130\216\CANXB\131X\FS!\148\NULDcB\r\237\202\255)\DLEe`\159\a\\-IG\"P\218\136\219i\244\134\161\SOHX\RSX\FS\202>U<\156c\197;\236\EOT\STXC\209\173\138\205B\EOT.\ENQ\ACKG@\174\206\185\ESC\206\NUL\SUB\230\150\192\165" }
, coin = Coin 3824424245549
}
, TxOut
@@ -634,7 +634,7 @@ blockchain =
, coin = Coin 3827577253906
}
, TxOut
{ address = Address { getAddress = "\130\216\CANXB\131X\FS\167\219!{\ETX\157lP>i~\158\225\DEL\141!.I\248\"\183(\DC13\231\185pU\161\SOHX\RSX\FS\SOH\131\136&\ESC\236\240\200\rw\255.\153\252\&6'\174\159vs\CAN\255\153\USf\155\173\223\NUL\SUB\214\237\RS\248" }
{ address = Address "\130\216\CANXB\131X\FS\167\219!{\ETX\157lP>i~\158\225\DEL\141!.I\248\"\183(\DC13\231\185pU\161\SOHX\RSX\FS\SOH\131\136&\ESC\236\240\200\rw\255.\153\252\&6'\174\159vs\CAN\255\153\USf\155\173\223\NUL\SUB\214\237\RS\248"
, coin = Coin 16837395907
}
]
@@ -764,7 +764,7 @@ blockchain =
, coin = Coin 3832107959251
}
, TxOut
{ address = Address { getAddress = "\130\216\CANXB\131X\FSI\SI\165\f\DLE\223\214\209\206\187y\128F\SUB\248.\203\186/\244\143m1]\n\132\234\"\161\SOHX\RSX\FSv\SI\240\133L\130\194\DC2\191}\189;5\141\252t]\132}[\244\ESC&\SI\EOT[{\238\NUL\SUB\159\236eZ" }
{ address = Address "\130\216\CANXB\131X\FSI\SI\165\f\DLE\223\214\209\206\187y\128F\SUB\248.\203\186/\244\143m1]\n\132\234\"\161\SOHX\RSX\FSv\SI\240\133L\130\194\DC2\191}\189;5\141\252t]\132}[\244\ESC&\SI\EOT[{\238\NUL\SUB\159\236eZ"
, coin = Coin 11823271860
}
]
@@ -107,7 +107,7 @@ emptyAttributes = CBOR.encodeMapLen 0
--
-- [Base58](https://en.wikipedia.org/wiki/Base58)
instance EncodeAddress (HttpBridge (network :: Network)) where
encodeAddress _ = T.decodeUtf8 . encodeBase58 bitcoinAlphabet . getAddress
encodeAddress _ = T.decodeUtf8 . encodeBase58 bitcoinAlphabet . unAddress

-- | Decode a [Base58](https://en.wikipedia.org/wiki/Base58) text string to an
-- 'Address'.
@@ -151,7 +151,7 @@ data JormungandrLayer m = JormungandrLayer
--
-- >>> (Right block) <- runExceptT $ getBlock j t
-- >>> block
-- >>> Block {header = BlockHeader {slotId = SlotId {epochNumber = 0, slotNumber = 0}, prevBlockHash = Hash {getHash = "\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL"}}, transactions = [Tx {inputs = [], outputs = [TxOut {address = Address {getAddress = "3$\195xi\193\"h\154\&5\145}\245:O\"\148\163\165/h^\ENQ\245\248\229;\135\231\234E/"}, coin = Coin {getCoin = 14}}]}]}
-- >>> Block {header = BlockHeader {slotId = SlotId {epochNumber = 0, slotNumber = 0}, prevBlockHash = Hash {getHash = "\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL"}}, transactions = [Tx {inputs = [], outputs = [TxOut {address = Address {unAddress = "3$\195xi\193\"h\154\&5\145}\245:O\"\148\163\165/h^\ENQ\245\248\229;\135\231\234E/"}, coin = Coin {getCoin = 14}}]}]}
--
-- At the time of writing, we only have the genesis-block, but we should be
-- able to get its descendants.

0 comments on commit 1b3ff29

Please sign in to comment.
You can’t perform that action at this time.