Skip to content

Commit

Permalink
Text proposal (#6)
Browse files Browse the repository at this point in the history
* update rarimo client, add text proposal localization
  • Loading branch information
lukachi authored Mar 19, 2024
1 parent 5b631d2 commit c7476d7
Show file tree
Hide file tree
Showing 8 changed files with 1,749 additions and 1,972 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].

## [Unreleased]
### Added
- `Text` Proposal type

## [1.1.4] - 2024-03-08
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@hookform/resolvers": "^3.3.1",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.3",
"@rarimo/client": "^2.0.0-rc.34",
"@rarimo/client": "^2.2.0",
"graphql": "^16.7.1",
"graphql-tag": "^2.12.6",
"lodash-es": "^4.17.21",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Forms/DelegateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export default function DelegateForm({
[DelegateFormFieldNames.Delegator]: isDelegation
? address
: availableUndelegators.includes(address)
? address
: availableUndelegators[0],
? address
: availableUndelegators[0],
}

const granters = useMemo(() => {
Expand Down
1 change: 1 addition & 0 deletions src/const/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const PROPOSAL_TYPES_MAP = {
'bridge/ChangeParamsProposal': ProposalType.BridgeChangeParams,
'oraclemanager/OracleUnfreezeProposal': ProposalType.OracleUnfreeze,
'oraclemanager/ChangeParamsProposal': ProposalType.OracleChangeParams,
'/cosmos.gov.v1beta1.TextProposal': ProposalType.Text,
ParameterChange: ProposalType.ParameterChange,
SoftwareUpgrade: ProposalType.SoftwareUpgrade,
CancelSoftwareUpgrade: ProposalType.CancelSoftwareUpgrade,
Expand Down
5 changes: 3 additions & 2 deletions src/helpers/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ export const parseAddress = (

if (!senderEvent) return ''

const senderAddressHex = senderEvent.attributes?.find(i => i.key === 'sender' && isHex(i.value))
?.value
const senderAddressHex = senderEvent.attributes?.find(
i => i.key === 'sender' && isHex(i.value),
)?.value

if (!senderAddressHex) return ''

Expand Down
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export default {
"parameter-change-lbl": "Parameter Change",
"community-pool-spend-lbl": "Community Pool Spend",
"mint-tokens-lbl": "Mint Tokens",
"text-lbl": "Text",
"unknown-lbl": "Unknown",
},
"proposal-vote": {
Expand Down
1 change: 1 addition & 0 deletions src/locales/localizers/proposal-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ export const localizeProposalType = (t: TFunction, type: ProposalType) =>
[ProposalType.ParameterChange]: t('proposal-type.parameter-change-lbl'),
[ProposalType.CommunityPoolSpend]: t('proposal-type.community-pool-spend-lbl'),
[ProposalType.MintTokens]: t('proposal-type.mint-tokens-lbl'),
[ProposalType.Text]: t('proposal-type.text-lbl'),
}[type])
Loading

0 comments on commit c7476d7

Please sign in to comment.