Ejemplo n.º 1
0
        public static SignerKey Decode(IByteReader stream)
        {
            SignerKey decodedSignerKey = new SignerKey();

            decodedSignerKey.Discriminant = SignerKeyType.Decode(stream);
            switch (decodedSignerKey.Discriminant.InnerValue)
            {
            case SignerKeyType.SignerKeyTypeEnum.SIGNER_KEY_TYPE_ED25519:
                decodedSignerKey.Ed25519 = Uint256.Decode(stream);
                break;

            case SignerKeyType.SignerKeyTypeEnum.SIGNER_KEY_TYPE_PRE_AUTH_TX:
                decodedSignerKey.PreAuthTx = Uint256.Decode(stream);
                break;

            case SignerKeyType.SignerKeyTypeEnum.SIGNER_KEY_TYPE_HASH_X:
                decodedSignerKey.HashX = Uint256.Decode(stream);
                break;
            }
            return(decodedSignerKey);
        }
Ejemplo n.º 2
0
 public static void Encode(IByteWriter stream, SignerKeyType value)
 {
     XdrEncoding.EncodeInt32((int)value.InnerValue, stream);
 }