Exemple #1
0
            public static OperationResultTr Decode(XdrDataInputStream stream)
            {
                OperationResultTr decodedOperationResultTr = new OperationResultTr();
                OperationType     discriminant             = OperationType.Decode(stream);

                decodedOperationResultTr.Discriminant = discriminant;

                switch (decodedOperationResultTr.Discriminant.InnerValue)
                {
                case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
                    decodedOperationResultTr.CreateAccountResult = CreateAccountResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PAYMENT:
                    decodedOperationResultTr.PaymentResult = PaymentResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT:
                    decodedOperationResultTr.PathPaymentResult = PathPaymentResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_OFFER:
                    decodedOperationResultTr.ManageOfferResult = ManageOfferResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
                    decodedOperationResultTr.CreatePassiveOfferResult = ManageOfferResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.SET_OPTIONS:
                    decodedOperationResultTr.SetOptionsResult = SetOptionsResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CHANGE_TRUST:
                    decodedOperationResultTr.ChangeTrustResult = ChangeTrustResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.ALLOW_TRUST:
                    decodedOperationResultTr.AllowTrustResult = AllowTrustResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
                    decodedOperationResultTr.AccountMergeResult = AccountMergeResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.INFLATION:
                    decodedOperationResultTr.InflationResult = InflationResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_DATA:
                    decodedOperationResultTr.ManageDataResult = ManageDataResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.BUMP_SEQUENCE:
                    decodedOperationResultTr.BumpSeqResult = BumpSequenceResult.Decode(stream);
                    break;
                }

                return(decodedOperationResultTr);
            }
            public static void Encode(XdrDataOutputStream stream, OperationResultTr encodedOperationResultTr)
            {
                stream.WriteInt((int)encodedOperationResultTr.Discriminant.InnerValue);
                switch (encodedOperationResultTr.Discriminant.InnerValue)
                {
                case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
                    CreateAccountResult.Encode(stream, encodedOperationResultTr.CreateAccountResult);
                    break;

                case OperationType.OperationTypeEnum.PAYMENT:
                    PaymentResult.Encode(stream, encodedOperationResultTr.PaymentResult);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT:
                    PathPaymentResult.Encode(stream, encodedOperationResultTr.PathPaymentResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_SELL_OFFER:
                    ManageSellOfferResult.Encode(stream, encodedOperationResultTr.ManageSellOfferResult);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER:
                    ManageSellOfferResult.Encode(stream, encodedOperationResultTr.CreatePassiveSellOfferResult);
                    break;

                case OperationType.OperationTypeEnum.SET_OPTIONS:
                    SetOptionsResult.Encode(stream, encodedOperationResultTr.SetOptionsResult);
                    break;

                case OperationType.OperationTypeEnum.CHANGE_TRUST:
                    ChangeTrustResult.Encode(stream, encodedOperationResultTr.ChangeTrustResult);
                    break;

                case OperationType.OperationTypeEnum.ALLOW_TRUST:
                    AllowTrustResult.Encode(stream, encodedOperationResultTr.AllowTrustResult);
                    break;

                case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
                    AccountMergeResult.Encode(stream, encodedOperationResultTr.AccountMergeResult);
                    break;

                case OperationType.OperationTypeEnum.INFLATION:
                    InflationResult.Encode(stream, encodedOperationResultTr.InflationResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_DATA:
                    ManageDataResult.Encode(stream, encodedOperationResultTr.ManageDataResult);
                    break;

                case OperationType.OperationTypeEnum.BUMP_SEQUENCE:
                    BumpSequenceResult.Encode(stream, encodedOperationResultTr.BumpSeqResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_BUY_OFFER:
                    ManageBuyOfferResult.Encode(stream, encodedOperationResultTr.ManageBuyOfferResult);
                    break;
                }
            }
Exemple #3
0
        public static void Encode(XdrDataOutputStream stream, OperationResult encodedOperationResult)
        {
            stream.WriteInt((int)encodedOperationResult.Discriminant.InnerValue);

            switch (encodedOperationResult.Discriminant.InnerValue)
            {
            case OperationResultCode.OperationResultCodeEnum.opINNER:
                OperationResultTr.Encode(stream, encodedOperationResult.Tr);
                break;
            }
        }
Exemple #4
0
        public static void Encode(IByteWriter stream, OperationResult encodedOperationResult)
        {
            XdrEncoding.EncodeInt32((int)encodedOperationResult.Discriminant.InnerValue, stream);
            switch (encodedOperationResult.Discriminant.InnerValue)
            {
            case OperationResultCode.OperationResultCodeEnum.opINNER:
                OperationResultTr.Encode(stream, encodedOperationResult.Tr);
                break;

            default:
                break;
            }
        }
Exemple #5
0
            public static void Encode(IByteWriter stream, OperationResultTr encodedOperationResultTr)
            {
                XdrEncoding.EncodeInt32((int)encodedOperationResultTr.Discriminant.InnerValue, stream);
                switch (encodedOperationResultTr.Discriminant.InnerValue)
                {
                case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
                    CreateAccountResult.Encode(stream, encodedOperationResultTr.CreateAccountResult);
                    break;

                case OperationType.OperationTypeEnum.PAYMENT:
                    PaymentResult.Encode(stream, encodedOperationResultTr.PaymentResult);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT:
                    PathPaymentResult.Encode(stream, encodedOperationResultTr.PathPaymentResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_OFFER:
                    ManageOfferResult.Encode(stream, encodedOperationResultTr.ManageOfferResult);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
                    ManageOfferResult.Encode(stream, encodedOperationResultTr.CreatePassiveOfferResult);
                    break;

                case OperationType.OperationTypeEnum.SET_OPTIONS:
                    SetOptionsResult.Encode(stream, encodedOperationResultTr.SetOptionsResult);
                    break;

                case OperationType.OperationTypeEnum.CHANGE_TRUST:
                    ChangeTrustResult.Encode(stream, encodedOperationResultTr.ChangeTrustResult);
                    break;

                case OperationType.OperationTypeEnum.ALLOW_TRUST:
                    AllowTrustResult.Encode(stream, encodedOperationResultTr.AllowTrustResult);
                    break;

                case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
                    AccountMergeResult.Encode(stream, encodedOperationResultTr.AccountMergeResult);
                    break;

                case OperationType.OperationTypeEnum.INFLATION:
                    InflationResult.Encode(stream, encodedOperationResultTr.InflationResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_DATA:
                    ManageDataResult.Encode(stream, encodedOperationResultTr.ManageDataResult);
                    break;
                }
            }
Exemple #6
0
        public static OperationResult Decode(IByteReader stream)
        {
            OperationResult decodedOperationResult = new OperationResult();

            decodedOperationResult.Discriminant = OperationResultCode.Decode(stream);
            switch (decodedOperationResult.Discriminant.InnerValue)
            {
            case OperationResultCode.OperationResultCodeEnum.opINNER:
                decodedOperationResult.Tr = OperationResultTr.Decode(stream);
                break;

            default:
                break;
            }
            return(decodedOperationResult);
        }
Exemple #7
0
        public static OperationResult Decode(XdrDataInputStream stream)
        {
            OperationResult     decodedOperationResult = new OperationResult();
            OperationResultCode discriminant           = OperationResultCode.Decode(stream);

            decodedOperationResult.Discriminant = discriminant;

            switch (decodedOperationResult.Discriminant.InnerValue)
            {
            case OperationResultCode.OperationResultCodeEnum.opINNER:
                decodedOperationResult.Tr = OperationResultTr.Decode(stream);
                break;
            }

            return(decodedOperationResult);
        }
 public static void Encode(IByteWriter stream, OperationResultTr encodedOperationResultTr) {
 XdrEncoding.EncodeInt32((int)encodedOperationResultTr.Discriminant.InnerValue, stream);
 switch (encodedOperationResultTr.Discriminant.InnerValue) {
 case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
 CreateAccountResult.Encode(stream, encodedOperationResultTr.CreateAccountResult);
 break;
 case OperationType.OperationTypeEnum.PAYMENT:
 PaymentResult.Encode(stream, encodedOperationResultTr.PaymentResult);
 break;
 case OperationType.OperationTypeEnum.PATH_PAYMENT:
 PathPaymentResult.Encode(stream, encodedOperationResultTr.PathPaymentResult);
 break;
 case OperationType.OperationTypeEnum.MANAGE_OFFER:
 ManageOfferResult.Encode(stream, encodedOperationResultTr.ManageOfferResult);
 break;
 case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
 ManageOfferResult.Encode(stream, encodedOperationResultTr.CreatePassiveOfferResult);
 break;
 case OperationType.OperationTypeEnum.SET_OPTIONS:
 SetOptionsResult.Encode(stream, encodedOperationResultTr.SetOptionsResult);
 break;
 case OperationType.OperationTypeEnum.CHANGE_TRUST:
 ChangeTrustResult.Encode(stream, encodedOperationResultTr.ChangeTrustResult);
 break;
 case OperationType.OperationTypeEnum.ALLOW_TRUST:
 AllowTrustResult.Encode(stream, encodedOperationResultTr.AllowTrustResult);
 break;
 case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
 AccountMergeResult.Encode(stream, encodedOperationResultTr.AccountMergeResult);
 break;
 case OperationType.OperationTypeEnum.INFLATION:
 InflationResult.Encode(stream, encodedOperationResultTr.InflationResult);
 break;
 case OperationType.OperationTypeEnum.MANAGE_DATA:
 ManageDataResult.Encode(stream, encodedOperationResultTr.ManageDataResult);
 break;
 }
 }
 public static OperationResultTr Decode(IByteReader stream) {
   OperationResultTr decodedOperationResultTr = new OperationResultTr();
 decodedOperationResultTr.Discriminant = OperationType.Decode(stream);
 switch (decodedOperationResultTr.Discriminant.InnerValue) {
 case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
 decodedOperationResultTr.CreateAccountResult = CreateAccountResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.PAYMENT:
 decodedOperationResultTr.PaymentResult = PaymentResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.PATH_PAYMENT:
 decodedOperationResultTr.PathPaymentResult = PathPaymentResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.MANAGE_OFFER:
 decodedOperationResultTr.ManageOfferResult = ManageOfferResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
 decodedOperationResultTr.CreatePassiveOfferResult = ManageOfferResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.SET_OPTIONS:
 decodedOperationResultTr.SetOptionsResult = SetOptionsResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.CHANGE_TRUST:
 decodedOperationResultTr.ChangeTrustResult = ChangeTrustResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.ALLOW_TRUST:
 decodedOperationResultTr.AllowTrustResult = AllowTrustResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
 decodedOperationResultTr.AccountMergeResult = AccountMergeResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.INFLATION:
 decodedOperationResultTr.InflationResult = InflationResult.Decode(stream);
 break;
 case OperationType.OperationTypeEnum.MANAGE_DATA:
 decodedOperationResultTr.ManageDataResult = ManageDataResult.Decode(stream);
 break;
 }
   return decodedOperationResultTr;
 }
            public static OperationResultTr Decode(XdrDataInputStream stream)
            {
                OperationResultTr decodedOperationResultTr = new OperationResultTr();
                OperationType     discriminant             = OperationType.Decode(stream);

                decodedOperationResultTr.Discriminant = discriminant;
                switch (decodedOperationResultTr.Discriminant.InnerValue)
                {
                case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
                    decodedOperationResultTr.CreateAccountResult = CreateAccountResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PAYMENT:
                    decodedOperationResultTr.PaymentResult = PaymentResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_RECEIVE:
                    decodedOperationResultTr.PathPaymentStrictReceiveResult = PathPaymentStrictReceiveResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_SELL_OFFER:
                    decodedOperationResultTr.ManageSellOfferResult = ManageSellOfferResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER:
                    decodedOperationResultTr.CreatePassiveSellOfferResult = ManageSellOfferResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.SET_OPTIONS:
                    decodedOperationResultTr.SetOptionsResult = SetOptionsResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CHANGE_TRUST:
                    decodedOperationResultTr.ChangeTrustResult = ChangeTrustResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.ALLOW_TRUST:
                    decodedOperationResultTr.AllowTrustResult = AllowTrustResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
                    decodedOperationResultTr.AccountMergeResult = AccountMergeResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.INFLATION:
                    decodedOperationResultTr.InflationResult = InflationResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_DATA:
                    decodedOperationResultTr.ManageDataResult = ManageDataResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.BUMP_SEQUENCE:
                    decodedOperationResultTr.BumpSeqResult = BumpSequenceResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_BUY_OFFER:
                    decodedOperationResultTr.ManageBuyOfferResult = ManageBuyOfferResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_SEND:
                    decodedOperationResultTr.PathPaymentStrictSendResult = PathPaymentStrictSendResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CREATE_CLAIMABLE_BALANCE:
                    decodedOperationResultTr.CreateClaimableBalanceResult = CreateClaimableBalanceResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CLAIM_CLAIMABLE_BALANCE:
                    decodedOperationResultTr.ClaimClaimableBalanceResult = ClaimClaimableBalanceResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.BEGIN_SPONSORING_FUTURE_RESERVES:
                    decodedOperationResultTr.BeginSponsoringFutureReservesResult = BeginSponsoringFutureReservesResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.END_SPONSORING_FUTURE_RESERVES:
                    decodedOperationResultTr.EndSponsoringFutureReservesResult = EndSponsoringFutureReservesResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.REVOKE_SPONSORSHIP:
                    decodedOperationResultTr.RevokeSponsorshipResult = RevokeSponsorshipResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CLAWBACK:
                    decodedOperationResultTr.ClawbackResult = ClawbackResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CLAWBACK_CLAIMABLE_BALANCE:
                    decodedOperationResultTr.ClawbackClaimableBalanceResult = ClawbackClaimableBalanceResult.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.SET_TRUST_LINE_FLAGS:
                    decodedOperationResultTr.SetTrustLineFlagsResult = SetTrustLineFlagsResult.Decode(stream);
                    break;
                }
                return(decodedOperationResultTr);
            }
            public static void Encode(XdrDataOutputStream stream, OperationResultTr encodedOperationResultTr)
            {
                stream.WriteInt((int)encodedOperationResultTr.Discriminant.InnerValue);
                switch (encodedOperationResultTr.Discriminant.InnerValue)
                {
                case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
                    CreateAccountResult.Encode(stream, encodedOperationResultTr.CreateAccountResult);
                    break;

                case OperationType.OperationTypeEnum.PAYMENT:
                    PaymentResult.Encode(stream, encodedOperationResultTr.PaymentResult);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_RECEIVE:
                    PathPaymentStrictReceiveResult.Encode(stream, encodedOperationResultTr.PathPaymentStrictReceiveResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_SELL_OFFER:
                    ManageSellOfferResult.Encode(stream, encodedOperationResultTr.ManageSellOfferResult);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER:
                    ManageSellOfferResult.Encode(stream, encodedOperationResultTr.CreatePassiveSellOfferResult);
                    break;

                case OperationType.OperationTypeEnum.SET_OPTIONS:
                    SetOptionsResult.Encode(stream, encodedOperationResultTr.SetOptionsResult);
                    break;

                case OperationType.OperationTypeEnum.CHANGE_TRUST:
                    ChangeTrustResult.Encode(stream, encodedOperationResultTr.ChangeTrustResult);
                    break;

                case OperationType.OperationTypeEnum.ALLOW_TRUST:
                    AllowTrustResult.Encode(stream, encodedOperationResultTr.AllowTrustResult);
                    break;

                case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
                    AccountMergeResult.Encode(stream, encodedOperationResultTr.AccountMergeResult);
                    break;

                case OperationType.OperationTypeEnum.INFLATION:
                    InflationResult.Encode(stream, encodedOperationResultTr.InflationResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_DATA:
                    ManageDataResult.Encode(stream, encodedOperationResultTr.ManageDataResult);
                    break;

                case OperationType.OperationTypeEnum.BUMP_SEQUENCE:
                    BumpSequenceResult.Encode(stream, encodedOperationResultTr.BumpSeqResult);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_BUY_OFFER:
                    ManageBuyOfferResult.Encode(stream, encodedOperationResultTr.ManageBuyOfferResult);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_SEND:
                    PathPaymentStrictSendResult.Encode(stream, encodedOperationResultTr.PathPaymentStrictSendResult);
                    break;

                case OperationType.OperationTypeEnum.CREATE_CLAIMABLE_BALANCE:
                    CreateClaimableBalanceResult.Encode(stream, encodedOperationResultTr.CreateClaimableBalanceResult);
                    break;

                case OperationType.OperationTypeEnum.CLAIM_CLAIMABLE_BALANCE:
                    ClaimClaimableBalanceResult.Encode(stream, encodedOperationResultTr.ClaimClaimableBalanceResult);
                    break;

                case OperationType.OperationTypeEnum.BEGIN_SPONSORING_FUTURE_RESERVES:
                    BeginSponsoringFutureReservesResult.Encode(stream, encodedOperationResultTr.BeginSponsoringFutureReservesResult);
                    break;

                case OperationType.OperationTypeEnum.END_SPONSORING_FUTURE_RESERVES:
                    EndSponsoringFutureReservesResult.Encode(stream, encodedOperationResultTr.EndSponsoringFutureReservesResult);
                    break;

                case OperationType.OperationTypeEnum.REVOKE_SPONSORSHIP:
                    RevokeSponsorshipResult.Encode(stream, encodedOperationResultTr.RevokeSponsorshipResult);
                    break;

                case OperationType.OperationTypeEnum.CLAWBACK:
                    ClawbackResult.Encode(stream, encodedOperationResultTr.ClawbackResult);
                    break;

                case OperationType.OperationTypeEnum.CLAWBACK_CLAIMABLE_BALANCE:
                    ClawbackClaimableBalanceResult.Encode(stream, encodedOperationResultTr.ClawbackClaimableBalanceResult);
                    break;

                case OperationType.OperationTypeEnum.SET_TRUST_LINE_FLAGS:
                    SetTrustLineFlagsResult.Encode(stream, encodedOperationResultTr.SetTrustLineFlagsResult);
                    break;
                }
            }