Merge remote-tracking branch 'origin/develop' into vb-fix-path-for-hd-walet

This commit is contained in:
Victor Baranov 2020-02-27 19:54:56 +03:00
commit 68116565fe
3 changed files with 15 additions and 5 deletions

View File

@ -3,6 +3,7 @@
## Current Master
- [#317](https://github.com/poanetwork/nifty-wallet/pull/317) - Fix path to derive accounts in HD wallets for RSK, ETC
- [#318](https://github.com/poanetwork/nifty-wallet/pull/318) - (Fix) pasting of ABI for contract type account
## 4.11.10 Tue Feb 04 2020

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)

View File

@ -161,9 +161,10 @@ class SendTransactionScreen extends PersistentForm {
options={this.state.options}
style={{ marginBottom: '10px' }}
onChange={(opt) => {
const isConstantMethod = opt.metadata && (opt.metadata.constant || opt.metadata.stateMutability === 'view')
this.setState({
methodSelected: opt.value,
isConstantMethod: opt.metadata.constant,
isConstantMethod: isConstantMethod,
methodABI: opt.metadata,
outputValues: {},
inputValues: {},