// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten

import Foundation

// === xdr source ============================================================

//  struct SingleChoiceVote
//  {
//      uint32 choice;
//      EmptyExt ext;
//  };

//  ===========================================================================
public struct SingleChoiceVote: XDRCodable {
  public var choice: Uint32
  public var ext: EmptyExt

  public init(
      choice: Uint32,
      ext: EmptyExt) {

    self.choice = choice
    self.ext = ext
  }

  public func toXDR() -> Data {
    var xdr = Data()

    xdr.append(self.choice.toXDR())
    xdr.append(self.ext.toXDR())

    return xdr
  }

  public init(xdrData: inout Data) throws {
    self.choice = try Uint32(xdrData: &xdrData)
    self.ext = try EmptyExt(xdrData: &xdrData)
  }
}
