Ejemplo n.º 1
0
        public static MuxedAccount Decode(XdrDataInputStream stream)
        {
            MuxedAccount  decodedMuxedAccount = new MuxedAccount();
            CryptoKeyType discriminant        = CryptoKeyType.Decode(stream);

            decodedMuxedAccount.Discriminant = discriminant;
            switch (decodedMuxedAccount.Discriminant.InnerValue)
            {
            case CryptoKeyType.CryptoKeyTypeEnum.KEY_TYPE_ED25519:
                decodedMuxedAccount.Ed25519 = Uint256.Decode(stream);
                break;

            case CryptoKeyType.CryptoKeyTypeEnum.KEY_TYPE_MUXED_ED25519:
                decodedMuxedAccount.Med25519 = MuxedAccountMed25519.Decode(stream);
                break;
            }
            return(decodedMuxedAccount);
        }
Ejemplo n.º 2
0
 public static void Encode(XdrDataOutputStream stream, CryptoKeyType value)
 {
     stream.WriteInt((int)value.InnerValue);
 }