Exemplo n.º 1
0
        public OpEqualAtom(ScriptOpCode opcode)
            : base(opcode)
        {
            Contract.Requires(opcode == ScriptOpCode.OP_EQUAL || opcode == ScriptOpCode.OP_EQUALVERIFY);

            MustVerify = opcode == ScriptOpCode.OP_EQUALVERIFY;
        }
Exemplo n.º 2
0
        public static IScriptAtom GetOpAtom(ScriptOpCode opcode)
        {
            Contract.Requires<ArgumentOutOfRangeException>(opcode == 0 || opcode > ScriptOpCode.OP_PUSHDATA4, "opcode");

            switch (opcode)
            {
                case ScriptOpCode.OP_DUP:
                case ScriptOpCode.OP_2DUP:
                case ScriptOpCode.OP_3DUP:
                    return new Atoms.OpDupAtom(opcode);
                case ScriptOpCode.OP_RIPEMD160:
                case ScriptOpCode.OP_SHA1:
                case ScriptOpCode.OP_SHA256:
                case ScriptOpCode.OP_HASH160:
                case ScriptOpCode.OP_HASH256:
                    return new Atoms.OpHashAtom(opcode);
                case ScriptOpCode.OP_EQUAL:
                case ScriptOpCode.OP_EQUALVERIFY:
                    return new Atoms.OpEqualAtom(opcode);
                case ScriptOpCode.OP_CHECKSIG:
                case ScriptOpCode.OP_CHECKSIGVERIFY:
                    return new Atoms.OpCheckSigAtom(opcode);
                default:
                    return new Atoms.OpInvalidAtom(opcode);
            }
        }
Exemplo n.º 3
0
        public OpCheckSigAtom(ScriptOpCode opcode)
            : base(opcode)
        {
            Contract.Requires(opcode == ScriptOpCode.OP_CHECKSIG || opcode == ScriptOpCode.OP_CHECKSIGVERIFY);

            MustVerify = opcode == ScriptOpCode.OP_CHECKSIGVERIFY;
        }
Exemplo n.º 4
0
        public OpCheckSigAtom(ScriptOpCode opcode)
            : base(opcode)
        {
            Contract.Requires(opcode == ScriptOpCode.OP_CHECKSIG || opcode == ScriptOpCode.OP_CHECKSIGVERIFY);

            MustVerify = opcode == ScriptOpCode.OP_CHECKSIGVERIFY;
        }
Exemplo n.º 5
0
        public static IScriptAtom GetOpAtom(ScriptOpCode opcode)
        {
            Contract.Requires <ArgumentOutOfRangeException>(opcode == 0 || opcode > ScriptOpCode.OP_PUSHDATA4, "opcode");

            switch (opcode)
            {
            case ScriptOpCode.OP_DUP:
            case ScriptOpCode.OP_2DUP:
            case ScriptOpCode.OP_3DUP:
                return(new Atoms.OpDupAtom(opcode));

            case ScriptOpCode.OP_RIPEMD160:
            case ScriptOpCode.OP_SHA1:
            case ScriptOpCode.OP_SHA256:
            case ScriptOpCode.OP_HASH160:
            case ScriptOpCode.OP_HASH256:
                return(new Atoms.OpHashAtom(opcode));

            case ScriptOpCode.OP_EQUAL:
            case ScriptOpCode.OP_EQUALVERIFY:
                return(new Atoms.OpEqualAtom(opcode));

            case ScriptOpCode.OP_CHECKSIG:
            case ScriptOpCode.OP_CHECKSIGVERIFY:
                return(new Atoms.OpCheckSigAtom(opcode));

            default:
                return(new Atoms.OpInvalidAtom(opcode));
            }
        }
Exemplo n.º 6
0
        public OpEqualAtom(ScriptOpCode opcode)
            : base(opcode)
        {
            Contract.Requires(opcode == ScriptOpCode.OP_EQUAL || opcode == ScriptOpCode.OP_EQUALVERIFY);

            MustVerify = opcode == ScriptOpCode.OP_EQUALVERIFY;
        }
Exemplo n.º 7
0
 public OpHashAtom(ScriptOpCode opcode)
     : base(opcode)
 {
     Contract.Requires<ArgumentException>(opcode == ScriptOpCode.OP_RIPEMD160 ||
                                          opcode == ScriptOpCode.OP_SHA1 ||
                                          opcode == ScriptOpCode.OP_SHA256 ||
                                          opcode == ScriptOpCode.OP_HASH160 ||
                                          opcode == ScriptOpCode.OP_HASH256,
                                          "opcode");
 }
Exemplo n.º 8
0
 public OpHashAtom(ScriptOpCode opcode)
     : base(opcode)
 {
     Contract.Requires <ArgumentException>(opcode == ScriptOpCode.OP_RIPEMD160 ||
                                           opcode == ScriptOpCode.OP_SHA1 ||
                                           opcode == ScriptOpCode.OP_SHA256 ||
                                           opcode == ScriptOpCode.OP_HASH160 ||
                                           opcode == ScriptOpCode.OP_HASH256,
                                           "opcode");
 }
Exemplo n.º 9
0
 public OpInvalidAtom(ScriptOpCode opcode) : base(opcode)
 {
 }
Exemplo n.º 10
0
 public OpDupAtom(ScriptOpCode opcode)
     : base(opcode)
 {
     Contract.Requires<ArgumentException>(opcode == ScriptOpCode.OP_DUP || opcode == ScriptOpCode.OP_2DUP || opcode == ScriptOpCode.OP_3DUP, "opcode");
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes and instance of the Metadata Class with the given info
 /// </summary>
 public ScriptOpMetadata(ScriptOpCode opCode, ScriptOpType opType, ScriptOperandType operandType)
 {
     OpCode      = opCode;
     OpType      = opType;
     OperandType = operandType;
 }
Exemplo n.º 12
0
        protected sealed override void Deserialize(Stream stream)
        {
            var opcode = (ScriptOpCode)ReadByte(stream);

            OpCode = opcode;
        }
Exemplo n.º 13
0
 public OpDupAtom(ScriptOpCode opcode)
     : base(opcode)
 {
     Contract.Requires <ArgumentException>(opcode == ScriptOpCode.OP_DUP || opcode == ScriptOpCode.OP_2DUP || opcode == ScriptOpCode.OP_3DUP, "opcode");
 }
Exemplo n.º 14
0
 public OpVerifyAtom(ScriptOpCode opcode)
     : base(opcode)
 {
     Contract.Requires<ArgumentException>(opcode == ScriptOpCode.OP_VERIFY);
 }
Exemplo n.º 15
0
 public OpVerifyAtom(ScriptOpCode opcode)
     : base(opcode)
 {
     Contract.Requires <ArgumentException>(opcode == ScriptOpCode.OP_VERIFY);
 }
Exemplo n.º 16
0
 public OpInvalidAtom(ScriptOpCode opcode) : base(opcode) { }
Exemplo n.º 17
0
 protected OpAtom(ScriptOpCode opcode)
 {
     OpCode = opcode;
 }