Bitcoin Forum
April 26, 2024, 07:23:52 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Looking for nested if scripts for testing  (Read 202 times)
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
May 25, 2019, 05:07:58 AM
Merited by bones261 (2), ABCbits (1)
 #1

Something like this would be great:
Code:
IF
  [statements]
  IF
     [statements]
  ELSE
     [statements]
  [statements]
ELSE
  [statements]

I can come up with tests myself but then I wouldn't know if it is actually correct (does bitcoin-core RPC work for checking?).
Checked bitcoin-core tests[1] but couldn't find any test cases for non-regular scripts, all of them seem to be for normal (standard) scripts used in regular transactions.

[1] https://github.com/bitcoin/bitcoin/blob/63b9efa73d6bec280241fe0fa06abf7e5b4dde8d/src/test/script_tests.cpp
and txcreatescript... files here https://github.com/bitcoin/bitcoin/tree/master/test/util/data

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
1714116232
Hero Member
*
Offline Offline

Posts: 1714116232

View Profile Personal Message (Offline)

Ignore
1714116232
Reply with quote  #2

1714116232
Report to moderator
1714116232
Hero Member
*
Offline Offline

Posts: 1714116232

View Profile Personal Message (Offline)

Ignore
1714116232
Reply with quote  #2

1714116232
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714116232
Hero Member
*
Offline Offline

Posts: 1714116232

View Profile Personal Message (Offline)

Ignore
1714116232
Reply with quote  #2

1714116232
Report to moderator
1714116232
Hero Member
*
Offline Offline

Posts: 1714116232

View Profile Personal Message (Offline)

Ignore
1714116232
Reply with quote  #2

1714116232
Report to moderator
apxu
Member
**
Offline Offline

Activity: 229
Merit: 13


View Profile
May 29, 2019, 05:47:09 PM
 #2

What about
Code:
OP_IF
  [statements]
OP_ELSE
  [statements]
OP_ELSE
  [statements]
OP_ELSE
  [statements]
OP_ELSE
  [statements]
OP_ENDIF
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!