Esempio n. 1
0
        public static LedgerUpgrade Decode(XdrDataInputStream stream)
        {
            LedgerUpgrade     decodedLedgerUpgrade = new LedgerUpgrade();
            LedgerUpgradeType discriminant         = LedgerUpgradeType.Decode(stream);

            decodedLedgerUpgrade.Discriminant = discriminant;
            switch (decodedLedgerUpgrade.Discriminant.InnerValue)
            {
            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_VERSION:
                decodedLedgerUpgrade.NewLedgerVersion = Uint32.Decode(stream);
                break;

            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_BASE_FEE:
                decodedLedgerUpgrade.NewBaseFee = Uint32.Decode(stream);
                break;

            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_MAX_TX_SET_SIZE:
                decodedLedgerUpgrade.NewMaxTxSetSize = Uint32.Decode(stream);
                break;

            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_BASE_RESERVE:
                decodedLedgerUpgrade.NewBaseReserve = Uint32.Decode(stream);
                break;
            }
            return(decodedLedgerUpgrade);
        }
Esempio n. 2
0
        public static UpgradeEntryMeta Decode(XdrDataInputStream stream)
        {
            UpgradeEntryMeta decodedUpgradeEntryMeta = new UpgradeEntryMeta();

            decodedUpgradeEntryMeta.Upgrade = LedgerUpgrade.Decode(stream);
            decodedUpgradeEntryMeta.Changes = LedgerEntryChanges.Decode(stream);
            return(decodedUpgradeEntryMeta);
        }
Esempio n. 3
0
        public static void Encode(XdrDataOutputStream stream, LedgerUpgrade encodedLedgerUpgrade)
        {
            stream.WriteInt((int)encodedLedgerUpgrade.Discriminant.InnerValue);
            switch (encodedLedgerUpgrade.Discriminant.InnerValue)
            {
            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_VERSION:
                Uint32.Encode(stream, encodedLedgerUpgrade.NewLedgerVersion);
                break;

            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_BASE_FEE:
                Uint32.Encode(stream, encodedLedgerUpgrade.NewBaseFee);
                break;

            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_MAX_TX_SET_SIZE:
                Uint32.Encode(stream, encodedLedgerUpgrade.NewMaxTxSetSize);
                break;

            case LedgerUpgradeType.LedgerUpgradeTypeEnum.LEDGER_UPGRADE_BASE_RESERVE:
                Uint32.Encode(stream, encodedLedgerUpgrade.NewBaseReserve);
                break;
            }
        }
Esempio n. 4
0
 public static void Encode(XdrDataOutputStream stream, UpgradeEntryMeta encodedUpgradeEntryMeta)
 {
     LedgerUpgrade.Encode(stream, encodedUpgradeEntryMeta.Upgrade);
     LedgerEntryChanges.Encode(stream, encodedUpgradeEntryMeta.Changes);
 }