-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tim/remove-server-gating-flag
# Conflicts: # packages/commonwealth/scripts/refresh-all-memberships.ts # packages/commonwealth/server-test.ts # packages/commonwealth/server/controllers/server_comments_controller.ts # packages/commonwealth/server/controllers/server_threads_controller.ts # packages/commonwealth/server/routing/external.ts # packages/commonwealth/server/routing/router.ts # packages/commonwealth/server/util/requirementsModule/validateTopicGroupsMembership.ts # packages/commonwealth/test/integration/api/linking.spec.ts # packages/commonwealth/test/integration/api/polls.spec.ts # packages/commonwealth/test/integration/api/subscriptions.spec.ts # packages/commonwealth/test/integration/api/thread.update.spec.ts # packages/commonwealth/test/integration/api/userDashboard.spec.ts # packages/commonwealth/test/unit/server_controllers/server_comments_controller.spec.ts # packages/commonwealth/test/unit/server_controllers/server_groups_controller.spec.ts # packages/commonwealth/test/unit/server_controllers/server_threads_controller.spec.ts # packages/commonwealth/test/util/modelUtils.ts
- Loading branch information
Showing
538 changed files
with
5,172 additions
and
18,986 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@hicommonwealth/adapters", | ||
"private": "true", | ||
"version": "0.1.0", | ||
"description": "External adapters", | ||
"files": [ | ||
"build" | ||
], | ||
"main": "build/index", | ||
"scripts": { | ||
"build": "tsc --build", | ||
"clean": "rm -rf build", | ||
"check-types": "tsc --noEmit", | ||
"test": "NODE_ENV=test ts-mocha '__tests__/**/*.spec.ts'" | ||
}, | ||
"dependencies": { | ||
"hot-shots": "^9", | ||
"typescript-logging": "^0.6.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const TODO = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "build", | ||
"tsBuildInfoFile": "build/.tsbuildinfo" | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "@hicommonwealth/chains", | ||
"private": "true", | ||
"version": "0.1.0", | ||
"description": "Chain types", | ||
"files": [ | ||
"build" | ||
], | ||
"main": "build/index", | ||
"scripts": { | ||
"build": "tsc --build", | ||
"clean": "rm -rf build", | ||
"check-types": "tsc --noEmit", | ||
"test": "NODE_ENV=test ts-mocha '__tests__/**/*.spec.ts'" | ||
}, | ||
"dependencies": { | ||
"@canvas-js/interfaces": "^0.5.0-alpha4", | ||
"@cosmjs/amino": "^0.31.0", | ||
"@cosmjs/proto-signing": "^0.31.0", | ||
"@cosmjs/stargate": "^0.31.0", | ||
"@cosmjs/tendermint-rpc": "^0.31.0", | ||
"@ethersproject/abi": "^5.7.0", | ||
"@ethersproject/address": "^5.7.0", | ||
"@ethersproject/bytes": "^5.7.0", | ||
"@ethersproject/constants": "^5.7.0", | ||
"@ethersproject/contracts": "^5.7.0", | ||
"@ethersproject/hash": "^5.7.0", | ||
"@ethersproject/providers": "^5.7.2", | ||
"@ethersproject/strings": "^5.7.0", | ||
"@ethersproject/units": "^5.7.0", | ||
"@ethersproject/wallet": "^5.7.0", | ||
"@osmonauts/lcd": "^0.10.0", | ||
"ethers": "5.7.2" | ||
}, | ||
"devDependencies": { | ||
"@nomiclabs/hardhat-ethers": "^2.0.2", | ||
"@typechain/ethers-v5": "^6.0.0", | ||
"hardhat": "^2.3.0", | ||
"hardhat-typechain": "^0.3.5", | ||
"ts-generator": "^0.1.1", | ||
"typechain": "^4.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const TODO = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "build", | ||
"tsBuildInfoFile": "build/.tsbuildinfo" | ||
}, | ||
"include": ["src"] | ||
} |
4 changes: 2 additions & 2 deletions
4
...alth/test/unit/chainIconSizeLimit.spec.ts → ...ore/__tests__/utils/checkIconSize.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "@hicommonwealth/core", | ||
"private": "true", | ||
"version": "0.1.0", | ||
"description": "Core Model", | ||
"files": [ | ||
"build" | ||
], | ||
"main": "build/index", | ||
"scripts": { | ||
"build": "tsc --build", | ||
"clean": "rm -rf build", | ||
"check-types": "tsc --noEmit", | ||
"test": "NODE_ENV=test ts-mocha '__tests__/**/*.spec.ts'" | ||
}, | ||
"dependencies": { | ||
"zod": "^3.22.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './createCommunity'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * as Community from './community'; | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { z } from 'zod'; | ||
import { MAX_COMMUNITY_IMAGE_SIZE_KB } from './constants'; | ||
import { getFileSizeBytes } from './getFileSizeBytes'; | ||
|
||
export async function checkIconSize(val: string, ctx: z.RefinementCtx) { | ||
const fileSizeBytes = await getFileSizeBytes(val); | ||
if (fileSizeBytes === 0) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: "Image url provided doesn't exist", | ||
}); | ||
return; | ||
} | ||
if (fileSizeBytes >= MAX_COMMUNITY_IMAGE_SIZE_KB * 1024) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: `Image must be smaller than ${MAX_COMMUNITY_IMAGE_SIZE_KB}kb`, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const ALL_COMMUNITIES = 'all_communities'; | ||
export const MAX_COMMUNITY_IMAGE_SIZE_KB = 500; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export async function getFileSizeBytes(url: string): Promise<number> { | ||
try { | ||
if (!url) return 0; | ||
// Range header is to prevent it from reading any bytes from the GET request because we only want the headers. | ||
const response = await fetch(url, { headers: { Range: 'bytes=0-0' } }); | ||
if (!response) return 0; | ||
const contentRange = response.headers.get('content-range'); | ||
return contentRange ? parseInt(contentRange.split('/')[1], 10) : 0; | ||
} catch (err) { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "build", | ||
"tsBuildInfoFile": "build/.tsbuildinfo", | ||
"strict": true | ||
}, | ||
"include": ["src"] | ||
} |
Oops, something went wrong.