fromData static method

dynamic fromData(
  1. dynamic data
)

Implementation

static dynamic fromData(dynamic data) {
  String typeVersion = data.type;
  switch (typeVersion) {
    case ProposalConstants.TEXT_SOFTWARE:
      return TextProposal.fromData(data as TextProposalDataArgs);
    case ProposalConstants.COMMUNITY_POOL_SPENDPOOL_PROPOSAL:
      return CommunityPoolSpendProposal.fromData(
          data as CommunityPoolSpendProposalDataArgs);
    case ProposalConstants.PARAMETER_CHANGE_SOFTWARE_UPGRADE_PROPOSAL:
      return ParameterChangeProposal.fromData(
          data as ParameterChangeProposalDataArgs);
    case ProposalConstants.SOFTWARE_UPGRADE_PROPOSAL:
      return SoftwareUpgradeProposal.fromData(
          data as SoftwareUpgradeProposalDataArgs);
    case ProposalConstants.CANCEL_SOFTWARE_UPGRADE_PROPOSAL:
      return CancelSoftwareUpgradeProposal.fromData(
          data as CancelSoftwareUpgradeProposalDataArgs);
    case ProposalConstants.IBC_CLIENTUPDATE_PROPOSAL:
      return ClientUpdateProposal.fromData(
          data as ClientUpdateProposalDataArgs);
  }

  return null;
}