
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
@vechain/veworld-mock
Advanced tools
βββ ββββββββββββββ βββ βββββββ βββββββ βββ βββββββ
βββ ββββββββββββββ βββββββββββββββββββββββ ββββββββ
βββ βββββββββ βββ ββ ββββββ ββββββββββββββ βββ βββ
ββββ ββββββββββ βββββββββββββ ββββββββββββββ βββ βββ
βββββββ ββββββββββββββββββββββββββββββ βββββββββββββββββββ
βββββ ββββββββ ββββββββ βββββββ βββ ββββββββββββββββββ
ββββ ββββ βββββββ ββββββββββ βββ
βββββ βββββββββββββββββββββββββ ββββ
ββββββββββββββ ββββββ βββββββ
ββββββββββββββ ββββββ βββββββ
βββ βββ βββββββββββββββββββββββ βββ
βββ βββ βββββββ ββββββββββ βββ
VeWorld mock allows to develop e2e tests for dApps that interact with VeWorld browser wallet.
dApp's and VeWorld browser wallet communicate through the window
object to each other. Specifically
VeWorld makes functions available on the window
object that a dApp can call. These functions
are for certificate signing and transaction signing and sending to VeChain Thor.
VeWorld Mock replaces those functions with its own implementation, meaning that VeWorld browser wallet is not needed to be installed when running playwright tests, and the mock implementations of these functions can be configured to suit the test scenario.
Add the dependencies to your project
yarn add --dev @vechain/veworld-mock
yarn add --dev @vechain/veworld-mock-playwright
VeWorld mock has the following configuration:
accountIndex
: the account index derived from the mnemonicchainTag
: the chain tag of the thor instance usedmnemonicWords
: the mnemonic used to derive the account indexthorUrl
: URL of Thorest apiBy default, VeWorld mock is configured to use a local Solo, with its default mnemonic and its first account.
VeWorld mock has the following options:
mockTransaction
: specifies the type of transaction to create, values are {real, fake, reject}
real
--> the mock will create a real transactionfake
--> the mock will return the configured fake transaction idreject
--> the mock will return an error similar to when the user clicks on Reject in VeWorldfakeTxId
--> the transaction id to use when using fake
gasMultiplier
: when using real
or fake
the gas % multiplier to use when estimating the transaction gasThe default values are:
fakeCertSignerAddress: '0x0',
fakeTxId: '0x0',
mockTransaction: 'real',
mockCertificate: 'valid',
gasMultiplier: 0.2
(Note: To generate a reverted tx, a vet transfer clause of 10 billion is added to the tx)
mockCertificate
: specified how to mock the certificate signing, values are {valid, invalid}
valid
--> certificate will be signed correctlyinvalid
--> yhe certificate is signed correctly, but the signer
is set to the fake addressfakeCertSignerAddress
--> when using invalid
the fake signer addressVeWorld mock makes the following available:
address
: The address of the account index usedtxId
: The last signed tx idFAQs
VeWorld mock
The npm package @vechain/veworld-mock receives a total of 288 weekly downloads. As such, @vechain/veworld-mock popularity was classified as not popular.
We found that @vechain/veworld-mock demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checksβbuilt on trusted open source tools, ready to run out of the box.