Esempio n. 1
0
        public static LedgerEntryChange Decode(XdrDataInputStream stream)
        {
            LedgerEntryChange     decodedLedgerEntryChange = new LedgerEntryChange();
            LedgerEntryChangeType 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);
        }
Esempio n. 2
0
        public static BucketEntry Decode(XdrDataInputStream stream)
        {
            BucketEntry     decodedBucketEntry = new BucketEntry();
            BucketEntryType 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);
        }