Skip to main content

Module forms

Module forms 

Source
Expand description

A call’s forms by its operation’s types (core §5.1 “The forms”, §5.2 “The error form”, §7.5, §7.6; #985’s C4c): every operation of every contract travels in them, whatever its types’ kind.

request, a query's payload       CH · record                  the `request` type's tag, width bit 0
value, a reply's payload         CH · run · seq · record      the `response` type's tag (`summary`'s on a summary)
error, a reply_err's payload     CH · run · seq · error       the `error` type's tag, 0 when it declares none

Forms::of reads an operation’s four types once: each one’s tag (FormType::tag), which only a packed type defines (§7.6), and a packed type’s layout, which reads its record under the tag CH carried (FormType::check). wire parses and writes the forms without a contract; this module adds what the types say:

A JSON Schema, protobuf or raw record is carried as its bytes: the runtime encodes and decodes it, on the contract’s encoding (§7.2). A record’s time fields count from the deployment epoch, the writer’s and the reader’s to give (§8.6): no form carries one.

Structs§

FormType
One of an operation’s types as its forms carry it: the tag CH holds, and a packed type’s layout, which reads its record under that tag.
Forms
An operation’s types as its forms carry them (core §5.1, §5.2).

Enums§

RequestRefusal
Why an owner refuses a request, invalid_request either way (core §5.1, “The request”).
WriteRefusal
What Forms::error refuses to write.