@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(sign)
for ( int i = 0 ; i < 4 ; i + + )
for ( int i = 0 ; i < 4 ; i + + )
{
{
keystore . AddCScript ( standardScripts [ i ] ) ;
keystore . AddCScript ( standardScripts [ i ] ) ;
evalScripts [ i ] = GetScriptForDestination ( standardScripts [ i ] . GetID ( ) ) ;
evalScripts [ i ] = GetScriptForDestination ( CScriptID ( standardScripts [ i ] ) ) ;
}
}
CMutableTransaction txFrom ; // Funding transaction:
CMutableTransaction txFrom ; // Funding transaction:
@ -129,7 +129,7 @@ BOOST_AUTO_TEST_CASE(norecurse)
CScript invalidAsScript ;
CScript invalidAsScript ;
invalidAsScript < < OP_INVALIDOPCODE < < OP_INVALIDOPCODE ;
invalidAsScript < < OP_INVALIDOPCODE < < OP_INVALIDOPCODE ;
CScript p2sh = GetScriptForDestination ( invalidAsScript . GetID ( ) ) ;
CScript p2sh = GetScriptForDestination ( CScriptID ( invalidAsScript ) ) ;
CScript scriptSig ;
CScript scriptSig ;
scriptSig < < Serialize ( invalidAsScript ) ;
scriptSig < < Serialize ( invalidAsScript ) ;
@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(norecurse)
// Try to recur, and verification should succeed because
// Try to recur, and verification should succeed because
// the inner HASH160 <> EQUAL should only check the hash:
// the inner HASH160 <> EQUAL should only check the hash:
CScript p2sh2 = GetScriptForDestination ( p2sh . GetID ( ) ) ;
CScript p2sh2 = GetScriptForDestination ( CScriptID ( p2sh ) ) ;
CScript scriptSig2 ;
CScript scriptSig2 ;
scriptSig2 < < Serialize ( invalidAsScript ) < < Serialize ( p2sh ) ;
scriptSig2 < < Serialize ( invalidAsScript ) < < Serialize ( p2sh ) ;
@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(set)
CScript outer [ 4 ] ;
CScript outer [ 4 ] ;
for ( int i = 0 ; i < 4 ; i + + )
for ( int i = 0 ; i < 4 ; i + + )
{
{
outer [ i ] = GetScriptForDestination ( inner [ i ] . GetID ( ) ) ;
outer [ i ] = GetScriptForDestination ( CScriptID ( inner [ i ] ) ) ;
keystore . AddCScript ( inner [ i ] ) ;
keystore . AddCScript ( inner [ i ] ) ;
}
}
@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE(switchover)
CScript scriptSig ;
CScript scriptSig ;
scriptSig < < Serialize ( notValid ) ;
scriptSig < < Serialize ( notValid ) ;
CScript fund = GetScriptForDestination ( notValid . GetID ( ) ) ;
CScript fund = GetScriptForDestination ( CScriptID ( notValid ) ) ;
// Validation should succeed under old rules (hash is correct):
// Validation should succeed under old rules (hash is correct):
@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
keystore . AddCScript ( pay1 ) ;
keystore . AddCScript ( pay1 ) ;
CScript pay1of3 = GetScriptForMultisig ( 1 , keys ) ;
CScript pay1of3 = GetScriptForMultisig ( 1 , keys ) ;
txFrom . vout [ 0 ] . scriptPubKey = GetScriptForDestination ( pay1 . GetID ( ) ) ; // P2SH (OP_CHECKSIG)
txFrom . vout [ 0 ] . scriptPubKey = GetScriptForDestination ( CScriptID ( pay1 ) ) ; // P2SH (OP_CHECKSIG)
txFrom . vout [ 0 ] . nValue = 1000 ;
txFrom . vout [ 0 ] . nValue = 1000 ;
txFrom . vout [ 1 ] . scriptPubKey = pay1 ; // ordinary OP_CHECKSIG
txFrom . vout [ 1 ] . scriptPubKey = pay1 ; // ordinary OP_CHECKSIG
txFrom . vout [ 1 ] . nValue = 2000 ;
txFrom . vout [ 1 ] . nValue = 2000 ;
@ -290,7 +290,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
oneAndTwo < < OP_2 < < key [ 3 ] . GetPubKey ( ) < < key [ 4 ] . GetPubKey ( ) < < key [ 5 ] . GetPubKey ( ) ;
oneAndTwo < < OP_2 < < key [ 3 ] . GetPubKey ( ) < < key [ 4 ] . GetPubKey ( ) < < key [ 5 ] . GetPubKey ( ) ;
oneAndTwo < < OP_3 < < OP_CHECKMULTISIG ;
oneAndTwo < < OP_3 < < OP_CHECKMULTISIG ;
keystore . AddCScript ( oneAndTwo ) ;
keystore . AddCScript ( oneAndTwo ) ;
txFrom . vout [ 3 ] . scriptPubKey = GetScriptForDestination ( oneAndTwo . GetID ( ) ) ;
txFrom . vout [ 3 ] . scriptPubKey = GetScriptForDestination ( CScriptID ( oneAndTwo ) ) ;
txFrom . vout [ 3 ] . nValue = 4000 ;
txFrom . vout [ 3 ] . nValue = 4000 ;
// vout[4] is max sigops:
// vout[4] is max sigops:
@ -299,17 +299,17 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
fifteenSigops < < key [ i % 3 ] . GetPubKey ( ) ;
fifteenSigops < < key [ i % 3 ] . GetPubKey ( ) ;
fifteenSigops < < OP_15 < < OP_CHECKMULTISIG ;
fifteenSigops < < OP_15 < < OP_CHECKMULTISIG ;
keystore . AddCScript ( fifteenSigops ) ;
keystore . AddCScript ( fifteenSigops ) ;
txFrom . vout [ 4 ] . scriptPubKey = GetScriptForDestination ( fifteenSigops . GetID ( ) ) ;
txFrom . vout [ 4 ] . scriptPubKey = GetScriptForDestination ( CScriptID ( fifteenSigops ) ) ;
txFrom . vout [ 4 ] . nValue = 5000 ;
txFrom . vout [ 4 ] . nValue = 5000 ;
// vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS
// vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS
CScript sixteenSigops ; sixteenSigops < < OP_16 < < OP_CHECKMULTISIG ;
CScript sixteenSigops ; sixteenSigops < < OP_16 < < OP_CHECKMULTISIG ;
keystore . AddCScript ( sixteenSigops ) ;
keystore . AddCScript ( sixteenSigops ) ;
txFrom . vout [ 5 ] . scriptPubKey = GetScriptForDestination ( fifteenSigops . GetID ( ) ) ;
txFrom . vout [ 5 ] . scriptPubKey = GetScriptForDestination ( CScriptID ( fifteenSigops ) ) ;
txFrom . vout [ 5 ] . nValue = 5000 ;
txFrom . vout [ 5 ] . nValue = 5000 ;
CScript twentySigops ; twentySigops < < OP_CHECKMULTISIG ;
CScript twentySigops ; twentySigops < < OP_CHECKMULTISIG ;
keystore . AddCScript ( twentySigops ) ;
keystore . AddCScript ( twentySigops ) ;
txFrom . vout [ 6 ] . scriptPubKey = GetScriptForDestination ( twentySigops . GetID ( ) ) ;
txFrom . vout [ 6 ] . scriptPubKey = GetScriptForDestination ( CScriptID ( twentySigops ) ) ;
txFrom . vout [ 6 ] . nValue = 6000 ;
txFrom . vout [ 6 ] . nValue = 6000 ;
coins . ModifyCoins ( txFrom . GetHash ( ) ) - > FromTx ( txFrom , 0 ) ;
coins . ModifyCoins ( txFrom . GetHash ( ) ) - > FromTx ( txFrom , 0 ) ;