public static LedgerEntryChange Decode(XdrDataInputStream stream)
        {
            var decodedLedgerEntryChange = new LedgerEntryChange();
            var discriminant             = LedgerEntryChangeType.Decode(stream);

            decodedLedgerEntryChange.Discriminant = discriminant;
            switch (decodedLedgerEntryChange.Discriminant.InnerValue)
            {
            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_CREATED:
                decodedLedgerEntryChange.Created = LedgerEntry.Decode(stream);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_UPDATED:
                decodedLedgerEntryChange.Updated = LedgerEntry.Decode(stream);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_REMOVED:
                decodedLedgerEntryChange.Removed = LedgerKey.Decode(stream);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_STATE:
                decodedLedgerEntryChange.State = LedgerEntry.Decode(stream);
                break;
            }
            return(decodedLedgerEntryChange);
        }
        public static BucketEntry Decode(IByteReader stream)
        {
            BucketEntry decodedBucketEntry = new BucketEntry();

            decodedBucketEntry.Discriminant = BucketEntryType.Decode(stream);
            switch (decodedBucketEntry.Discriminant.InnerValue)
            {
            case BucketEntryType.BucketEntryTypeEnum.LIVEENTRY:
                decodedBucketEntry.LiveEntry = LedgerEntry.Decode(stream);
                break;

            case BucketEntryType.BucketEntryTypeEnum.DEADENTRY:
                decodedBucketEntry.DeadEntry = LedgerKey.Decode(stream);
                break;
            }
            return(decodedBucketEntry);
        }
        public static BucketEntry Decode(XdrDataInputStream stream)
        {
            var decodedBucketEntry = new BucketEntry();
            var discriminant       = BucketEntryType.Decode(stream);

            decodedBucketEntry.Discriminant = discriminant;
            switch (decodedBucketEntry.Discriminant.InnerValue)
            {
            case BucketEntryType.BucketEntryTypeEnum.LIVEENTRY:
                decodedBucketEntry.LiveEntry = LedgerEntry.Decode(stream);
                break;

            case BucketEntryType.BucketEntryTypeEnum.DEADENTRY:
                decodedBucketEntry.DeadEntry = LedgerKey.Decode(stream);
                break;
            }
            return(decodedBucketEntry);
        }