Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
"items": {
"type": "string"
}
},
"_debug":{
"title": "any kind of debug information",
"type": "string"
}
}
},
Expand Down Expand Up @@ -332,6 +336,25 @@
}
}
}
},
"tipset_cids": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"epoch",
"cid"
],
"properties": {
"epoch": {
"type": "integer"
},
"cid": {
"$ref": "#/definitions/cid"
}
}
}
}
},
"required": [
Expand Down Expand Up @@ -386,6 +409,10 @@
"description": "the gzipped, base64 CAR containing the pre- and post-condition state trees for this test vector",
"$ref": "#/definitions/base64"
},
"chain_id": {
"title": "the chain id of the network",
"type": "number"
},
"randomness": {
"title": "randomness to be replayed during the execution of the test vector",
"$ref": "#/definitions/randomness"
Expand All @@ -395,6 +422,30 @@
},
"postconditions": {
"$ref": "#/definitions/postconditions"
},
"skip_compare_gas_used": {
"type": "boolean"
},
"skip_compare_addresses": {
"type": "array",
"items": {
"type": "string"
}
},
"skip_compare_actor_ids": {
"type": "array",
"items": {
"type": "number"
}
},
"additional_compare_addresses": {
"type": "array",
"items": {
"type": "string"
}
},
"tipset_cids": {
"$ref": "#/definitions/tipset_cids"
}
},
"allOf": [
Expand Down
15 changes: 15 additions & 0 deletions schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type Metadata struct {
Comment string `json:"comment,omitempty"`
Gen []GenerationData `json:"gen"`
Tags []string `json:"tags,omitempty"`
Debug string `json:"_debug,omitempty"`
}

// GenerationData tags the source of this test case.
Expand Down Expand Up @@ -169,6 +170,11 @@ type Diagnostics struct {
Data Base64EncodedBytes `json:"data"`
}

type TipsetCid struct {
Epoch int64 `json:"epoch"`
Cid cid.Cid `json:"cid"`
}

// TestVector is a single, faceted test case. The test case can be run against
// the multiple facets expressed in the preconditions field.
type TestVector struct {
Expand All @@ -186,6 +192,8 @@ type TestVector struct {

Meta *Metadata `json:"_meta"`

ChainId uint64 `json:"chain_id"`

// CAR binary data to be loaded into the test environment, usually a CAR
// containing multiple state trees, addressed by root CID from the relevant
// objects.
Expand All @@ -202,6 +210,13 @@ type TestVector struct {

Post *Postconditions `json:"postconditions"`
Diagnostics *Diagnostics `json:"diagnostics,omitempty"`

SkipCompareGasUsed bool `json:"skip_compare_gas_used"`
SkipCompareAddresses []address.Address `json:"skip_compare_addresses,omitempty"`
SkipCompareActorIds []uint64 `json:"skip_compare_actor_ids,omitempty"`
AdditionalCompareAddresses []address.Address `json:"additional_compare_addresses,omitempty"`

TipsetCids []TipsetCid `json:"tipset_cids,omitempty"`
}

type Message struct {
Expand Down