-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement new vechain sdk #276
base: main-v2
Are you sure you want to change the base?
Conversation
const { account } = useWallet(); | ||
const { account, signer } = useWallet(); | ||
|
||
const thor = useSDK().thor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Valazan why not useThor
?
useSDK().thor
doesn't type well IMO
packages/dapp-kit-react/src/types.ts
Outdated
connex: { | ||
thor: Connex.Thor; | ||
vendor: Connex.Vendor; | ||
sdk: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO just return thor
. There is no benefit wrapping thor inside sdk
export interface DAppKitContext {
thor: ThorClient;
const tx = await this._signFlow( | ||
transactionToSign, | ||
DelegationHandler( | ||
await this.provider?.wallet?.getDelegator(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await this.provider?.wallet?.getDelegator()
What does this return? Can we delegate by URL from dapp -> wallet?
* refactor: remove connex and init signer within dappkit * chore(deps): remove connex * fix: gha syntax error * chore(deps): remove connex * fix: tests * fix: build errors * revert: add sync2 back int * fix: tests * refactor: yarn, e2e and eslint (#311) * refactor: yarn, e2e and eslint * fix(GHA): install before install:all * fix(GHA): install before install:all * fix(extension): bug in extension * fix(extension): bug in extension * fix: update cucumber * fix: run stop preview after e2e * fix: lint errors * fix: sync errors * fix: sync2 not connecting * fix: sync2 txs broken * fix: tests * fix: tests * fix: yarn * fix: yarn workspaces * fix: missing declarations in test * fix: missing declarations in test * fix: missing declarations in test * fix: missing declarations in test * fix: dapp-kit-react tsx * fix: add exports to package.json * fix: ignore cucumber in examples * fix: set type to module * fix: package.jsons * fix: add type module * fix: package.jsons * fix: package.jsons * fix: fix angular * chore: documenation
@@ -20,5 +20,5 @@ | |||
'..', | |||
'veworld-dist.zip', | |||
); | |||
await asyncExec(`unzip ${zipPath} -d ${distPath}`); | |||
await asyncExec(`unzip -o ${zipPath}`); |
Check warning
Code scanning / CodeQL
Shell command built from environment values Medium test
absolute path
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 7 days ago
To fix the problem, we should avoid constructing the shell command as a single string that the shell interprets. Instead, we should use execFile
or execFileSync
to pass the command and its arguments separately. This approach ensures that the file path is treated as a literal argument and not subject to shell interpretation.
Specifically, we will:
- Replace the use of
exec
withexecFile
. - Pass the command (
unzip
) and its arguments (-o
and the file path) as separate parameters toexecFile
.
-
Copy modified line R4 -
Copy modified line R7 -
Copy modified line R23
@@ -3,6 +3,6 @@ | ||
import * as util from 'node:util'; | ||
import { exec } from 'node:child_process'; | ||
import { execFile } from 'node:child_process'; | ||
import { BeforeAll } from '@cucumber/cucumber'; | ||
|
||
const asyncExec = util.promisify(exec); | ||
const asyncExecFile = util.promisify(execFile); | ||
|
||
@@ -22,3 +22,3 @@ | ||
); | ||
await asyncExec(`unzip -o ${zipPath}`); | ||
await asyncExecFile('unzip', ['-o', zipPath]); | ||
}); |
No description provided.