Skip to content

Commit

Permalink
doc: add compact ActorEvent example for doc gen
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Mar 13, 2024
1 parent 324d9b9 commit 4b41344
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 16 deletions.
23 changes: 23 additions & 0 deletions api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
"github.com/filecoin-project/lotus/lib/must"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo/imports"
sealing "github.com/filecoin-project/lotus/storage/pipeline"
Expand Down Expand Up @@ -433,6 +434,28 @@ func init() {
FromHeight: epochPtr(1010),
ToHeight: epochPtr(1020),
})

ae := types.ActorEvent{
Emitter: must.One(address.NewIDAddress(1234)),
Entries: []types.EventEntry{
{
Codec: 81,
Flags: 3,
Key: "$type",
Value: []byte("jallocation"),
},
{
Codec: 81,
Flags: 3,
Key: "client",
Value: []byte("\x19\x03\xf3"),
},
},
Height: abi.ChainEpoch(101010),
MsgCid: cid.MustParse("bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"),
TipSetKey: types.NewTipSetKey(cid.MustParse("bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"), cid.MustParse("bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve")),
}.AsCompactEncoded()
addExample(&ae)
}

func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
Expand Down
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/gateway.json.gz
Binary file not shown.
44 changes: 28 additions & 16 deletions documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -3428,18 +3428,24 @@ Response:
{
"emitter": "f01234",
"entries": [
{
"Codec": 42,
"Flags": 7,
"Key": "string value",
"Value": "Ynl0ZSBhcnJheQ=="
}
[
3,
81,
"$type",
"allocation"
],
[
3,
81,
"client",
1011
]
],
"height": 10101,
"height": 101010,
"msgCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"reverted": true,
"reverted": false,
"tipsetKey": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
Expand Down Expand Up @@ -8876,18 +8882,24 @@ Response:
{
"emitter": "f01234",
"entries": [
{
"Codec": 42,
"Flags": 7,
"Key": "string value",
"Value": "Ynl0ZSBhcnJheQ=="
}
[
3,
81,
"$type",
"allocation"
],
[
3,
81,
"client",
1011
]
],
"height": 10101,
"height": 101010,
"msgCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"reverted": true,
"reverted": false,
"tipsetKey": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
Expand Down

0 comments on commit 4b41344

Please sign in to comment.