コード例 #1
0
ファイル: ExtCalls.cs プロジェクト: pau121/PhantasmaChain
        private static ExecutionState Nexus_CreateChain(RuntimeVM vm)
        {
            vm.ExpectStackSize(4);

            var source     = vm.PopAddress();
            var org        = vm.PopString("organization");
            var name       = vm.PopString("name");
            var parentName = vm.PopString("parent");

            vm.CreateChain(source, org, name, parentName);

            return(ExecutionState.Running);
        }
コード例 #2
0
        private static ExecutionState Runtime_CreateChain(RuntimeVM Runtime)
        {
            ExpectStackSize(Runtime, 3);

            VMObject temp;

            var source = PopAddress(Runtime);

            temp = Runtime.Stack.Pop();
            Runtime.Expect(temp.Type == VMType.String, "expected string for name");
            var name = temp.AsString();

            temp = Runtime.Stack.Pop();
            Runtime.Expect(temp.Type == VMType.String, "expected string for parent");
            var parentName = temp.AsString();

            Runtime.CreateChain(source, name, parentName);

            return(ExecutionState.Running);
        }