-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: added coverage threshold * chore: added coverage threshold * chore: added coverage threshold * chore: added coverage threshold * chore: added coverage threshold * chore: added coverage threshold * chore: commented testnet tests * chore: commented testnet tests * chore: commented testnet tests * chore: commented testnet tests * chore: functions coverage for network is 99
- Loading branch information
1 parent
5267fd4
commit a09df9b
Showing
18 changed files
with
357 additions
and
269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
import { TESTNET_URL, ThorClient } from '@vechain/sdk-network'; | ||
// The commented out lines should be used as part of the test on solo {@link https://github.com/vechain/vechain-sdk-js/issues/1357} | ||
// import { TESTNET_URL, ThorClient } from '@vechain/sdk-network'; | ||
|
||
// START_SNIPPET: DebugTraceContractCallSnippet | ||
// // START_SNIPPET: DebugTraceContractCallSnippet | ||
|
||
// 1 - Create thor client for testnet | ||
const thorClient = ThorClient.fromUrl(TESTNET_URL); | ||
// // 1 - Create thor client for testnet | ||
// const thorClient = ThorClient.fromUrl(TESTNET_URL); | ||
|
||
// 2 - Trace the contract call. | ||
const result = await thorClient.debug.traceContractCall( | ||
{ | ||
contractInput: { | ||
to: '0x0000000000000000000000000000456E65726779', | ||
data: '0xa9059cbb0000000000000000000000000000000000000000000000000000456e65726779000000000000000000000000000000000000000000000004563918244f400000', | ||
value: '0x0' | ||
}, | ||
transactionOptions: { | ||
caller: '0x625fCe8dd8E2C05e82e77847F3da06AF6e55A7AF', | ||
gasPayer: '0x625fCe8dd8E2C05e82e77847F3da06AF6e55A7AF', | ||
expiration: 18, | ||
blockRef: '0x0101d05409d55cce' | ||
}, | ||
config: {} | ||
}, | ||
null | ||
); | ||
// // 2 - Trace the contract call. | ||
// const result = await thorClient.debug.traceContractCall( | ||
// { | ||
// contractInput: { | ||
// to: '0x0000000000000000000000000000456E65726779', | ||
// data: '0xa9059cbb0000000000000000000000000000000000000000000000000000456e65726779000000000000000000000000000000000000000000000004563918244f400000', | ||
// value: '0x0' | ||
// }, | ||
// transactionOptions: { | ||
// caller: '0x625fCe8dd8E2C05e82e77847F3da06AF6e55A7AF', | ||
// gasPayer: '0x625fCe8dd8E2C05e82e77847F3da06AF6e55A7AF', | ||
// expiration: 18, | ||
// blockRef: '0x0101d05409d55cce' | ||
// }, | ||
// config: {} | ||
// }, | ||
// null | ||
// ); | ||
|
||
// 3 - Print the result. | ||
console.log(result); | ||
// // 3 - Print the result. | ||
// console.log(result); | ||
|
||
// END_SNIPPET: DebugTraceContractCallSnippet | ||
// // END_SNIPPET: DebugTraceContractCallSnippet |
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 |
---|---|---|
@@ -1,9 +1,23 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
// Coverage threshold would apply to yarn test, not yarn test:unit | ||
const isUnitTest = process.env.UNIT; | ||
|
||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
coverageReporters: ['html', 'lcov', 'json'], | ||
runner: 'groups', | ||
reporters: ['default', 'jest-junit'], | ||
workerThreads: false | ||
workerThreads: false, | ||
coverageThreshold: | ||
isUnitTest !== 'true' | ||
? { | ||
global: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100 | ||
} | ||
} | ||
: undefined | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,23 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
// Coverage threshold would apply to yarn test, not yarn test:unit | ||
const isUnitTest = process.env.UNIT; | ||
|
||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
coverageReporters: ['html', 'lcov', 'json'], | ||
runner: 'groups', | ||
reporters: ['default', 'jest-junit'], | ||
workerThreads: true | ||
workerThreads: true, | ||
coverageThreshold: | ||
isUnitTest !== 'true' | ||
? { | ||
global: { | ||
branches: 99, | ||
functions: 99, | ||
lines: 99, | ||
statements: 99 | ||
} | ||
} | ||
: undefined | ||
}; |
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
Oops, something went wrong.
a09df9b
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.
Test Coverage
Summary