Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-31 Thread Matt Corallo
On Sun, 2012-07-29 at 20:52 -0400, Gavin Andresen wrote: > > Is there interest to port more tests (P2SH, checksig, checkmultisig, > > block verification, maybe even DoS rules) into data-driven format? It > > might be something that I'd like to help with if pull requests in that > > direction are we

Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-31 Thread Pieter Wuille
On Mon, Jul 30, 2012 at 2:52 AM, Gavin Andresen wrote: > check*sig tests are tricky, because they have to refer to previous > unspent transactions and private keys (so require a particular block > chain to test against). Brilliant ideas on a simple data-driven format > welcome. Ultraprune changes

Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-30 Thread Amir Taaki
@lists.sourceforge.net Sent: Sunday, July 29, 2012 9:52 PM Subject: Re: [Bitcoin-development] script tests - invalid script in script_valid.json? > Is there interest to port more tests (P2SH, checksig, checkmultisig, > block verification, maybe even DoS rules) into data-driven format? It >

Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-29 Thread Gavin Andresen
> Is there interest to port more tests (P2SH, checksig, checkmultisig, > block verification, maybe even DoS rules) into data-driven format? It > might be something that I'd like to help with if pull requests in that > direction are welcome. Yes, more tests are definitely welcome. check*sig tests

Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-29 Thread Jeff Garzik
On Sun, Jul 29, 2012 at 1:35 PM, Stefan Thomas wrote: > Big props to Gavin for adding those data-driven test cases. I can't > overstate how useful they are. +1 they are a useful, cross-platform test tool. pynode will be making use of them shortly. -- Jeff Garzik exMULTI, Inc. jgar...@exmulti.

Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-29 Thread Stefan Thomas
ge.net > Cc: > Sent: Sunday, July 29, 2012 1:33 PM > Subject: Re: [Bitcoin-development] script tests - invalid script in > script_valid.json? > > OP_WITHIN is lower-bound-inclusive, but upper bound exclusive, so 1 0 1 > WITHIN is false. > > > bool fValue = (bn2 <=

Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-29 Thread Amir Taaki
oh, bitcoin... Thanks justmoon :D - Original Message - From: Stefan Thomas To: bitcoin-development@lists.sourceforge.net Cc: Sent: Sunday, July 29, 2012 1:33 PM Subject: Re: [Bitcoin-development] script tests - invalid script in script_valid.json? OP_WITHIN is lower-bound-inclusive

Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-29 Thread Stefan Thomas
OP_WITHIN is lower-bound-inclusive, but upper bound exclusive, so 1 0 1 WITHIN is false. bool fValue = (bn2 <= bn1 && bn1 < bn3); https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L854 On 7/29/2012 6:31 PM, Amir Taaki wrote: > Hi! > > Is this a valid script? > > ["1 0 1", "WITHIN N

[Bitcoin-development] script tests - invalid script in script_valid.json?

2012-07-29 Thread Amir Taaki
Hi! Is this a valid script? ["1 0 1", "WITHIN NOT"] The first value (1) is tested to make sure it is between the lower (0) and upper (1) value. This evaluates to true, placing on the stack a single byte of [01]. NOT then inverses this to a 0 byte false value of []. What am I missing here? Th