Commit graph

3 commits

Author SHA1 Message Date
Dave Collins
cff7f9704b Fix a few comment typos. 2014-02-20 11:20:53 -06:00
Dave Collins
50173b865b Allow push of 0 via new ScriptBuilder PushInt64.
Nothing was being pushed for 0 to the new ScriptBuilder due to the fact Go
big integers when set to 0 have no bytes.
2014-02-20 01:48:37 -06:00
Dave Collins
b8dc1b66e5 Add new ScriptBuilder for building custom scripts.
This commit adds a new ScriptBuilder interface that can be used to build
custom scripts.  It currently is fairly basic, but it allows you to push
raw opcodes, ints, and data while respecting canonical encoding.  These
primitives are sufficient to build any script.

This could be improved upon with quite a few things. One example would be
functions for certain opcodes that take properly typed parameters to make
it harder to create invalid scripts.

For now though, it is already quite useful since it handles all of the
opcode selection for canonical data pushes and integer encoding.

The initial discussion took place in #5.
2014-02-20 01:02:57 -06:00