Skip to content

Commit e807f82

Browse files
author
jagdeep sidhu
committed
check src address on eth to sys wizard
1 parent 6adc70f commit e807f82

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/wizard/Step1EthToSys.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,14 @@ class Step1ES extends Component {
384384
this.setState(Object.assign(userInput, validateNewInput, this._validationErrors(validateNewInput)));
385385
let syscoinERC20Manager = new web3.eth.Contract(erc20Managerabi, CONFIGURATION.ERC20Manager);
386386
let contractBase = new web3.eth.Contract(assetabi, userInput.sysxContract);
387-
let fromAccount = userInput.sysxFromAccount;
387+
if (!web3.utils.isAddress(userInput.sysxFromAccount)) {
388+
validateNewInput.buttonVal = false;
389+
validateNewInput.buttonValMsg = this.props.t("step1InvalidNEVM");
390+
this.setState({working: false});
391+
this.setState(Object.assign(userInput, validateNewInput, this._validationErrors(validateNewInput)));
392+
return;
393+
}
394+
let fromAccount = userInput.sysxFromAccount;
388395
let assetGUID = userInput.toSysAssetGUID;
389396
let syscoinWitnessAddress = userInput.syscoinWitnessAddress;
390397
try {

src/wizard/Step1SysToEth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class Step1 extends Component {
143143
if (!web3.utils.isAddress(userInput.ethaddress)) {
144144
validateNewInput.buttonVal = false;
145145
validateNewInput.buttonValMsg = this.props.t("step1FSInvalidDestination");
146-
self.setState({working: false});
147-
self.setState(Object.assign(userInput, validateNewInput, this._validationErrors(validateNewInput)));
146+
this.setState({working: false});
147+
this.setState(Object.assign(userInput, validateNewInput, this._validationErrors(validateNewInput)));
148148
return;
149149
}
150150
let self = this;

src/wizard/i18n.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ i18n.use(LanguageDetector).init({
4646
'step1ESEnterWitnessAddress': 'Enter receiving Syscoin address...',
4747
'step1FSInputMissing': 'Amount or destination address not provided',
4848
'step1FSInvalidDestination': 'Invalid destination address (check the type of network you are sending from/to)',
49+
'step1InvalidNEVM': 'Invalid NEVM address',
4950
'step1FSStatus': 'Status',
5051
'step1FSAmount': 'Amount',
5152
'step1FSDestinationAddress': 'Destination Address',
@@ -184,6 +185,7 @@ i18n.use(LanguageDetector).init({
184185
'step1ESEnterWitnessAddress': 'Enter receiving Syscoin address...',
185186
'step1FSInputMissing': 'Amount or destination address not provided',
186187
'step1FSInvalidDestination': 'Invalid destination address (check the type of network you are sending from/to)',
188+
'step1InvalidNEVM': 'Invalid NEVM address',
187189
'step1FSStatus': 'Status',
188190
'step1FSAmount': 'Amount',
189191
'step1FSDestinationAddress': 'Destination Address',
@@ -322,6 +324,7 @@ i18n.use(LanguageDetector).init({
322324
'step1ESEnterWitnessAddress': 'Enter receiving Syscoin address...',
323325
'step1FSInputMissing': 'Amount or destination address not provided',
324326
'step1FSInvalidDestination': 'Invalid destination address (check the type of network you are sending from/to)',
327+
'step1InvalidNEVM': 'Invalid NEVM address',
325328
'step1FSStatus': 'Status',
326329
'step1FSAmount': 'Amount',
327330
'step1FSDestinationAddress': 'Destination Address',

0 commit comments

Comments
 (0)