Skip to content

Use Struct inside a Struct #122

Answered by ThomasPiellard
fosgate29 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @fosgate29 ,

in your case since you need only 3 PublicKeys the simplest solution is to write it like this:

type PublicKey = eddsa.PublicKey

type exoticCircuit struct {
	QuoteQuery   frontend.Variable `gnark:",public"`
	PublicKeyCpt [3]PublicKey      `gnark:",public"`
}

Also the fields in the struct exoticCircuit must be exported for the circuit to be compiled, to do that make sure the name of the fields start with an upper case.

Let us know if you still have issues.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fosgate29
Comment options

Answer selected by fosgate29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants