Skip to content

Commit

Permalink
Merge branch 'bitpay:master' into remove-dup-address-test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukerhoads authored Aug 19, 2021
2 parents 048fa4c + e5e2bf3 commit 3a6605d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/bitcore-wallet-client/src/lib/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ export class Utils {

return t;
} else {
// ETH ERC20 XRP
const {
data,
destinationTag,
Expand All @@ -434,8 +435,13 @@ export class Utils {
// If it is a token swap its an already created ERC20 transaction so we skip it and go directly to ETH transaction create
const isERC20 = tokenAddress && !payProUrl && !isTokenSwap;
const isETHMULTISIG = multisigContractAddress;
// using ETH as default since getChain returns undefined for custom tokens
const chain = isETHMULTISIG ? 'ETHMULTISIG' : isERC20 ? 'ERC20' : 'ETH';
const chain = isETHMULTISIG
? 'ETHMULTISIG'
: isERC20
? 'ERC20'
: txp.chain
? txp.chain.toUpperCase()
: this.getChain(coin);
for (let index = 0; index < recipients.length; index++) {
const rawTx = Transactions.create({
...txp,
Expand Down
4 changes: 2 additions & 2 deletions packages/bitcore-wallet-service/src/lib/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ export class Storage {
walletId: 1,
createdOn: 1
});

db.collection(collections.ADDRESSES).createIndex(
{
address: 1
address: 1,
coin: 1
},
{ unique: true }
);
Expand Down

0 comments on commit 3a6605d

Please sign in to comment.