Skip to content

Commit

Permalink
feat: use amoy instead of mumbai (#2216)
Browse files Browse the repository at this point in the history
  • Loading branch information
meelrossi committed Apr 15, 2024
1 parent 71be90e commit d885f30
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 48 deletions.
31 changes: 21 additions & 10 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"dcl-catalyst-commons": "^9.0.1",
"decentraland-connect": "^6.3.1",
"decentraland-crypto-fetch": "^1.0.3",
"decentraland-dapps": "^19.5.2",
"decentraland-transactions": "^2.3.2",
"decentraland-dapps": "^19.5.3",
"decentraland-transactions": "^2.6.0",
"decentraland-ui": "^5.17.1",
"ethers": "^5.6.8",
"graphql": "^14.7.0",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/AssetCard/AssetCard.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('AssetCard', () => {
} as Asset['data']['wearable']
},
network: Network.MATIC,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
firstListedAt: null
}
})
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Modals/BuyWithCryptoModal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export const DEFAULT_CHAINS = [

export const TESTNET_DEFAULT_CHAINS = [
{
chainId: ChainId.MATIC_MUMBAI.toString(),
networkName: 'Polygon Mumbai',
chainId: ChainId.MATIC_AMOY.toString(),
networkName: 'Polygon Amoy',
nativeCurrency: {
name: 'MATIC',
symbol: 'MATIC',
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/SuccessPage/SuccessPage.container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const mapState = (state: RootState): MapStateProps => {
const isLoadingTx = Boolean(transaction && transaction.status !== TransactionStatus.CONFIRMED)
return {
isLoading: isLoadingTx,
mintedTokenId: getTokenIdFromLogs(ChainId.MATIC_MUMBAI, transaction?.receipt?.logs),
mintedTokenId: getTokenIdFromLogs(ChainId.MATIC_AMOY, transaction?.receipt?.logs),
profile: address ? getProfileOfAddress(state, address) : undefined
}
}
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/modules/contract/reducer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('when upsert contracts action is received', () => {
const contract = {
address: 'address',
name: 'some name',
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
} as Contract

const newContract = {
Expand All @@ -93,7 +93,7 @@ describe('when upsert contracts action is received', () => {
it('should insert it into the store', () => {
const newContract = {
address: 'address',
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: 'some other name'
} as Contract

Expand Down
16 changes: 8 additions & 8 deletions webapp/src/modules/contract/sagas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('when handling the fetch contracts request', () => {
const marketplaceMatic: Contract = {
address: 'marketplaceMaticAddress',
category: null,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: contractNames.MARKETPLACE,
network: Network.MATIC,
vendor: VendorName.DECENTRALAND
Expand All @@ -81,7 +81,7 @@ describe('when handling the fetch contracts request', () => {
const bidsMatic: Contract = {
address: 'bidsEthereumAddress',
category: null,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: contractNames.BIDS,
network: Network.MATIC,
vendor: VendorName.DECENTRALAND
Expand All @@ -99,7 +99,7 @@ describe('when handling the fetch contracts request', () => {
const manaMatic: Contract = {
address: 'manaMaticAddress',
category: null,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: contractNames.MANA,
network: Network.MATIC,
vendor: VendorName.DECENTRALAND
Expand All @@ -108,7 +108,7 @@ describe('when handling the fetch contracts request', () => {
const collectionStore: Contract = {
address: 'collectionStoreAddress',
category: null,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: contractNames.COLLECTION_STORE,
network: Network.MATIC,
vendor: VendorName.DECENTRALAND
Expand Down Expand Up @@ -221,15 +221,15 @@ describe('when handling the fetch contracts request', () => {
authorizedAddress: marketplaceMatic.address,
contractAddress: manaMatic.address,
contractName: ContractName.MANAToken,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
type: AuthorizationType.ALLOWANCE
},
{
address,
authorizedAddress: legacyMarketplace.address,
contractAddress: manaMatic.address,
contractName: ContractName.MANAToken,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
type: AuthorizationType.ALLOWANCE
},
{
Expand All @@ -245,15 +245,15 @@ describe('when handling the fetch contracts request', () => {
authorizedAddress: bidsEthereum.address,
contractAddress: manaMatic.address,
contractName: ContractName.MANAToken,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
type: AuthorizationType.ALLOWANCE
},
{
address,
authorizedAddress: collectionStore.address,
contractAddress: manaMatic.address,
contractName: ContractName.MANAToken,
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
type: AuthorizationType.ALLOWANCE
}
])
Expand Down
22 changes: 11 additions & 11 deletions webapp/src/modules/contract/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('when calling upsertContracts', () => {
describe('and newContracts has a contract', () => {
describe('and that contract has an upper cased address', () => {
beforeEach(() => {
newContracts = [{ address: 'ADDRESS', chainId: ChainId.MATIC_MUMBAI } as Contract]
newContracts = [{ address: 'ADDRESS', chainId: ChainId.MATIC_AMOY } as Contract]
})

it('should return an array with the new contract with its address lower cased', () => {
Expand All @@ -58,7 +58,7 @@ describe('when calling upsertContracts', () => {
storedContracts = [
{
address: 'address',
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: 'name'
} as Contract
]
Expand All @@ -79,7 +79,7 @@ describe('when calling upsertContracts', () => {
newContracts = [
{
address: 'ADDRESS',
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: 'name'
} as Contract
]
Expand All @@ -95,7 +95,7 @@ describe('when calling upsertContracts', () => {
newContracts = [
{
address: 'other address',
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: 'name'
} as Contract
]
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('when calling upsertContracts', () => {
newContracts = [
{
address: 'ADDRESS',
chainId: ChainId.MATIC_MUMBAI,
chainId: ChainId.MATIC_AMOY,
name: 'different name'
} as Contract
]
Expand All @@ -145,9 +145,9 @@ describe('when calling getContractKey', () => {
expect(
getContractKey({
address: 'address',
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
} as Contract)
).toEqual('address-80001')
).toEqual('address-80002')
})
})

Expand All @@ -156,9 +156,9 @@ describe('when calling getContractKeyFromNFT', () => {
expect(
getContractKeyFromNFT({
contractAddress: 'address',
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
} as NFT)
).toEqual('address-80001')
).toEqual('address-80002')
})
})

Expand All @@ -169,9 +169,9 @@ describe('when calling getAuthorizationKey', () => {
address: 'address',
authorizedAddress: 'authorizedAddress',
contractAddress: 'contractAddress',
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
} as Authorization)
).toEqual('address-authorizedAddress-contractAddress-80001')
).toEqual('address-authorizedAddress-contractAddress-80002')
})
})

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/modules/nft/sagas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('when handling the fetch NFTs request action', () => {
{
id: 'anID',
contractAddress: 'aContractAddress',
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
}
] as NFT[]
const accounts = [{ address: 'someAddress' }] as Account[]
Expand Down
18 changes: 9 additions & 9 deletions webapp/src/modules/vendor/decentraland/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,20 +484,20 @@ const localContracts = {
},
{
name: ContractName.MANA,
address: getContract(CN.MANAToken, ChainId.MATIC_MUMBAI).address,
address: getContract(CN.MANAToken, ChainId.MATIC_AMOY).address,
vendor: 'decentraland',
category: null,
network: Network.MATIC,
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
},
{
name: ContractName.MARKETPLACE,
address: getContract(CN.MarketplaceV2, ChainId.MATIC_MUMBAI).address,
address: getContract(CN.MarketplaceV2, ChainId.MATIC_AMOY).address,
label: 'MarketplaceV2',
vendor: 'decentraland',
category: null,
network: Network.MATIC,
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
},
{
name: ContractName.LEGACY_MARKETPLACE,
Expand All @@ -506,23 +506,23 @@ const localContracts = {
vendor: 'decentraland',
category: null,
network: Network.MATIC,
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
},
{
name: CN.CollectionStore,
address: getContract(CN.CollectionStore, ChainId.MATIC_MUMBAI).address,
address: getContract(CN.CollectionStore, ChainId.MATIC_AMOY).address,
vendor: 'decentraland',
category: null,
network: Network.MATIC,
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
},
{
name: ContractName.BIDS,
address: getContract(CN.BidV2, ChainId.MATIC_MUMBAI).address,
address: getContract(CN.BidV2, ChainId.MATIC_AMOY).address,
vendor: 'decentraland',
category: null,
network: Network.MATIC,
chainId: ChainId.MATIC_MUMBAI
chainId: ChainId.MATIC_AMOY
}
],
[AppNetwork.GOERLI]: [
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/modules/vendor/decentraland/marketplace/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class MarketplaceAPI extends BaseAPI {
[ChainId.ETHEREUM_MAINNET]: 'eth-mainnet',
[ChainId.ETHEREUM_SEPOLIA]: 'eth-sepolia',
[ChainId.MATIC_MAINNET]: 'matic-mainnet',
[ChainId.MATIC_MUMBAI]: 'matic-mumbai',
[ChainId.MATIC_AMOY]: 'matic-amoy',
[ChainId.BSC_MAINNET]: 'bsc-mainnet',
[ChainId.AVALANCHE_MAINNET]: 'avalanche-mainnet',
[ChainId.OPTIMISM_MAINNET]: 'optimism-mainnet',
Expand Down

0 comments on commit d885f30

Please sign in to comment.