Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence is golden #1117

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dev/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@
"author": "Prosopo Limited",
"license": "Apache-2.0",
"dependencies": {
"@polkadot/dev": "^0.76.11",
"@prosopo/common": "0.3.4",
"@prosopo/types": "0.3.4",
"glob": "^10.0.0",
"path-scurry": "^1.10.0"
},
"devDependencies": {
"@polkadot/dev": "^0.76.11",
"@prosopo/util": "0.3.4",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-babel": "^6.0.4",
Expand All @@ -49,19 +45,23 @@
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unused-imports": "^2.0.0",
"glob": "^10.0.0",
"path-scurry": "^1.10.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"regenerator-runtime": "^0.14.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-import-css": "^3.5.0",
"tsconfig-paths": "^4.2.0",
"tslib": "2.6.2",
"typescript": "5.1.6",
"vite": "^5.1.4",
"vite-bundle-visualizer": "^1.0.1",
"vite-plugin-no-bundle": "^3.0.0",
"vite-tsconfig-paths": "^4.3.1"
},
"devDependencies": {
"tslib": "2.6.2",
"typescript": "5.1.6"
},
"repository": {
"type": "git",
"url": "git+https://github.com/prosopo/captcha.git"
Expand Down
4 changes: 2 additions & 2 deletions dev/config/src/vite/vite.frontend.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export default async function (

// drop console logs if in production mode
let drop: undefined | Drop[]
let pure: string[] | undefined
let pure: string[] = []
if (isProduction) {
drop = ['debugger']
pure = ['console.log', 'console.warn']
pure = ['console.log', 'console.warn', 'console.info', 'console.debug']
}

logger.info('Bundle name', bundleName)
Expand Down
1,047 changes: 133 additions & 914 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/account/src/extension/ExtensionWeb2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class ExtensionWeb2 extends Extension {
const entropy = hexHash([canvasEntropy, browserEntropy].join(''), 128).slice(2)
const u8Entropy = stringToU8a(entropy)
const mnemonic = entropyToMnemonic(u8Entropy)
const api = await ApiPromise.create({ provider: wsProvider, initWasm: false })
const api = await ApiPromise.create({ provider: wsProvider, initWasm: false, noInitWarn: true })
const type: KeypairType = 'ed25519'
const keyring = new Keyring({ type, ss58Format: api.registry.chainSS58 })
const keypair = keyring.addFromMnemonic(mnemonic)
Expand Down
2 changes: 1 addition & 1 deletion packages/env/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class Environment implements ProsopoEnvironment {
this.pair.unlock(this.config.account.password)
}
if (!this.api) {
this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false })
this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false, noInitWarn: true })
}
await this.getSigner()
// make sure contract address is valid before trying to load contract interface
Expand Down
6 changes: 5 additions & 1 deletion packages/procaptcha-pow/src/Services/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ export const Manager = (
*/
const loadContract = async (): Promise<ProsopoCaptchaContract> => {
const network = getNetwork(getConfig())
const api = await ApiPromise.create({ provider: new WsProvider(network.endpoint), initWasm: false })
const api = await ApiPromise.create({
provider: new WsProvider(network.endpoint),
initWasm: false,
noInitWarn: true,
})
const type = 'sr25519'
const keyring = new Keyring({ type, ss58Format: api.registry.chainSS58 })

Expand Down
6 changes: 5 additions & 1 deletion packages/procaptcha/src/modules/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,11 @@ export function Manager(
const loadContract = async (): Promise<ProsopoCaptchaContract> => {
const config = getConfig()
const network = getNetwork(config)
const api = await ApiPromise.create({ provider: new WsProvider(network.endpoint), initWasm: false })
const api = await ApiPromise.create({
provider: new WsProvider(network.endpoint),
initWasm: false,
noInitWarn: true,
})
// TODO create a shared keyring that's stored somewhere
const type = 'sr25519'
const keyring = new Keyring({ type, ss58Format: api.registry.chainSS58 })
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class ProsopoServer {

async isReady() {
try {
this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false })
this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false, noInitWarn: true })
await this.getSigner()
await this.getContractApi()
} catch (error) {
Expand All @@ -86,7 +86,7 @@ export class ProsopoServer {
async getSigner(): Promise<void> {
if (this.pair) {
if (!this.api) {
this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false })
this.api = await ApiPromise.create({ provider: this.wsProvider, initWasm: false, noInitWarn: true })
}
await this.api.isReadyOrError
try {
Expand Down
Loading