示例#1
0
文件: Helper.cs 项目: FDship/SBC
 public static ScriptBuilder EmitAppCall(this ScriptBuilder sb, UInt160 scriptHash, bool useTailCall = false)
 {
     return(sb.EmitAppCall(scriptHash.ToArray(), useTailCall));
 }
示例#2
0
文件: Helper.cs 项目: FDship/SBC
 public static ScriptBuilder EmitPush(this ScriptBuilder sb, ISerializable data)
 {
     return(sb.EmitPush(data.ToArray()));
 }
示例#3
0
文件: Helper.cs 项目: FDship/SBC
        public static ScriptBuilder EmitPush(this ScriptBuilder sb, object obj)
        {
            switch (obj)
            {
            case bool data:
                sb.EmitPush(data);
                break;

            case byte[] data:
                sb.EmitPush(data);
                break;

            case string data:
                sb.EmitPush(data);
                break;

            case BigInteger data:
                sb.EmitPush(data);
                break;

            case ISerializable data:
                sb.EmitPush(data);
                break;

            case sbyte data:
                sb.EmitPush(data);
                break;

            case byte data:
                sb.EmitPush(data);
                break;

            case short data:
                sb.EmitPush(data);
                break;

            case ushort data:
                sb.EmitPush(data);
                break;

            case int data:
                sb.EmitPush(data);
                break;

            case uint data:
                sb.EmitPush(data);
                break;

            case long data:
                sb.EmitPush(data);
                break;

            case ulong data:
                sb.EmitPush(data);
                break;

            case Enum data:
                sb.EmitPush(BigInteger.Parse(data.ToString("d")));
                break;

            default:
                throw new ArgumentException();
            }
            return(sb);
        }