Skip to content

Commit

Permalink
Merge branch 'master' into docs-portal-invoice-api
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-abrioux committed Oct 20, 2021
2 parents 35e119c + eff06e9 commit a7635ee
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 6 deletions.
23 changes: 23 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- vrolland
- benjlevesque
- yomarion
- bertux
- kevindavee
- alexandre-abrioux
- KolevDarko

# A list of keywords to be skipped the process that add reviewers if pull requests include it
skipKeywords:
- wip

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 4
10 changes: 10 additions & 0 deletions .github/workflows/auto_assign_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Auto Assign'
on:
pull_request:
types: [opened, ready_for_review]

jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/auto-assign-action@v1.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default class Erc20FeeProxyPaymentNetwork<
'fuse',
'bsctest',
'bsc',
'xdai',
],
public supportedCurrencyType: RequestLogicTypes.CURRENCY = RequestLogicTypes.CURRENCY.ERC20,
) {
Expand Down
2 changes: 2 additions & 0 deletions packages/currency/src/erc20/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { TokenMap } from './types';
import { supportedFantomTokens } from './fantom';
import { supportedBSCTestERC20 } from './bsctest';
import { supportedBSCERC20 } from './bsc';
import { supportedXDAIERC20 } from './xdai';

export const supportedNetworks: Record<string, TokenMap> = {
celo: supportedCeloERC20,
Expand All @@ -15,6 +16,7 @@ export const supportedNetworks: Record<string, TokenMap> = {
fantom: supportedFantomTokens,
bsctest: supportedBSCTestERC20,
bsc: supportedBSCERC20,
xdai: supportedXDAIERC20,
};

export type { TokenMap };
10 changes: 10 additions & 0 deletions packages/currency/src/erc20/networks/xdai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { TokenMap } from './types';

// List of the supported bsc network tokens
export const supportedXDAIERC20: TokenMap = {
'0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83': {
name: 'USDC token on xDai',
symbol: 'USDC',
decimals: 6,
},
};
4 changes: 4 additions & 0 deletions packages/payment-detection/src/declarative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default class PaymentNetworkDeclarative
return this.extension.createDeclareSentPaymentAction({
amount: parameters.amount,
note: parameters.note,
txHash: parameters.txHash,
});
}

Expand All @@ -90,6 +91,7 @@ export default class PaymentNetworkDeclarative
return this.extension.createDeclareSentRefundAction({
amount: parameters.amount,
note: parameters.note,
txHash: parameters.txHash,
});
}

Expand All @@ -105,6 +107,7 @@ export default class PaymentNetworkDeclarative
return this.extension.createDeclareReceivedPaymentAction({
amount: parameters.amount,
note: parameters.note,
txHash: parameters.txHash,
});
}

Expand All @@ -120,6 +123,7 @@ export default class PaymentNetworkDeclarative
return this.extension.createDeclareReceivedRefundAction({
amount: parameters.amount,
note: parameters.note,
txHash: parameters.txHash,
});
}

Expand Down
1 change: 1 addition & 0 deletions packages/payment-detection/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const networkRpcs: Record<string, string> = {
fuse: 'https://rpc.fuse.io',
bsctest: 'https://data-seed-prebsc-1-s1.binance.org:8545',
bsc: 'https://bsc-dataseed1.binance.org/',
xdai: 'https://rpc.xdaichain.com/',
};

/**
Expand Down
13 changes: 7 additions & 6 deletions packages/payment-detection/test/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ describe('getDefaultProvider', () => {
});

it('Can override the RPC configuration for a new network', async () => {
expect(() => getDefaultProvider('xdai')).toThrowError('unsupported getDefaultProvider network');
const fakenet = 'fakenet';
expect(() => getDefaultProvider(fakenet)).toThrowError('unsupported getDefaultProvider network');
setProviderFactory((network, defaultFactory) => {
if (network === 'xdai') {
return 'http://xdaichain.fake';
if (network === fakenet) {
return 'http://fakenet.fake';
}
return defaultFactory(network);
});
expect(getDefaultProvider('xdai')).toBeInstanceOf(providers.JsonRpcProvider);
expect((getDefaultProvider('xdai') as providers.JsonRpcProvider).connection.url).toBe(
'http://xdaichain.fake',
expect(getDefaultProvider(fakenet)).toBeInstanceOf(providers.JsonRpcProvider);
expect((getDefaultProvider(fakenet) as providers.JsonRpcProvider).connection.url).toBe(
'http://fakenet.fake',
);
// still works for standard providers
expect((getDefaultProvider('rinkeby') as providers.JsonRpcProvider).connection.url).toMatch(
Expand Down
1 change: 1 addition & 0 deletions packages/request-node/src/request/persistTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default class PersistTransactionHandler {

this.logger.debug(
`Persisting Transaction: ${JSON.stringify({
transactionHash,
channelId: clientRequest.body.channelId,
topics: clientRequest.body.topics,
transactionData: clientRequest.body.transactionData,
Expand Down

0 comments on commit a7635ee

Please sign in to comment.