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

Stefan Thomas moon at justmoon.de
Sun Jul 29 17:35:12 UTC 2012


I was baffled by this exact script, too. :)

Big props to Gavin for adding those data-driven test cases. I can't
overstate how useful they are.

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.

On 7/29/2012 6:42 PM, Amir Taaki wrote:
> oh, bitcoin...
>
> Thanks justmoon :D
>
>
>
> ----- Original Message -----
> From: Stefan Thomas <moon at justmoon.de>
> To: bitcoin-development at 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, 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 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?
>>
>> Thanks
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. Discussions 
>> will include endpoint security, mobile security and the latest in malware 
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Bitcoin-development mailing list
>> Bitcoin-development at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>





More information about the bitcoin-dev mailing list