2

Hey guys i'm having trouble with syntax.

let's say in my program i've:

pub enum SomeEnum{

X,
Y(Pubkey, u64),
Z(otherEnum)
}

pub enum otherEnum{
A(u64),
B(u64),
...
}

In my fe/tests

if i want to pass the X it would be - { x: {} },
if i wanted to pass Y it would be - {y:[payee.publicKey, new BN(amount)] }

if i want to pass Z how it would be ?

trying stuff like this but it not working hmm

 { z: { A: new BN(amount) } } 

1 Answer 1

2

Syntax got me but at the end got the answer.

{ z: [{a: [new BN(amount)]}]} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.