Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle verify opcodes based on context #70

Merged
merged 2 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specs/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ A call frame consists of the following, word-aligned:
| | | | **Unwritable area begins.** |
| 8 | `uint32` | out offset | Offset from start of this call frame to out count, in bytes. |
| 32 | `byte[32]` | to | Contract ID for this call. |
| 8*64 | `byte[8][64]` | regs | Saved registers from previous context. |
| 8*64 | `byte[8][64]` | regs | Saved registers from previous context. |
| 8 | `uint8` | in count | Number of input values. |
| 8 | `uint8` | out count | Number of return values. |
| 8 | `uint16` | code size | Code size in bytes (not padded to word alignment). |
Expand Down
4 changes: 2 additions & 2 deletions specs/opcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ Otherwise, `$of` and `$err` are cleared.
| Encoding | `0x00 rd rs rt -` |
| Notes | |

If `$rt > tx.input[$rs].maturity`, halt, returning `false`. If the input `$rs` is not of type [`InputType.Coin`](./tx_format.md), halt, returning `false`.
If `$rt > tx.input[$rs].maturity` or if the input `$rs` is not of type [`InputType.Coin`](./tx_format.md), verification failed and operation depends on the context type. In a predicate context, [return](#return-return-from-context) `false`. In other contexts, [revert](#revert-revert).

Otherwise, advance the program counter `$pc` by `4`.

Expand All @@ -476,7 +476,7 @@ See also: [BIP-112](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawi
| Encoding | `0x00 rd rs - -` |
| Notes | |

If `$rs > tx.maturity`, halt, returning `false`.
If `$rs > tx.maturity`, verification failed and operation depends on the context type. In a predicate context, [return](#return-return-from-context) `false`. In other contexts, [revert](#revert-revert).

Otherwise, advance the program counter `$pc` by `4`.

Expand Down