MCPcopy Create free account
hub / github.com/ElementsProject/elements / setTypeBack

Function setTypeBack

src/simplicity/type.h:91–100  ·  view source on GitHub ↗

Precondition: type type_dag[i] and 'type_dag' is well-formed. * if type_dag[i] is a non-trival 'PRODUCT', then both of its two type arguments are non-trival. * Postconditon: value == type_dag[i] */

Source from the content-addressed store, hash-verified

89 * Postconditon: value == type_dag[i]
90 */
91static inline void setTypeBack(size_t i, type* type_dag, size_t value) {
92 /* .back cannot be used if .skip is in use.
93 Specifically it cannot be a non-trivial 'PRODUCT' type where one of its two type arguments is a trivial type.
94 */
95 simplicity_assert((PRODUCT != type_dag[i].kind ||
96 0 == type_dag[i].bitSize ||
97 (0 != type_dag[type_dag[i].typeArg[0]].bitSize &&
98 0 != type_dag[type_dag[i].typeArg[1]].bitSize)));
99 type_dag[i].back = value;
100}
101#endif

Callers 2

writeValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected