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); }
public static void Encode(IByteWriter stream, LedgerUpgradeType value) { XdrEncoding.EncodeInt32((int)value.InnerValue, stream); }