Skip to content

Commit

Permalink
[hotfix] - only calculate fees on n3 chain (#2398)
Browse files Browse the repository at this point in the history
* only calculate fees on n3 chain

* Bump version
  • Loading branch information
comountainclimber authored Mar 11, 2022
1 parent a37b7d2 commit 4e81707
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion __tests__/components/__snapshots__/Settings.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ exports[`Settings renders without crashing 1`] = `
Manage your neon wallet
</FormattedMessage>
- v
2.12.6
2.12.7
</div>
<div
className="settingsPanelHeaderItem"
Expand Down
23 changes: 14 additions & 9 deletions app/containers/Send/Send.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,16 @@ export default class Send extends React.Component<Props, State> {
this.updateRowField(0, 'address', account.address)
}

// Calculate expected gas fee
this.setState({ loading: true })
const results = await this.attemptToCalculateN3Fees([])
if (results) {
const transactionFee = (
Number(results.networkFee) + Number(results.systemFee)
).toFixed(8)
this.setState({ expectedGasFee: transactionFee })
if (this.props.chain === 'neo3') {
// Calculate expected gas fee
this.setState({ loading: true })
const results = await this.attemptToCalculateN3Fees([])
if (results) {
const transactionFee = (
Number(results.networkFee) + Number(results.systemFee)
).toFixed(8)
this.setState({ expectedGasFee: transactionFee })
}
}
}

Expand Down Expand Up @@ -203,7 +205,10 @@ export default class Send extends React.Component<Props, State> {
if (newState.length > 1) {
newState.splice(index, 1)
}
this.attemptToCalculateN3Fees(newState)

if (this.props.chain === 'neo3') {
this.attemptToCalculateN3Fees(newState)
}
return { sendRowDetails: newState }
})
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Neon",
"version": "2.12.6",
"version": "2.12.7",
"main": "./main.js",
"description": "Light wallet for NEO blockchain",
"homepage": "https://github.com/CityOfZion/neon-wallet",
Expand Down

0 comments on commit 4e81707

Please sign in to comment.