fix realms fetch performance (#1157)

* fix realms fetch performance

* fix yarn lock
This commit is contained in:
Adrian Brzeziński 2022-10-31 02:29:39 +01:00 committed by GitHub
parent a7903be1de
commit 65582133ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1067 additions and 851 deletions

View File

@ -251,12 +251,12 @@ export const createProposal = async (
)
const signersSet = [
[...prerequisiteInstructionsSigners],
...chunks([...prerequisiteInstructionsSigners], 5),
[],
...signerChunks,
]
const txes = [
deduplicatedPrerequisiteInstructions,
...chunks(deduplicatedPrerequisiteInstructions, 5),
instructions,
...insertChunks,
].map((txBatch, batchIdx) => {

View File

@ -178,12 +178,14 @@ const SendTokens = ({
setIsLoading(false)
throw 'No realm selected'
}
const instructionData = {
const instructionData: InstructionDataWithHoldUpTime = {
data: instruction.serializedInstruction
? getInstructionDataFromBase64(instruction.serializedInstruction)
: null,
holdUpTime: governance?.account?.config.minInstructionHoldUpTime,
prerequisiteInstructions: instruction.prerequisiteInstructions || [],
chunkSplitByDefault: true,
chunkBy: 4,
}
instructions.push(instructionData)
}

View File

@ -20,6 +20,10 @@ const customConfig = {
moduleNameMapper: directories,
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
moduleDirectories: ['node_modules', '<rootDir>/'],
transform: {
'^.+\\.(t|j)sx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}
module.exports = nextJest({ dir: './' })(customConfig)

View File

@ -173,7 +173,7 @@ export async function getUnchartedRealmInfos(connection: ConnectionContext) {
).map((p) => {
return p.programId
})
getRealms(connection.current, programIds)
const allRealms = (
await getRealms(connection.current, programIds)
).sort((r1, r2) => r1.account.name.localeCompare(r2.account.name))

View File

@ -159,7 +159,7 @@
"@testing-library/react": "^11.2.5",
"@types/carbon__icons-react": "^11.7.0",
"@types/d3": "^7.4.0",
"@types/jest": "^27.4.1",
"@types/jest": "^29.2.0",
"@types/js-cookie": "^3.0.2",
"@types/node": "^14.14.25",
"@types/react": "^17.0.44",
@ -172,13 +172,15 @@
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.5.0",
"husky": "^8.0.1",
"jest": "^27.4.5",
"jest": "^29.2.0",
"jest-environment-jsdom": "^29.2.2",
"lint-staged": "^10.0.10",
"next-router-mock": "^0.6.7",
"postcss": "^8.4.12",
"postcss-preset-env": "^6.7.0",
"prettier": "2.2.1",
"tailwindcss": "^3.0.23",
"ts-jest": "29.0.3",
"ts-loader": "^9.3.1",
"twin.macro": "^2.4.0",
"typescript": "^4.6.3"

View File

@ -52,7 +52,7 @@ const Realms = () => {
if (selectedRealm.realm) {
actions.deselectRealm()
}
}, [connection])
}, [connection.cluster, connection.endpoint, connection.current.commitment])
const handleCreateRealmButtonClick = async () => {
if (!connected) {

1896
yarn.lock

File diff suppressed because it is too large Load Diff