Skip to content

Commit

Permalink
bump deps and switch to deno bdd
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Jan 4, 2024
1 parent 9b0e8a5 commit 5a69877
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"https://x.nest.land/": true,
"https://esm.sh": false
},
"prettier.enable": false
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"editor.formatOnSave": true
}
8 changes: 4 additions & 4 deletions bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { isNil } from './common.ts'
import { Alloc, License, Reset, SolJson, Version } from './deps.ts'
import type { Alloc, License, Reset, SolJson, Version } from './deps.ts'
import type { Callbacks, CoreBindings } from './types.ts'

function bindSolcMethod(
Expand Down Expand Up @@ -219,8 +219,8 @@ function runWithCallbacks(
}

function bindCompileStandard(solJson: SolJson, coreBindings: CoreBindings) {
let boundFunctionStandard: any = null
let boundFunctionSolidity: any = null
let boundFunctionStandard: ((input: number, readCallback: Callbacks) => void) | null = null
let boundFunctionSolidity: ((...args: unknown[]) => void) | null = null

// input (jsontext), callback (ptr) -> output (jsontext)
const compileInternal = bindSolcMethod(
Expand Down Expand Up @@ -248,7 +248,7 @@ function bindCompileStandard(solJson: SolJson, coreBindings: CoreBindings) {

if (!isNil(boundFunctionSolidity)) {
boundFunctionStandard = function (input: number, callbacks: Callbacks) {
return runWithCallbacks(coreBindings, callbacks, boundFunctionSolidity, [input])
return runWithCallbacks(coreBindings, callbacks, boundFunctionSolidity as ((...args: unknown[]) => void), [input])
}
}

Expand Down
2 changes: 1 addition & 1 deletion common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export const formatFatalError = (message: string) =>
],
})

export const isNil = (value: unknown) => value == null
export const isNil = (value: unknown): value is null => value == null
85 changes: 84 additions & 1 deletion deno.lock

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

2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { copy, readerFromStreamReader } from 'https://deno.land/std@0.187.0/streams/mod.ts'
export { copy, readerFromStreamReader } from 'https://deno.land/std@0.210.0/streams/mod.ts'
export type {
Alloc,
Callbacks,
Expand Down
5 changes: 2 additions & 3 deletions download_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { describe, expect, it, run } from 'https://deno.land/x/[email protected]/mod.ts'
import { describe, it } from 'https://deno.land/[email protected]/testing/bdd.ts'
import { expect } from 'https://deno.land/[email protected]/expect/mod.ts'
import { download } from 'solc/download'
import { exists } from './helpers_test.ts'

Expand All @@ -25,5 +26,3 @@ describe('solc/download.ts', () => {
}
})
})

run()
5 changes: 2 additions & 3 deletions mod_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { beforeAll, describe, expect, it, run } from 'https://deno.land/x/[email protected]/mod.ts'
import { beforeAll, describe, it } from 'https://deno.land/[email protected]/testing/bdd.ts'
import { expect } from 'https://deno.land/[email protected]/expect/mod.ts'
import { wrapper } from 'solc'
import { createRequire } from './helpers_test.ts'
import { download } from 'solc/download'
Expand Down Expand Up @@ -53,5 +54,3 @@ describe('solc/wrapper.ts', () => {
])
})
})

run()

0 comments on commit 5a69877

Please sign in to comment.