Skip to content

Commit

Permalink
fix: keep the same symbol name (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
bertux committed Oct 19, 2022
1 parent 8ae22e1 commit 7055d4c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('extensions/payment-network/native-token', () => {
};
const nearTestnetCurrency = {
type: RequestLogicTypes.CURRENCY.ETH,
value: 'tNEAR',
value: 'NEAR-testnet',
network: 'near-testnet',
};
const nativeTokenTestCases = [
Expand Down
4 changes: 2 additions & 2 deletions packages/currency/src/aggregators/near-testnet.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"0x775eb53d00dd0acd3ec1696472105d579b9b386b": {
"0x45b3b427996b7091243501ee0efdc4a8e9b03c53": 1
"0xed9cbb2837912278b47d422f36df40a1da36c4e0": 1
},
"0x45b3b427996b7091243501ee0efdc4a8e9b03c53": {
"0xed9cbb2837912278b47d422f36df40a1da36c4e0": {
"0x775eb53d00dd0acd3ec1696472105d579b9b386b": 1
}
}
1 change: 0 additions & 1 deletion packages/currency/src/currencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ export class CurrencyManager<TMeta = unknown> implements ICurrencyManager<TMeta>
switch (currency.symbol) {
case 'NEAR':
case 'NEAR-testnet':
case 'tNEAR':
return isValidNearAddress(address, currency.network);
default:
// we don't pass a third argument to the validate method here
Expand Down
2 changes: 1 addition & 1 deletion packages/currency/src/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const nativeCurrencies: Record<NativeCurrencyType, (NativeCurrency & { na
network: 'aurora-testnet',
},
{
symbol: 'tNEAR',
symbol: 'NEAR-testnet',
decimals: 24,
name: 'Test Near',
network: 'near-testnet',
Expand Down
5 changes: 2 additions & 3 deletions packages/currency/test/currencyManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ describe('CurrencyManager', () => {
},
},
near: {
tNEAR: {
'NEAR-testnet': {
type: RequestLogicTypes.CURRENCY.ETH,
symbol: 'tNEAR',
symbol: 'NEAR-testnet',
network: 'near-testnet',
},
},
Expand Down Expand Up @@ -528,7 +528,6 @@ describe('CurrencyManager', () => {
switch (currency.symbol) {
case 'NEAR':
case 'NEAR-testnet':
case 'tNEAR':
testValidateAddressForCurrency(nearAddresses[currency.network], currency);
break;
default:
Expand Down

0 comments on commit 7055d4c

Please sign in to comment.