Pass actual address when calling contract (#955)

This commit is contained in:
Jaco Greeff 2019-04-10 20:25:52 +02:00 committed by GitHub
parent ab98dc0581
commit 937073f1c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 984 additions and 490 deletions

View File

@ -10,14 +10,14 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^0.77.0-beta.1",
"@polkadot/api": "^0.77.0-beta.3",
"@polkadot/keyring": "^0.76.1",
"@polkadot/types": "^0.77.0-beta.1",
"@polkadot/types": "^0.77.0-beta.3",
"@polkadot/util": "^0.76.1",
"@polkadot/util-crypto": "^0.76.1",
"babel-core": "^7.0.0-bridge.0",
"rxjs": "^6.4.0",
"typescript": "^3.4.1"
"typescript": "^3.4.3"
},
"scripts": {
"analyze": "yarn run build && cd packages/apps && yarn run source-map-explorer build/main.*.js",
@ -33,7 +33,7 @@
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/runtime": "^7.4.3",
"@polkadot/dev-react": "^0.30.0-beta.0",
"@polkadot/dev-react": "^0.30.0-beta.1",
"@polkadot/ts": "^0.1.56",
"autoprefixer": "^9.4.9",
"empty": "^0.10.1",

View File

@ -64,7 +64,7 @@ class Call extends React.PureComponent<Props, State> {
: undefined;
const isEndowValid = !endowment.isZero();
const isGasValid = !gasLimit.isZero();
const isValid = !!accountId && isEndowValid && isGasValid;
const isValid = !!accountId && isEndowValid && isGasValid && isAddressValid;
return (
<div className='contracts--Call'>
@ -130,13 +130,13 @@ class Call extends React.PureComponent<Props, State> {
}
private constructCall = (): Array<any> => {
const { contractAbi, endowment, gasLimit, method, params } = this.state;
const { address, contractAbi, endowment, gasLimit, method, params } = this.state;
if (!contractAbi || !method) {
return [];
}
return [endowment, gasLimit, contractAbi.messages[method](...params)];
return [address, endowment, gasLimit, contractAbi.messages[method](...params)];
}
private onChangeAccount = (accountId: string | null): void => {

View File

@ -31,7 +31,7 @@
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
"dependencies": {
"@babel/runtime": "^7.4.3",
"@polkadot/api": "^0.77.0-beta.1",
"@polkadot/api": "^0.77.0-beta.3",
"rxjs-compat": "^6.3.2"
}
}

1458
yarn.lock

File diff suppressed because it is too large Load Diff