Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/apps/explorer_web/lib/phoenix/html/safe.ex

20 lines
448 B

alias Explorer.Chain
alias Explorer.Chain.{Address, Block, Hash, Transaction}
defimpl Phoenix.HTML.Safe, for: [Address, Transaction] do
def to_iodata(%@for{hash: hash}) do
@protocol.to_iodata(hash)
end
end
defimpl Phoenix.HTML.Safe, for: Block do
def to_iodata(%@for{number: number}) do
@protocol.to_iodata(number)
end
end
defimpl Phoenix.HTML.Safe, for: Hash do
def to_iodata(hash) do
Chain.hash_to_iodata(hash)
end
end