Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data UnitTestOptions = UnitTestOptions {
- oracle :: Query -> IO (EVM ())
- verbose :: Bool
- match :: Text
- vmModifier :: VM -> VM
- testParams :: TestVMParams
- data TestVMParams = TestVMParams {}
- defaultGasForCreating :: W256
- defaultGasForInvoking :: W256
- defaultBalanceForCreator :: W256
- defaultBalanceForCreated :: W256
- type ABIMethod = Text
- initializeUnitTest :: UnitTestOptions -> Stepper ()
- runUnitTest :: UnitTestOptions -> ABIMethod -> Stepper Bool
- tick :: Text -> IO ()
- interpret :: UnitTestOptions -> Stepper a -> StateT VM IO (Either Failure a)
- data OpLocation = OpLocation {
- srcCodehash :: !W256
- srcOpIx :: !Int
- srcMapForOpLocation :: DappInfo -> OpLocation -> Maybe SrcMap
- type CoverageState = (VM, MultiSet OpLocation)
- currentOpLocation :: VM -> OpLocation
- execWithCoverage :: StateT CoverageState IO VMResult
- interpretWithCoverage :: UnitTestOptions -> Stepper a -> StateT CoverageState IO (Either Failure a)
- coverageReport :: DappInfo -> MultiSet SrcMap -> Map Text (Vector (Int, ByteString))
- coverageForUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [Text]) -> IO (MultiSet SrcMap)
- runUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [Text]) -> IO Bool
- indentLines :: Int -> Text -> Text
- passOutput :: VM -> DappInfo -> UnitTestOptions -> Text -> Text
- failOutput :: VM -> DappInfo -> UnitTestOptions -> Text -> Text
- formatTestLogs :: Map W256 Event -> Seq Log -> Text
- formatTestLog :: Map W256 Event -> Log -> Maybe Text
- word32Bytes :: Word32 -> ByteString
- setupCall :: Addr -> Text -> W256 -> EVM ()
- initialUnitTestVm :: UnitTestOptions -> SolcContract -> [SolcContract] -> VM
- getParametersFromEnvironmentVariables :: IO TestVMParams
Documentation
data UnitTestOptions Source #
UnitTestOptions | |
|
data TestVMParams Source #
TestVMParams | |
|
initializeUnitTest :: UnitTestOptions -> Stepper () Source #
Assuming a constructor is loaded, this stepper will run the constructor to create the test contract, give it an initial balance, and run `setUp()'.
runUnitTest :: UnitTestOptions -> ABIMethod -> Stepper Bool Source #
Assuming a test contract is loaded and initialized, this stepper will run the specified test method and return whether it succeeded.
data OpLocation Source #
This is like an unresolved source mapping.
OpLocation | |
|
Instances
Eq OpLocation Source # | |
Defined in EVM.UnitTest (==) :: OpLocation -> OpLocation -> Bool # (/=) :: OpLocation -> OpLocation -> Bool # | |
Ord OpLocation Source # | |
Defined in EVM.UnitTest compare :: OpLocation -> OpLocation -> Ordering # (<) :: OpLocation -> OpLocation -> Bool # (<=) :: OpLocation -> OpLocation -> Bool # (>) :: OpLocation -> OpLocation -> Bool # (>=) :: OpLocation -> OpLocation -> Bool # max :: OpLocation -> OpLocation -> OpLocation # min :: OpLocation -> OpLocation -> OpLocation # | |
Show OpLocation Source # | |
Defined in EVM.UnitTest showsPrec :: Int -> OpLocation -> ShowS # show :: OpLocation -> String # showList :: [OpLocation] -> ShowS # |
srcMapForOpLocation :: DappInfo -> OpLocation -> Maybe SrcMap Source #
type CoverageState = (VM, MultiSet OpLocation) Source #
currentOpLocation :: VM -> OpLocation Source #
interpretWithCoverage :: UnitTestOptions -> Stepper a -> StateT CoverageState IO (Either Failure a) Source #
coverageForUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [Text]) -> IO (MultiSet SrcMap) Source #
runUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [Text]) -> IO Bool Source #
passOutput :: VM -> DappInfo -> UnitTestOptions -> Text -> Text Source #
failOutput :: VM -> DappInfo -> UnitTestOptions -> Text -> Text Source #
word32Bytes :: Word32 -> ByteString Source #
initialUnitTestVm :: UnitTestOptions -> SolcContract -> [SolcContract] -> VM Source #