Skip to content

Commit

Permalink
fix(withwithdrawInflationToRecipient): fix script generation
Browse files Browse the repository at this point in the history
  • Loading branch information
envin3 committed Sep 19, 2024
1 parent 2aef1f8 commit 2164e45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/utils/presets/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const prepareTransfer = (tokenAddress, receiverAddress, rawAmount) => [

export const prepareInflationProposal = async (ethPNTAddress, receiverAddress, rawAmount) => {
return _.flattenDeep([
prepareWithdrawInflation(ethPNTAddress, receiverAddress),
prepareWithdrawInflation(ethPNTAddress, rawAmount),
prepareTransfer(ethPNTAddress, receiverAddress, rawAmount)
])
}
Expand Down
10 changes: 6 additions & 4 deletions src/utils/presets/withdrawInflationToRecipient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const withdrawInflationToRecipient = ({ presetParams, setPresetParams }) => ({
fontSize: 15
},
placeholder: 'Receiver address ...',
value: presetParams[1] || '',
value: presetParams[0] || '',
onChange: (_e) =>
setPresetParams({
...presetParams,
1: _e.target.value
0: _e.target.value
})
}
},
Expand All @@ -34,11 +34,11 @@ const withdrawInflationToRecipient = ({ presetParams, setPresetParams }) => ({
fontSize: 15
},
placeholder: 'Amount ...',
value: presetParams[2] || '',
value: presetParams[1] || '',
onChange: (_e) =>
setPresetParams({
...presetParams,
2: _e.target.value
1: _e.target.value
})
}
}
Expand All @@ -49,6 +49,8 @@ const withdrawInflationToRecipient = ({ presetParams, setPresetParams }) => ({

const inflationData = prepareInflationData(params[1])

console.log(params)

if (!ethers.utils.isAddress(params[0])) throw new Error('Inserted destination address is not valid')

return prepareInflationProposal(inflationData.ethPNTAddress, params[0], inflationData.rawAmount)
Expand Down

0 comments on commit 2164e45

Please sign in to comment.