Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data UnitTestOptions = UnitTestOptions {}
- data TestVMParams = TestVMParams {
- testAddress :: Addr
- testCaller :: Addr
- testOrigin :: Addr
- testGasCreate :: W256
- testGasCall :: W256
- testBalanceCreate :: W256
- testBalanceCall :: W256
- testCoinbase :: Addr
- testNumber :: W256
- testTimestamp :: W256
- testGaslimit :: W256
- testGasprice :: W256
- testMaxCodeSize :: W256
- testDifficulty :: W256
- testChainId :: W256
- defaultGasForCreating :: W256
- defaultGasForInvoking :: W256
- defaultBalanceForCreator :: W256
- defaultBalanceForCreated :: W256
- defaultMaxCodeSize :: W256
- type ABIMethod = Text
- initializeUnitTest :: UnitTestOptions -> Stepper ()
- runUnitTest :: UnitTestOptions -> ABIMethod -> AbiValue -> Stepper Bool
- execTest :: UnitTestOptions -> ABIMethod -> AbiValue -> Stepper Bool
- checkFailures :: UnitTestOptions -> ABIMethod -> AbiValue -> Bool -> Stepper Bool
- fuzzTest :: UnitTestOptions -> Text -> [AbiType] -> VM -> Property
- tick :: Text -> IO ()
- 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
- runWithCoverage :: StateT CoverageState IO VM
- interpretWithCoverage :: UnitTestOptions -> Stepper a -> StateT CoverageState IO a
- coverageReport :: DappInfo -> MultiSet SrcMap -> Map Text (Vector (Int, ByteString))
- coverageForUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [(Text, [AbiType])]) -> IO (MultiSet SrcMap)
- runUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [(Text, [AbiType])]) -> IO [(Bool, VM)]
- runTest :: UnitTestOptions -> VM -> (Text, [AbiType]) -> IO (Text, Either Text Text, VM)
- runOne :: UnitTestOptions -> VM -> ABIMethod -> AbiValue -> IO (Text, Either Text Text, VM)
- fuzzRun :: UnitTestOptions -> VM -> Text -> [AbiType] -> IO (Text, Either Text Text, VM)
- indentLines :: Int -> Text -> Text
- passOutput :: VM -> UnitTestOptions -> Text -> Text
- failOutput :: VM -> UnitTestOptions -> Text -> Text
- formatTestLogs :: Map W256 Event -> Seq Log -> Text
- formatTestLog :: Map W256 Event -> Log -> Maybe Text
- word32Bytes :: Word32 -> ByteString
- setupCall :: TestVMParams -> Text -> AbiValue -> EVM ()
- initialUnitTestVm :: UnitTestOptions -> SolcContract -> VM
- maybeM :: Monad m => b -> (a -> b) -> m (Maybe a) -> m b
- getParametersFromEnvironmentVariables :: Maybe Text -> IO TestVMParams
Documentation
data UnitTestOptions Source #
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 -> AbiValue -> Stepper Bool Source #
Assuming a test contract is loaded and initialized, this stepper will run the specified test method and return whether it succeeded.
checkFailures :: UnitTestOptions -> ABIMethod -> AbiValue -> Bool -> Stepper Bool Source #
fuzzTest :: UnitTestOptions -> Text -> [AbiType] -> VM -> Property Source #
Randomly generates the calldata arguments and runs the test
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 a Source #
coverageForUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [(Text, [AbiType])]) -> IO (MultiSet SrcMap) Source #
runUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [(Text, [AbiType])]) -> IO [(Bool, VM)] Source #
runOne :: UnitTestOptions -> VM -> ABIMethod -> AbiValue -> IO (Text, Either Text Text, VM) Source #
Define the thread spawner for normal test cases
fuzzRun :: UnitTestOptions -> VM -> Text -> [AbiType] -> IO (Text, Either Text Text, VM) Source #
Define the thread spawner for property based tests
passOutput :: VM -> UnitTestOptions -> Text -> Text Source #
failOutput :: VM -> UnitTestOptions -> Text -> Text Source #
word32Bytes :: Word32 -> ByteString Source #
initialUnitTestVm :: UnitTestOptions -> SolcContract -> VM Source #