|
|
@ -10,7 +10,7 @@ import Data.Text (Text, pack, unpack) |
|
|
|
import Data.Text.Encoding (decodeUtf8) |
|
|
|
import Data.Text.Encoding (decodeUtf8) |
|
|
|
import Data.Text.IO (writeFile) |
|
|
|
import Data.Text.IO (writeFile) |
|
|
|
import Data.Time.Clock.System (getSystemTime, systemSeconds) |
|
|
|
import Data.Time.Clock.System (getSystemTime, systemSeconds) |
|
|
|
import Data.List (nub) |
|
|
|
import Data.List (nub, sort) |
|
|
|
import Text.Printf (printf) |
|
|
|
import Text.Printf (printf) |
|
|
|
|
|
|
|
|
|
|
|
import EVM.Solidity (SourceCache, SrcMap, SolcContract, sourceLines, sourceFiles, runtimeCode, runtimeSrcmap, creationSrcmap) |
|
|
|
import EVM.Solidity (SourceCache, SrcMap, SolcContract, sourceLines, sourceFiles, runtimeCode, runtimeSrcmap, creationSrcmap) |
|
|
@ -57,7 +57,7 @@ markLines codeLines resultMap = V.map markLine (V.indexed codeLines) |
|
|
|
where |
|
|
|
where |
|
|
|
markLine (i, codeLine) = |
|
|
|
markLine (i, codeLine) = |
|
|
|
let results = fromMaybe [] (M.lookup (i+1) resultMap) |
|
|
|
let results = fromMaybe [] (M.lookup (i+1) resultMap) |
|
|
|
in pack $ printf "%-4s| %s" (getMarker <$> results) (unpack codeLine) |
|
|
|
in pack $ printf "%-4s| %s" (sort $ nub $ getMarker <$> results) (unpack codeLine) |
|
|
|
|
|
|
|
|
|
|
|
-- | Select the proper marker, according to the result of the transaction |
|
|
|
-- | Select the proper marker, according to the result of the transaction |
|
|
|
getMarker :: TxResult -> Char |
|
|
|
getMarker :: TxResult -> Char |
|
|
|