fromAmino static method

dynamic fromAmino(
  1. dynamic data
)

Implementation

static dynamic fromAmino(dynamic data) {
  String typeVersion = data.type;
  switch (typeVersion) {
    case ProposalConstants.TEXT_SOFTWARE:
      return TextProposal.fromAmino(data as TextProposalAminoArgs);
    case ProposalConstants.COMMUNITY_POOL_SPENDPOOL_PROPOSAL:
      return CommunityPoolSpendProposal.fromAmino(
          data as CommunityPoolSpendProposalAminoArgs);
    case ProposalConstants.PARAMETER_CHANGE_SOFTWARE_UPGRADE_PROPOSAL:
      return ParameterChangeProposal.fromAmino(
          data as ParameterChangeProposalAminoArgs);
    case ProposalConstants.SOFTWARE_UPGRADE_PROPOSAL:
      return SoftwareUpgradeProposal.fromAmino(
          data as SoftwareUpgradeProposalAminoArgs);
    case ProposalConstants.CANCEL_SOFTWARE_UPGRADE_PROPOSAL:
      return CancelSoftwareUpgradeProposal.fromAmino(
          data as CancelSoftwareUpgradeProposalAminoArgs);
    case ProposalConstants.IBC_CLIENTUPDATE_PROPOSAL:
      return ClientUpdateProposal.fromAmino(
          data as ClientUpdateProposalAminoArgs);
  }

  return null;
}