Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/payment requests #1712

Merged
merged 3 commits into from
Jul 23, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`AssetIcon should render correctly 1`] = `
}
source={
Object {
"uri": "https://raw.githubusercontent.com/metamask/eth-contract-metadata/v1.12.1/images/metamark.svg",
"uri": "https://raw.githubusercontent.com/metamask/eth-contract-metadata/v1.15.0/images/metamark.svg",
}
}
style={
Expand Down
9 changes: 6 additions & 3 deletions app/components/UI/PaymentRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import {
isDecimal,
fiatNumberToTokenMinimalUnit,
renderFromTokenMinimalUnit,
fromTokenMinimalUnit
fromTokenMinimalUnit,
toTokenMinimalUnit
} from '../../../util/number';
import { strings } from '../../../../locales/i18n';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
Expand Down Expand Up @@ -540,9 +541,11 @@ class PaymentRequest extends PureComponent {
try {
let eth_link;
if (selectedAsset.isETH) {
eth_link = generateETHLink(selectedAddress, cryptoAmount, chainId);
const amount = toWei(cryptoAmount).toString();
eth_link = generateETHLink(selectedAddress, amount, chainId);
} else {
eth_link = generateERC20Link(selectedAddress, selectedAsset.address, cryptoAmount, chainId);
const amount = toTokenMinimalUnit(cryptoAmount, selectedAsset.decimals).toString();
eth_link = generateERC20Link(selectedAddress, selectedAsset.address, amount, chainId);
}

// Convert to universal link / app link
Expand Down
2 changes: 1 addition & 1 deletion app/util/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
export default function getAssetLogoPath(logo) {
if (!logo) return;
const path = 'https://raw.githubusercontent.com/metamask/eth-contract-metadata/v1.12.1/images/';
const path = 'https://raw.githubusercontent.com/metamask/eth-contract-metadata/v1.15.0/images/';
const uri = path + logo;
return uri;
}
2 changes: 1 addition & 1 deletion app/util/payment-link-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function generateETHLink(receiverAddress, value, chainId) {
chain_id: chainId,
function_name: undefined,
parameters: {
value: value + 'e18'
value
},
scheme: 'ethereum',
target_address: receiverAddress
Expand Down