hevm-0.51.1: Ethereum virtual machine evaluator
Safe HaskellSafe-Inferred
LanguageGHC2021

EVM.UnitTest

Synopsis

Documentation

makeVeriOpts :: UnitTestOptions -> VeriOpts Source #

Generate VeriOpts from UnitTestOptions

unitTest :: UnitTestOptions -> Contracts -> Maybe String -> IO Bool Source #

Top level CLI endpoint for hevm test

initializeUnitTest :: UnitTestOptions -> SolcContract -> 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.

fuzzTest :: UnitTestOptions -> Text -> [AbiType] -> VM -> Property Source #

Randomly generates the calldata arguments and runs the test

tick :: Text -> IO () Source #

data OpLocation Source #

This is like an unresolved source mapping.

Constructors

OpLocation 

Instances

Instances details
Show OpLocation Source # 
Instance details

Defined in EVM.UnitTest

Eq OpLocation Source # 
Instance details

Defined in EVM.UnitTest

Ord OpLocation Source # 
Instance details

Defined in EVM.UnitTest

initialExplorationStepper :: UnitTestOptions -> ABIMethod -> [ExploreTx] -> [Addr] -> Int -> Stepper (Bool, RLP) Source #

Runs an invariant test, calls the invariant before execution begins

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

symRun :: UnitTestOptions -> VM -> Text -> [AbiType] -> IO (Text, Either Text Text, VM) Source #

Define the thread spawner for symbolic tests

prettyCalldata :: (?context :: DappContext) => SMTCex -> Expr Buf -> Text -> [AbiType] -> Text Source #

showCalldata :: (?context :: DappContext) => SMTCex -> [AbiType] -> Expr Buf -> Text Source #

formatTestLogs :: (?context :: DappContext) => Map W256 Event -> [Expr Log] -> Text Source #