Skip to content

Commit

Permalink
fix: md lint
Browse files Browse the repository at this point in the history
  • Loading branch information
j1mbo64 committed Jul 27, 2024
1 parent 58ad0f6 commit 8c59c61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/how-to-add-an-opcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
- [Bitcoin Script Wiki](https://en.bitcoin.it/wiki/Script)
- [Reference implementation in btcd](https://github.com/btcsuite/btcd/blob/b161cd6a199b4e35acec66afc5aad221f05fe1e3/txscript/opcode.go#L312)
- In btcd find the function that matches the last element in `opcodeArray` for the specified opcode, that will be the reference implementation.
2. Add the Opcode to `src/opcodes/opcodes.cairo`
1. Add the Opcode to `src/opcodes/opcodes.cairo`.
- Add the Opcode byte const like `pub const OP_ADD: u8 = 147;`
- Create the function implementing the opcode like `fn opcode_add(ref engine: Engine) {`
- Add the function to the `execute` method like `147 => opcode_add(ref engine),`
3. Add the Opcode to the compiler dict at `src/compiler.cairo` like `opcodes.insert('OP_ADD', Opcode::OP_ADD);`.
4. Create a test for your opcode at `src/opcodes/tests/test_opcodes.cairo` and ensure all the logic works as expected.
5. Create a PR, ensure CI passes, and await review.
1. Add the Opcode to the compiler dict at `src/compiler.cairo` like `opcodes.insert('OP_ADD', Opcode::OP_ADD);`.
1. Create a test for your opcode at `src/opcodes/tests/test_opcodes.cairo` and ensure all the logic works as expected.
1. Create a PR, ensure CI passes, and await review.

0 comments on commit 8c59c61

Please sign in to comment.