How to add an opcode to Tezos
opcode, it was easier because
is has close characteristic and so just grep-ed and added.
You can test it via
opcode, it will resemble to
This is the keccak256 in OCaml
You need to cast Tezos type into Michelson type. It's somehow tricky.
Each type has
interface. We can use it.
Be careful that there's
. Tezos typing likes it but Michelson doesn't understand these types.
Non exhaustive enum matching
Each opcode has each type and OCaml has type matcher. The Tezos codebase is saying that "If you add an opcode into enum type, type checker will tell you where to change".
But in reality, some of pattern matcher is squashing via wildcard case matching. And this is OCaml's unsafe anti-pattern.
To solve this, you have to remove willcard case and list all possible types as the matchable cases.