VoteProgramInitializeAccountLayout.fromBuffer constructor

VoteProgramInitializeAccountLayout.fromBuffer(
  1. List<int> data
)

Implementation

factory VoteProgramInitializeAccountLayout.fromBuffer(List<int> data) {
  final decode = ProgramLayout.decodeAndValidateStruct(
      layout: _layout,
      bytes: data,
      instruction: VoteProgramInstruction.initializeAccount.insturction);
  final voteData = Map<String, dynamic>.from(decode["voteInit"]);
  return VoteProgramInitializeAccountLayout(
    nodePubkey: voteData["nodePubkey"],
    authorizedVoter: voteData["authorizedVoter"],
    authorizedWithdrawer: voteData["authorizedWithdrawer"],
    commission: voteData["commission"],
  );
}