testutils

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

package tests contains tests and test helper functions To run the tests, a local network with default configuration is expected to be running. You can use algokit to start one with `algokit localnet start` Custom configuration can be set by changing the exposed variables at the top of the algosdkwrapper/setup.go file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallLogicSigVerifier added in v0.1.6

func CallLogicSigVerifier(appId uint64, schema *sdk.Arc32Schema,
	lsig *crypto.LogicSigAccount, proof []byte, publicInputs []byte, simulate bool,
) error

CallLogicSigVerifier makes an app call to appId's "verify" method signed by lsig with proof and public inputs as arguments, bundled in a transaction group to pool size and opcode budget. If simulate is true, it simulates the group instead of sending it. A local network must be running with default parameters

func CallVerifyMethod

func CallVerifyMethod(appId uint64, proofFilename string, publicInputsFilename string,
	schema *sdk.Arc32Schema, simulate bool) (
	*transaction.ABIMethodResult, error)

CallVerifyMethod calls a verifier smart contract with the given proof and public inputs from file. If simulate is true, it simulates the call instead of sending it, adding the maximum extra opcode budget. A local network must be running

func CreateDirectoryIfNeeded

func CreateDirectoryIfNeeded(dir string) error

CreateDirectoryIfNeeded creates `dir` if it does not exist

func DeployAppWithVerifyMethod added in v0.1.6

func DeployAppWithVerifyMethod(workingDir string,
) (appId uint64, schema *sdk.Arc32Schema, err error)

DeployAppWithVerifyMethod deploys an app with a "verify" method to test logicsig verifiers. A local network must be running with default parameters

func TestCircuitWithGnark

func TestCircuitWithGnark(circuit frontend.Circuit, assignment frontend.Circuit,
	curve ecc.ID) (*ap.CompiledCircuit, *ap.VerifiedProof, error)

TestCircuitWithGnark compiles a circuit and verifies a proof from an assignment using gnark (no interaction with the AVM)

Types

This section is empty.

Directories

Path Synopsis
package algosdkwrapper provides utility functions to interact with an Algorand local network wrapping the go-algorand-sdk.
package algosdkwrapper provides utility functions to interact with an Algorand local network wrapping the go-algorand-sdk.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL