Commit 80ff15b0 authored by Ivan Jose Lozano Fernandez's avatar Ivan Jose Lozano Fernandez Committed by Daniel Connolly

Test cases fix.

These scenarios have been fixed (Expected results from script_tests.json): SIG_DER, ILLEGAL_FORKID, SIG_HASHTYPE, SIG_PUSHONLY, CLEANSTACK, PUBKEYTYPE.
parent 744b548a
...@@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.JsonNode; ...@@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import org.bitcoinj.core.Coin; import org.bitcoinj.core.Coin;
import org.bitcoinj.core.ScriptException;
import org.bitcoinj.core.ScriptException.*; import org.bitcoinj.core.ScriptException.*;
import org.bitcoinj.core.Transaction; import org.bitcoinj.core.Transaction;
import org.bitcoinj.core.VerificationException; import org.bitcoinj.core.VerificationException;
...@@ -98,82 +99,13 @@ public class ScriptDataDrivenTest { ...@@ -98,82 +99,13 @@ public class ScriptDataDrivenTest {
scriptSig.correctlySpends(spendTx, 0, scriptPubKey, value, flags); scriptSig.correctlySpends(spendTx, 0, scriptPubKey, value, flags);
} catch (BadOpcodeException e) {
result = "BAD_OPCODE";
} catch (DisabledOpcodeException e) {
result = "DISABLED_OPCODE";
} catch (DiscourageUpgradableNopsException e) {
result = "DISCOURAGE_UPGRADABLE_NOPS";
} catch (DivByZeroException e) {
result = "DIV_BY_ZERO";
} catch (EqualVerifyException e) {
result = "EQUALVERIFY";
} catch (EvalFalseException e) {
result = "EVAL_FALSE";
} catch (ImpossibleEncoding e) {
result = "IMPOSSIBLE_ENCODING";
} catch (InvalidAltStackOperationException e) {
result = "INVALID_ALTSTACK_OPERATION";
} catch (InvalidNumberRangeException e) {
result = "INVALID_NUMBER_RANGE";
} catch (InvalidStackOperationException e) {
result = "INVALID_STACK_OPERATION";
} catch (ModByZeroException e) {
result = "MOD_BY_ZERO";
} catch (NullDummyException e) {
result = "SIG_NULLDUMMY";
} catch (OpCountException e) {
result = "OP_COUNT";
} catch (OperandSizeException e) {
result = "OPERAND_SIZE";
} catch (OpReturnException e) {
result = "OP_RETURN";
} }
catch (PubKeyCountException e) {
result = "PUBKEY_COUNT"; catch (ScriptException e) {
} catch (PushSizeException e) { if (e.getError() != null)
result = "PUSH_SIZE"; result = e.getError().getMnemonic();
} catch (ScriptSizeException e) { else result = "UNKNOWN_ERROR";
result = "SCRIPT_SIZE"; } catch (VerificationException e) {
} catch (SigCountException e) {
result = "SIG_COUNT";
} catch (SplitRangeException e) {
result = "SPLIT_RANGE";
} catch (StackSizeException e) {
result = "STACK_SIZE";
} catch (UnbalancedConditionalException e) {
result = "UNBALANCED_CONDITIONAL";
} catch (OpVerifyFailed e) {
result = "VERIFY";
} catch (MinimalDataException e) {
result = "MINIMALDATA";
} catch (MinimalIfException e) {
result = "MINIMALIF";
} catch (NullFailException e) {
result = "NULLFAIL";
} catch (UnsatisfiedLocktime e) {
result = "UNSATISFIED_LOCKTIME";
} catch (NegativeLocktime e) {
result = "NEGATIVE_LOCKTIME";
} catch(SigPushOnlyException e){
result = "SIG_PUSHONLY";
}
/* TEMP
catch(PubKeyTypeException e) {
result = "PUBKEYTYPE";
} catch(PubKeyCompressedException e) {
result = "PUBKEYTYPE";
} catch (CleanstackException e) {
result = "CLEANSTACK";
} catch (VerificationException.SignatureSIG_DERError e) {
result = "SIG_DER";
} catch (VerificationException.SignatureForkIdError e) {
result = "ILLEGAL_FORKID";
} catch (VerificationException.SignatureHashTypeError e) {
result = "SIG_HASHTYPE";
}
*/
catch (VerificationException e) {
result = "UNKNOWN_ERROR"; result = "UNKNOWN_ERROR";
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment