Пример #1
0
 public IEnumerable <(ECPoint PublicKey, BigInteger Votes)> GetRegisteredValidators()
 {
     byte[] script;
     using (ScriptBuilder sb = new ScriptBuilder())
     {
         sb.EmitAppCall(NativeContract.NEO.ScriptHash, "getRegisteredValidators");
         script = sb.ToArray();
     }
     using (ApplicationEngine engine = ApplicationEngine.Run(script, this, testMode: true))
     {
         return(((VMArray)engine.ResultStack.Peek()).Select(p =>
         {
             Struct @struct = (Struct)p;
             return (@struct.GetByteArray().AsSerializable <ECPoint>(), @struct.GetBigInteger());
         }));
     }
 }