Documentation
¶
Overview ¶
package utils contains functions and types to aid compilation and serialization / deserialization
Index ¶
- func AbiEncodeProofAndPublicInputs(proof []byte, publicInputs []byte) ([][]byte, error)
- func CompileWithPuyaPy(filepath string, options string) error
- func DeserializeCompiledCircuit(filepath string) (*ap.CompiledCircuit, error)
- func ProofAndPublicInputsForAtomicComposer(proof []byte, publicInputs []byte) ([]interface{}, error)
- func RenamePuyaPyOutput(oldname string, newname string, dir string) error
- func SerializeCompiledCircuit(cc *ap.CompiledCircuit, filepath string) error
- func ShouldRecompile(targetPath string, sourcePaths ...string) bool
- type CompiledCircuitBytes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbiEncodeProofAndPublicInputs ¶
AbiEncodeProofAndPublicInputs takes a proof and public input binary blob and encodes them itto the ABI format expected by the verifiers
func CompileWithPuyaPy ¶
CompileWithPuyaPy compiles `filepath` with puyapy, with `options'. Leave `options` empty to not pass any options
func DeserializeCompiledCircuit ¶
func DeserializeCompiledCircuit(filepath string) (*ap.CompiledCircuit, error)
DeserializeCompiledCircuit deserializes a compiled circuit from file
func ProofAndPublicInputsForAtomicComposer ¶ added in v0.1.8
func ProofAndPublicInputsForAtomicComposer(proof []byte, publicInputs []byte, ) ([]interface{}, error)
ProofAndPublicInputsForAtomicComposer takes a proof and public input binary blob and returns them in an []interface{} slice for AtomicTransactionComposer to make app args as expected by the verifiers
func RenamePuyaPyOutput ¶
RenamePuyaPyOutput renames puyapy output files, e.g., 'oldname.approval.teal' is renamed to 'newname.approval.teal'. It looks in `dir` for the files to rename, looking for these files: oldname.approval.teal, oldname.clear.teal, oldname.arc32.json, oldname.teal
func SerializeCompiledCircuit ¶
func SerializeCompiledCircuit(cc *ap.CompiledCircuit, filepath string) error
SerializeCompiledCircuit serializes a compiled circuit to file
func ShouldRecompile ¶ added in v0.1.8
shouldRecompile returns true if targetPath is more recent than any of the files in sourcePahts or if it encounters any error