Skip to content

Commit

Permalink
🚀 [QA] Update release environment (#703)
Browse files Browse the repository at this point in the history
This is a pull request that upon merging will update production
environment with recent `stage-live` changes.
The environment that will be updated:
* Production: https://taho-development.netlify.app/ (aka
https://app.taho.xyz/)

Read more: [Deployment to Production
Flow](https://github.com/tahowallet/dapp/blob/main/docs/testing-env.md)
  • Loading branch information
andreachapman authored Nov 16, 2023
2 parents a4bd8cb + 1b33c76 commit e8467fa
Show file tree
Hide file tree
Showing 70 changed files with 812 additions and 242 deletions.
2 changes: 1 addition & 1 deletion docs/testing-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Branches

- `main`
- branch `main` is the base branch for current developement
- branch `main` is the base branch for current development
- every feature branch should be merged into `main` via pull request
- `stage-live`
- base for running the staging environment that is running on the live chain
Expand Down
15 changes: 10 additions & 5 deletions src/assets/xp-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"claimsFolder": "/assets/xp/gitcoin/claims",
"xpGlossary": [
"0x1bbc8ebb6165940208273b52a9bc625dcdd040caae1c01acaf2168a27a8f9de5.json",
"0x4eb14ded48fb726edc0a48fe17e34017afe112a9eb387b56fa89a59617bfa6ed.json"
"0x4eb14ded48fb726edc0a48fe17e34017afe112a9eb387b56fa89a59617bfa6ed.json",
"0xaad39bbf26b40343dadb70750d35a8558bb4d44104dda2780771f2fef1f333ba.json"
],
"leaderboard": "leaderboard.json"
},
Expand All @@ -13,7 +14,8 @@
"claimsFolder": "/assets/xp/cyberconnect/claims",
"xpGlossary": [
"0x3823909a2038c7175915de1053ab41de3634b6b9d9b273151f55dfe3c22a361f.json",
"0x8c924342bc1b9ed326a54305cc6d062912d69f5f0e6e7dd37a7c217229714ac1.json"
"0x8c924342bc1b9ed326a54305cc6d062912d69f5f0e6e7dd37a7c217229714ac1.json",
"0x69ae5cf6269775e9d3184fe2736959f34a767c123ab0dc3f7625bc304db07c4d.json"
],
"leaderboard": "leaderboard.json"
},
Expand All @@ -22,7 +24,8 @@
"claimsFolder": "/assets/xp/arbitrum/claims",
"xpGlossary": [
"0xccf3c79aefe494173c6673a8382c40bcf60528539e78353315b4892de0c9cd76.json",
"0x823bd7f1c36fe10cd440e190850f69ec7a8d3fa1fac105c223befad1bb193fab.json"
"0x823bd7f1c36fe10cd440e190850f69ec7a8d3fa1fac105c223befad1bb193fab.json",
"0x1b387cacb27052e3e5576848ce71979e0177e140466481134a01f3877f67838e.json"
],
"leaderboard": "leaderboard.json"
},
Expand All @@ -31,15 +34,17 @@
"claimsFolder": "/assets/xp/galxe/claims",
"xpGlossary": [
"0x9374e0cc26272296a252fb4f02c6bc24c47c712a916627b30652486e58dc4e90.json",
"0xa72ed1f1c91e909a27da3242fbe3080c0d9520b73f75673007ca9e164768b381.json"
"0xa72ed1f1c91e909a27da3242fbe3080c0d9520b73f75673007ca9e164768b381.json",
"0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2.json"
],
"leaderboard": "leaderboard.json"
},
"22": {
"rootFolder": "/assets/xp/frax",
"claimsFolder": "/assets/xp/frax/claims",
"xpGlossary": [
"0x08cb87568f0f067408729a093e2c14082212f368b05aa7d27c15a66bb416c6e5.json"
"0x08cb87568f0f067408729a093e2c14082212f368b05aa7d27c15a66bb416c6e5.json",
"0xbb96bd7e3d3c87bd3f9aef6fc5d27096732ea1e24336ad5be140232bfadfac64.json"
],
"leaderboard": "leaderboard.json"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"totalAmount":"0xd3c21bcecceda0fff655","merkleRoot":"0x1b387cacb27052e3e5576848ce71979e0177e140466481134a01f3877f67838e","glossary":[{"startAddress":"0x0000006d14ce3cf81449c3ba1f26108df0a4de8b","file":"/0x1b387cacb27052e3e5576848ce71979e0177e140466481134a01f3877f67838e-0.json"},{"startAddress":"0x3665021134f0e9e80bf409d66d3e8f9164a63684","file":"/0x1b387cacb27052e3e5576848ce71979e0177e140466481134a01f3877f67838e-1.json"},{"startAddress":"0x6e345fc676d8c2c600fe949b6769cf87845996e3","file":"/0x1b387cacb27052e3e5576848ce71979e0177e140466481134a01f3877f67838e-2.json"},{"startAddress":"0xa89ff06001e345973f1a9daf96a26d2568028a5f","file":"/0x1b387cacb27052e3e5576848ce71979e0177e140466481134a01f3877f67838e-3.json"},{"startAddress":"0xdf7d4215eb81667ff3800b9a485306d6119b3c83","file":"/0x1b387cacb27052e3e5576848ce71979e0177e140466481134a01f3877f67838e-4.json"}],"merkleDistributor":"0x8d00F7cad86c28dcB886c1dD6E31E433f04c5e7c"}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/xp/arbitrum/leaderboard.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"totalAmount":"0xd3c21bcecceda0ffff37","merkleRoot":"0x69ae5cf6269775e9d3184fe2736959f34a767c123ab0dc3f7625bc304db07c4d","glossary":[{"startAddress":"0x0000c95cef6b6de3cce63d520fcea45bc2ba1ce4","file":"/0x69ae5cf6269775e9d3184fe2736959f34a767c123ab0dc3f7625bc304db07c4d-0.json"}],"merkleDistributor":"0xa7cB7dd38eDBd3F293381C65a3fAaB4cdEdA94Cd"}

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/xp/cyberconnect/leaderboard.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"totalAmount":"0xd3c21bcecceda1000000","merkleRoot":"0xbb96bd7e3d3c87bd3f9aef6fc5d27096732ea1e24336ad5be140232bfadfac64","glossary":[{"startAddress":"0x189b5600b6a6fd38f976cffc4868f168c61c24f4","file":"/0xbb96bd7e3d3c87bd3f9aef6fc5d27096732ea1e24336ad5be140232bfadfac64-0.json"}],"merkleDistributor":"0x2F616c979079CA625703BeA85b585915A8CE2941"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"0x189b5600b6a6fd38f976cffc4868f168c61c24f4":{"index":"0x0","amount":"0x0107ad8f556c6c0000","proof":["0x0c97282c6971a5d10e3937b41ea39eb7878316f17a0909570ba6f696819f8262","0x4831c50ab6c2613dd59fe5c407db9027bb4e290c278a6f190d3fc4cb9d7cb4f8","0x480d3edb3e0d2555ac2fb0bb6359d935b74afb4345c1451a0738fffb327bcaa0","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]},"0x22510fe99f63ae03ba792c21a29ec10fd87cae08":{"index":"0x1","amount":"0xd3448ed9eb9f44500000","proof":["0x88752de5ceee0167d0d67d24fc6cb876575b6a4db7dadbdf82fff88b7fe519af"]},"0x402d7aab5ad51a9d81b6c8b9f0a039cc3ebe41bb":{"index":"0x2","amount":"0x019274b259f6540000","proof":["0x9678bfc72d986c87670f267fb69d23b6d9596c893893b7f32e9172419ad7aa05","0x0ae61414e1a58b66f60e645941092cd49edc9cd8e11741088655b06e7d988176","0x480d3edb3e0d2555ac2fb0bb6359d935b74afb4345c1451a0738fffb327bcaa0","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]},"0x82abedf193942a6cdc4704a8d49e54fe51160e99":{"index":"0x3","amount":"0x1c06d0f8d10cf40000","proof":["0xdefe98a50029f58ae7b177ac43bd5a54a4cb3e9a62127545bba4c1584e891d3f","0xeb06e3ecbe86889f091f7ab12214106e1c0401f966391eb587b0d09fffa1c4cd","0x11c133914436c984665b4bccd263b549f53747c6b65ceda9df46b1292f0b757d","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]},"0xcd9ac897be0ab91d8e3bd63ca15bde0debdacf1e":{"index":"0x4","amount":"0x22f72c52a4bef40000","proof":["0xde4be61d8d4cec81e0c9d925163a29380af2f9edc9dd7989560804e9d890b2c8","0x5e02a0aad97d3dc57dcf63e8a95ac548cbd02193f632bb492e08bae26a096e20","0x11c133914436c984665b4bccd263b549f53747c6b65ceda9df46b1292f0b757d","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]},"0xd897d8d6c19a4f981bcad5c96ba5311513e349d0":{"index":"0x5","amount":"0x3643aa647986040000","proof":["0xa8395da2fc343c50b2b8ff5bec40f22430bdaea2a1c7d024ccc97e770832e317","0x5e02a0aad97d3dc57dcf63e8a95ac548cbd02193f632bb492e08bae26a096e20","0x11c133914436c984665b4bccd263b549f53747c6b65ceda9df46b1292f0b757d","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]},"0xf48b09f85b88b31cdde74a06d7890e893fda1115":{"index":"0x6","amount":"0x00","proof":["0x2dd7d77dd81390a50bfee2f64b78ce5cb79f1f0b26bb434a0f65123d4c5ab716","0x0ae61414e1a58b66f60e645941092cd49edc9cd8e11741088655b06e7d988176","0x480d3edb3e0d2555ac2fb0bb6359d935b74afb4345c1451a0738fffb327bcaa0","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]},"0xf8575829fd42050997fb08093db564037478be75":{"index":"0x7","amount":"0x031708ae0045440000","proof":["0xe875f0242aed3963066c697e67a33f030462c558b60a1cd5c3f8e9d7ceda0a79","0xeb06e3ecbe86889f091f7ab12214106e1c0401f966391eb587b0d09fffa1c4cd","0x11c133914436c984665b4bccd263b549f53747c6b65ceda9df46b1292f0b757d","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]},"0xfa1a33f67df8318f8b1ab607d3ec866fca61e782":{"index":"0x8","amount":"0x029a2241af62c00000","proof":["0x15b01a72ca2050cb425b4b78e6aab37be3da54705c09138de78527a4f0d5ec7a","0x4831c50ab6c2613dd59fe5c407db9027bb4e290c278a6f190d3fc4cb9d7cb4f8","0x480d3edb3e0d2555ac2fb0bb6359d935b74afb4345c1451a0738fffb327bcaa0","0xe89323fc68a70db3b20c3203aa6b87c8642948648d96fe99a36fe1b54b84f2f9"]}}
2 changes: 1 addition & 1 deletion src/assets/xp/frax/leaderboard.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"rank":1,"beneficiary":"0x22510fe99f63ae03ba792c21a29ec10fd87cae08","amount":"0x0135cb1be1399a866394cf"},{"rank":2,"beneficiary":"0xa05b26f366035f4a797c12cbc23b87633f353337","amount":"0x71b91bbc6040bb9c6b30"}]
[{"rank":1,"beneficiary":"0x22510fe99f63ae03ba792c21a29ec10fd87cae08","amount":"0x02090faabb2539cab394cf"},{"rank":2,"beneficiary":"0xa05b26f366035f4a797c12cbc23b87633f353337","amount":"0x71b91bbc6040bb9c6b30"},{"rank":3,"beneficiary":"0xd897d8d6c19a4f981bcad5c96ba5311513e349d0","amount":"0x3643aa647986040000"},{"rank":4,"beneficiary":"0xcd9ac897be0ab91d8e3bd63ca15bde0debdacf1e","amount":"0x22f72c52a4bef40000"},{"rank":5,"beneficiary":"0x82abedf193942a6cdc4704a8d49e54fe51160e99","amount":"0x1c06d0f8d10cf40000"},{"rank":6,"beneficiary":"0xf8575829fd42050997fb08093db564037478be75","amount":"0x031708ae0045440000"},{"rank":7,"beneficiary":"0xfa1a33f67df8318f8b1ab607d3ec866fca61e782","amount":"0x029a2241af62c00000"},{"rank":8,"beneficiary":"0x402d7aab5ad51a9d81b6c8b9f0a039cc3ebe41bb","amount":"0x019274b259f6540000"},{"rank":9,"beneficiary":"0x189b5600b6a6fd38f976cffc4868f168c61c24f4","amount":"0x0107ad8f556c6c0000"},{"rank":10,"beneficiary":"0xf48b09f85b88b31cdde74a06d7890e893fda1115","amount":"0x00"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"totalAmount":"0xd3c21bcecceda0fff7aa","merkleRoot":"0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2","glossary":[{"startAddress":"0x0000000000ce6d8c1fba76f26d6cc5db71432710","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-0.json"},{"startAddress":"0x1dd03f57eb2016622fdc6e11fff7a736e984c96e","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-1.json"},{"startAddress":"0x3ecfd1354615e3aded9bd626fe4c2c8b9c0279d6","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-2.json"},{"startAddress":"0x60701b6b5922554b3b049f307f7ff4d7727fe489","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-3.json"},{"startAddress":"0x840ba58eb52513979fe80b269036dcf32bfa74a8","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-4.json"},{"startAddress":"0xa4ed9c3dc3eb4a6163a8a1b598a87c8342390460","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-5.json"},{"startAddress":"0xc5d1353822f6fed2027eff40e1c2d616d37fbd2c","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-6.json"},{"startAddress":"0xe696a12842bb6733a223344da1f50e011659de67","file":"/0x4c98014763abc933133f49e4ce1146d79311dcfc1c28628a287b4658a86293d2-7.json"}],"merkleDistributor":"0x6F7d2Dd4EDBb27B9CCB4fB6C79d8362B92dAC3ed"}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/xp/galxe/leaderboard.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"totalAmount":"0xd3c21bcecceda0fffcf0","merkleRoot":"0xaad39bbf26b40343dadb70750d35a8558bb4d44104dda2780771f2fef1f333ba","glossary":[{"startAddress":"0x00648b0d2b620dd1a987c6fe5e5810ed06d5136a","file":"/0xaad39bbf26b40343dadb70750d35a8558bb4d44104dda2780771f2fef1f333ba-0.json"},{"startAddress":"0xaf9cd21a41163536efa1cfd4b74d8fde484cbcf6","file":"/0xaad39bbf26b40343dadb70750d35a8558bb4d44104dda2780771f2fef1f333ba-1.json"}],"merkleDistributor":"0xb1A3dDA9c0fA95121825570Ba5d796c29831492C"}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/xp/gitcoin/leaderboard.json

Large diffs are not rendered by default.

56 changes: 42 additions & 14 deletions src/redux-state/selectors/population.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
import { createSelector } from "@reduxjs/toolkit"
import { RealmData } from "shared/types"
import {
getDisplayedPopulationOfRealms,
getPopulationOfRealms,
} from "redux-state/utils/population"
import { selectRealmById, selectRealms } from "./realm"

const getPopulationOfRealms = (realms: RealmData[]) =>
realms.map((realm) => realm.population)
type PopulationKey = "population" | "displayedPopulation"

export const selectSortedPopulation = createSelector(selectRealms, (realms) => {
const realmsData = Object.entries(realms).map(([id, data]) => ({
id,
...data,
}))
const getPopulationById = (key: PopulationKey) =>
createSelector(selectRealmById, (realm) => realm?.[key] ?? 0)

return realmsData.sort((a, b) => a.population - b.population)
})
const sortPopulation = (key: PopulationKey) =>
createSelector(selectRealms, (realms) => {
const realmsData = Object.entries(realms).map(([id, data]) => ({
id,
...data,
}))

export const selectPopulationById = createSelector(
selectRealmById,
(realm) => realm?.population ?? 0
return realmsData.sort((a, b) => a[key] - b[key])
})

export const selectSortedPopulation = sortPopulation("population")
export const selectSortedDisplayedPopulation = sortPopulation(
"displayedPopulation"
)

export const selectPopulationById = getPopulationById("population")
export const selectDisplayedPopulationById = getPopulationById(
"displayedPopulation"
)

export const selectTotalPopulation = createSelector(
Expand All @@ -25,7 +36,24 @@ export const selectTotalPopulation = createSelector(
realms.length ? getPopulationOfRealms(realms).reduce((a, b) => a + b) : 0
)

export const selectTotalDisplayedPopulation = createSelector(
selectSortedDisplayedPopulation,
(realms) =>
realms.length
? getDisplayedPopulationOfRealms(realms).reduce((a, b) => a + b)
: 0
)

export const selectMaxPopulation = createSelector(
selectSortedPopulation,
(realms) => (realms.length ? Math.max(...getPopulationOfRealms(realms)) : 0)
(realms) =>
realms.length ? getPopulationOfRealms(realms)[realms.length - 1] : 0
)

export const selectMaxDisplayedPopulation = createSelector(
selectSortedDisplayedPopulation,
(realms) =>
realms.length
? getDisplayedPopulationOfRealms(realms)[realms.length - 1]
: 0
)
14 changes: 12 additions & 2 deletions src/redux-state/slices/island.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import {
LeaderboardData,
UnclaimedXpData,
OverlayType,
RealmData,
RealmDataWithId,
SeasonInfo,
RealmDataById,
} from "shared/types"

export type IslandModeType = "default" | "join-realm"

export type IslandState = {
mode: IslandModeType
overlay: OverlayType
realms: { [id: string]: RealmData }
realms: RealmDataById
leaderboards: { [id: string]: LeaderboardData }
unclaimedXp: { [id: string]: UnclaimedXpData[] }
stakingRealmId: string | null
Expand Down Expand Up @@ -75,6 +75,15 @@ const islandSlice = createSlice({
immerState.realms[realmPopulation.id].population =
realmPopulation.population
},
setRealmDisplayedPopulation: (
immerState,
{
payload: realmPopulation,
}: { payload: { id: string; population: number } }
) => {
immerState.realms[realmPopulation.id].displayedPopulation =
realmPopulation.population
},
setRealmXpAllocatable: (
immerState,
{
Expand Down Expand Up @@ -139,6 +148,7 @@ export const {
resetIslandDisplay,
resetIslandAccount,
setRealmPopulation,
setRealmDisplayedPopulation,
setRealmXpAllocatable,
setRealmsData,
setDisplayedRealmId,
Expand Down
15 changes: 13 additions & 2 deletions src/redux-state/thunks/island.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
setRealmXpAllocatable,
setRealmsData,
setSeasonInfo,
setRealmDisplayedPopulation,
} from "redux-state/slices/island"
import {
REALMS_WITH_CONTRACT_NAME,
Expand All @@ -29,7 +30,11 @@ import {
UnclaimedXpData,
} from "shared/types"
import { updateTransactionStatus } from "redux-state/slices/wallet"
import { bigIntToUserAmount, getAllowanceTransactionID } from "shared/utils"
import {
bigIntToUserAmount,
getAllowanceTransactionID,
isDisplayedPopulationAvailable,
} from "shared/utils"
import {
getRealmLeaderboardData,
getUserLeaderboardRank,
Expand Down Expand Up @@ -107,8 +112,14 @@ export const fetchPopulation = createDappAsyncThunk(
realmsWithAddress,
})

const displayedPopulationAvailable = isDisplayedPopulationAvailable(realms)

if (result) {
result.forEach((data) => dispatch(setRealmPopulation(data)))
result.forEach((data) => {
dispatch(setRealmPopulation(data))
if (!displayedPopulationAvailable)
dispatch(setRealmDisplayedPopulation(data))
})
}

return !!result
Expand Down
7 changes: 7 additions & 0 deletions src/redux-state/utils/population.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { RealmData } from "shared/types"

export const getPopulationOfRealms = (realms: RealmData[]) =>
realms.map((realm) => realm.population)

export const getDisplayedPopulationOfRealms = (realms: RealmData[]) =>
realms.map((realm) => realm.displayedPopulation)
31 changes: 31 additions & 0 deletions src/shared/assets/partners/arbitrum-population.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions src/shared/assets/partners/cyberconnect-population.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e8467fa

Please sign in to comment.