Documentation ¶
Index ¶
- Variables
- func AssertMsgResult(r Reporter, expected *schema.Receipt, actual *vm.ApplyRet, label string)
- func ExecuteMessageVector(r Reporter, vector *schema.TestVector)
- func ExecuteTipsetVector(r Reporter, vector *schema.TestVector)
- func LoadVectorCAR(vectorCAR schema.Base64EncodedBytes) (blockstore.Blockstore, error)
- type Driver
- type DriverOpts
- type ExecuteMessageParams
- type ExecuteTipsetResult
- type LogReporter
- func (l *LogReporter) Errorf(format string, args ...interface{})
- func (*LogReporter) FailNow()
- func (l *LogReporter) Failed() bool
- func (l *LogReporter) Fatalf(format string, args ...interface{})
- func (*LogReporter) Helper()
- func (*LogReporter) Log(args ...interface{})
- func (*LogReporter) Logf(format string, args ...interface{})
- type Reporter
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultCirculatingSupply is the fallback circulating supply returned by // the driver's CircSupplyCalculator function, used if the vector specifies // no circulating supply. DefaultCirculatingSupply = types.TotalFilecoinInt // DefaultBaseFee to use in the VM, if one is not supplied in the vector. DefaultBaseFee = abi.NewTokenAmount(100) )
Functions ¶
func AssertMsgResult ¶ added in v0.8.1
AssertMsgResult compares a message result. It takes the expected receipt encoded in the vector, the actual receipt returned by Lotus, and a message label to log in the assertion failure message to facilitate debugging.
func ExecuteMessageVector ¶ added in v0.8.1
func ExecuteMessageVector(r Reporter, vector *schema.TestVector)
ExecuteMessageVector executes a message-class test vector.
func ExecuteTipsetVector ¶ added in v0.8.1
func ExecuteTipsetVector(r Reporter, vector *schema.TestVector)
ExecuteTipsetVector executes a tipset-class test vector.
func LoadVectorCAR ¶ added in v0.8.1
func LoadVectorCAR(vectorCAR schema.Base64EncodedBytes) (blockstore.Blockstore, error)
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) ExecuteMessage ¶
func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageParams) (*vm.ApplyRet, cid.Cid, error)
ExecuteMessage executes a conformance test vector message in a temporary VM.
func (*Driver) ExecuteTipset ¶ added in v0.5.8
func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, preroot cid.Cid, parentEpoch abi.ChainEpoch, tipset *schema.Tipset) (*ExecuteTipsetResult, error)
ExecuteTipset executes the supplied tipset on top of the state represented by the preroot CID.
parentEpoch is the last epoch in which an actual tipset was processed. This is used by Lotus for null block counting and cron firing.
This method returns the the receipts root, the poststate root, and the VM message results. The latter _include_ implicit messages, such as cron ticks and reward withdrawal per miner.
type DriverOpts ¶ added in v0.8.1
type DriverOpts struct { // DisableVMFlush, when true, avoids calling VM.Flush(), forces a blockstore // recursive copy, from the temporary buffer blockstore, to the real // system's blockstore. Disabling VM flushing is useful when extracting test // vectors and trimming state, as we don't want to force an accidental // deep copy of the state tree. // // Disabling VM flushing almost always should go hand-in-hand with // LOTUS_DISABLE_VM_BUF=iknowitsabadidea. That way, state tree writes are // immediately committed to the blockstore. DisableVMFlush bool }
type ExecuteMessageParams ¶ added in v0.8.1
type ExecuteMessageParams struct { Preroot cid.Cid Epoch abi.ChainEpoch Message *types.Message CircSupply *abi.TokenAmount BaseFee *abi.TokenAmount }
type ExecuteTipsetResult ¶ added in v0.5.8
type ExecuteTipsetResult struct { ReceiptsRoot cid.Cid PostStateRoot cid.Cid // AppliedMessages stores the messages that were applied, in the order they // were applied. It includes implicit messages (cron, rewards). AppliedMessages []*types.Message // AppliedResults stores the results of AppliedMessages, in the same order. AppliedResults []*vm.ApplyRet }
type LogReporter ¶ added in v0.8.1
type LogReporter struct {
// contains filtered or unexported fields
}
LogReporter wires the Reporter methods to the log package. It is appropriate to use when calling the Execute* functions from a standalone CLI program.
func (*LogReporter) Errorf ¶ added in v0.8.1
func (l *LogReporter) Errorf(format string, args ...interface{})
func (*LogReporter) FailNow ¶ added in v0.8.1
func (*LogReporter) FailNow()
func (*LogReporter) Failed ¶ added in v0.8.1
func (l *LogReporter) Failed() bool
func (*LogReporter) Fatalf ¶ added in v0.8.1
func (l *LogReporter) Fatalf(format string, args ...interface{})
func (*LogReporter) Helper ¶ added in v0.8.1
func (*LogReporter) Helper()
func (*LogReporter) Log ¶ added in v0.8.1
func (*LogReporter) Log(args ...interface{})
func (*LogReporter) Logf ¶ added in v0.8.1
func (*LogReporter) Logf(format string, args ...interface{})
type Reporter ¶ added in v0.8.1
type Reporter interface { Helper() Log(args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Logf(format string, args ...interface{}) FailNow() Failed() bool }
Reporter is a contains a subset of the testing.T methods, so that the Execute* functions in this package can be used inside or outside of go test runs.