Page MenuHomePhabricator

Add support for NUM2BIN, and BIN2NUM opcodes
AbandonedPublic

Authored by deadalnix on Feb 15 2018, 01:24.

Details

Reviewers
jasonbcox
movrcx
schancel
Group Reviewers
Restricted Project
Restricted Owners Package(Owns No Changed Paths)
Maniphest Tasks
T309: Adds OP_BIN2NUM functionality into interpreter.cpp
Summary

Takes a minimally encoded number and converts it to binary

Co-authored-by: Marcos Mayorga <mm@mm-studios.com>
Co-authored-by: Joshua Yabut <yabut.joshua@gmail.com>

Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
arcpatch-D1103
Lint
Lint SkippedExcuse: NA
Unit
No Unit Test Coverage
Build Status
Buildable 2192
Build 2528: Bitcoin ABC Teamcity Staging
Build 2527: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
danconnolly edited the test plan for this revision. (Show Details)Mar 12 2018, 21:25
danconnolly updated this revision to Diff 3166.Mar 13 2018, 06:27

resubmit D1103 - OP_NUM2BIN

Owners added a reviewer: Restricted Owners Package.Mar 13 2018, 06:27
movrcx updated this revision to Diff 3228.Mar 16 2018, 03:03

Cleaning up due to D1202

movrcx updated this revision to Diff 3258.Mar 17 2018, 02:21

Rebase off of master

schancel retitled this revision from Adds OP_NUM2BIN functionality into interpreter.cpp to Add support for OP_NUM2BIN, and BIN2NUM opcodes.Mar 18 2018, 02:52
schancel updated this revision to Diff 3275.Mar 18 2018, 03:06
schancel added a subscriber: schancel.

Clean up of diff

schancel updated this revision to Diff 3276.Mar 18 2018, 03:08

Remove some code that shouldn't be there.

jasonbcox requested changes to this revision.Mar 18 2018, 03:17
jasonbcox added inline comments.
src/script/interpreter.cpp
948–963 ↗(On Diff #3276)

Code merge goof?

This revision now requires changes to proceed.Mar 18 2018, 03:17
schancel updated this revision to Diff 3283.Mar 18 2018, 09:03

Cleanup and rebase on D1214

schancel retitled this revision from Add support for OP_NUM2BIN, and BIN2NUM opcodes to Add support for NUM2BIN, and BIN2NUM opcodes.Mar 18 2018, 09:04
schancel updated this revision to Diff 3284.Mar 18 2018, 09:24

Trim input properly

schancel updated this revision to Diff 3288.Mar 18 2018, 11:11

Use MinimalizeBigEndianArray

schancel commandeered this revision.Mar 18 2018, 20:49
schancel added a reviewer: movrcx.
schancel updated this revision to Diff 3299.Mar 18 2018, 22:13

Fix tests, and and edge case in BIN2NUM

jasonbcox requested changes to this revision.Mar 18 2018, 22:44
jasonbcox added inline comments.
src/script/interpreter.cpp
1297 ↗(On Diff #3299)

Is this comment misplaced? The code immediately below it is just recording neg. I don't actually see any code in this function that protects against -0.

src/test/data/script_tests.json
837 ↗(On Diff #3299)

Add a test for -0 BIN2NUM

This revision now requires changes to proceed.Mar 18 2018, 22:44
schancel updated this revision to Diff 3300.Mar 19 2018, 02:37

Update with a couple fixes

shadders added inline comments.Mar 19 2018, 06:06
src/script/interpreter.cpp
1304 ↗(On Diff #3299)

i is a uint8_t. This is implicitly limiting padding to 255 bytes. The spec doesn't imply any limitation other than that the result must me less than DEFAULT_MAX_NUM_BYTES

schancel updated this revision to Diff 3301.Mar 19 2018, 08:25

Add some more tests

schancel abandoned this revision.Mar 19 2018, 22:58
macros updated this revision to Diff 3324.Mar 21 2018, 17:43
macros added a subscriber: macros.

refactored tests

deadalnix commandeered this revision.Mar 31 2018, 08:34
deadalnix abandoned this revision.
deadalnix added a reviewer: schancel.