Skip to content
This repository was archived by the owner on Apr 15, 2019. It is now read-only.

Disallow lowercase l in address - Closes #1070 #1071

Merged
merged 2 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/send/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Send extends React.Component {
...authStatePrefill(),
};
this.inputValidationRegexps = {
recipient: /^\d{1,21}[L|l]$/,
recipient: /^\d{1,21}L$/,
amount: /^\d+(\.\d{1,8})?$/,
};
}
Expand Down
12 changes: 6 additions & 6 deletions src/utils/api/account.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Lisk from 'lisk-js';

export const getAccount = (activePeer, address) =>
new Promise((resolve) => {
new Promise((resolve, reject) => {
activePeer.accounts.get({ address }).then((res) => {
if (res.data.length > 0) {
resolve({
Expand All @@ -16,21 +16,21 @@ export const getAccount = (activePeer, address) =>
balance: 0,
});
}
});
}).catch(reject);
});

export const setSecondPassphrase = (activePeer, secondPassphrase, publicKey, passphrase) =>
new Promise((resolve) => {
new Promise((resolve, reject) => {
const transaction = Lisk.transaction
.registerSecondPassphrase({ passphrase, secondPassphrase });
activePeer.transactions.broadcast(transaction).then(() => {
resolve(transaction);
});
}).catch(reject);
});

export const send = (activePeer, recipientId, amount,
passphrase, secondPassphrase = null, data = null) =>
new Promise((resolve) => {
new Promise((resolve, reject) => {
const transaction = Lisk.transaction
.transfer({
recipientId,
Expand All @@ -41,7 +41,7 @@ export const send = (activePeer, recipientId, amount,
});
activePeer.transactions.broadcast(transaction).then(() => {
resolve(transaction);
});
}).catch(reject);
});

export const transactions = (activePeer, address, limit = 20, offset = 0, sort = 'timestamp:desc') =>
Expand Down
4 changes: 2 additions & 2 deletions src/utils/api/delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ export const unvoteAutocomplete = (username, votedDict) =>
);

export const registerDelegate = (activePeer, username, passphrase, secondPassphrase = null) =>
new Promise((resolve) => {
new Promise((resolve, reject) => {
const transaction = Lisk.transaction
.registerDelegate({
username,
passphrase,
secondPassphrase });
activePeer.transactions.broadcast(transaction).then(() => {
resolve(transaction);
});
}).catch(reject);
});