o1js
o1js copied to clipboard
`PublicKey.assertEquals` doesn't allow giving a 2nd parameter for an error message
All the other built-in provable data structures allow setting an error message for assertions.
But PublicKey.assertEquals(other, msg)
doesn't work, whereas UInt64.assertEquals(other, msg)
works.
Currently I'm achieving the same with PublicKey.equals(other).assertTrue(msg)
Is there a specific reason for it not to work?
If not, being able to set an error message would be great.
Code Sample
import { PrivateKey } from "o1js"
const berzanPublicKey = PrivateKey.random().toPublicKey()
const johnPublicKey = PrivateKey.random().toPublicKey()
berzanPublicKey.assertEquals(johnPublicKey, "blabla blabla") // it doesn't allow a 2nd parameter
berzanPublicKey.equals(johnPublicKey).assertTrue("blabla blabla") // with this way it works