Merge pull request #318 from poanetwork/vb-fix-pasting-abi

Fix pasting of ABI for contract type account
This commit is contained in:
Victor Baranov 2020-02-23 21:49:21 +03:00 committed by GitHub
commit 8d86a60a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -2,6 +2,8 @@
## Current Master
- [#318](https://github.com/poanetwork/nifty-wallet/pull/318) - (Fix) pasting of ABI for contract type account
## 4.11.10 Tue Feb 04 2020
- [#313](https://github.com/poanetwork/nifty-wallet/pull/313) - Change Ethereum classic RPC endpoint

View File

@ -41,13 +41,13 @@ class ContractImportView extends Component {
})
}
abiOnChange (abi) {
abiOnChange (abi, APIInputDisabled) {
this.props.hideWarning()
try {
if (abi) {
this.setState({
abi: JSON.stringify(abi),
abiInputDisabled: true,
abi: abi,
abiInputDisabled: APIInputDisabled || false,
importDisabled: false,
})
}
@ -124,7 +124,15 @@ class ContractImportView extends Component {
return
}
getFullABI(web3.eth, contractAddr, network, type)
.then(finalABI => this.abiOnChange(finalABI))
.then(finalABI => {
if (finalABI) {
finalABI = JSON.stringify(finalABI)
const APIInputDisabled = true
return this.abiOnChange(finalABI, APIInputDisabled)
} else {
return null
}
})
.catch(e => {
this.clearAbi()
log.debug(e)