Exemple #1
0
        private static ExecutionState Oracle_Price(RuntimeVM vm)
        {
            vm.ExpectStackSize(1);

            var symbol = vm.PopString("price");

            var price = vm.GetTokenPrice(symbol);

            vm.Stack.Push(VMObject.FromObject(price));

            return(ExecutionState.Running);
        }
Exemple #2
0
        private static ExecutionState Oracle_Price(RuntimeVM vm)
        {
            ExpectStackSize(vm, 1);

            VMObject temp;

            temp = vm.Stack.Pop();
            if (temp.Type != VMType.String)
            {
                return(ExecutionState.Fault);
            }

            var symbol = temp.AsString();

            var price = vm.GetTokenPrice(symbol);

            vm.Stack.Push(VMObject.FromObject(price));

            return(ExecutionState.Running);
        }