-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
223 additions
and
27 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
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
29 changes: 29 additions & 0 deletions
29
packages/massa-web3/test/experimental/unit/mock/blockchainClient.mock.ts
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { OperationStatus } from '../../../../src/experimental/basicElements/operation' | ||
import { | ||
BlockchainClient, | ||
EventFilter, | ||
SCOutputEvent, | ||
SendOperationInput, | ||
} from '../../../../src/experimental/client/interfaces' | ||
|
||
import { NodeStatus } from '../../../../src/experimental/generated/client' | ||
|
||
export const blockchainClientMock: BlockchainClient = { | ||
sendOperation: jest.fn((data: SendOperationInput) => | ||
Promise.resolve('operationId') | ||
), | ||
fetchPeriod: jest.fn(() => Promise.resolve(1)), | ||
getOperationStatus: jest.fn((operationId: string) => | ||
Promise.resolve(OperationStatus.Success) | ||
), | ||
getBalance: jest.fn((address: string, speculative?: boolean) => | ||
Promise.resolve(BigInt(1000)) | ||
), | ||
getEvents: jest.fn((filter: EventFilter) => | ||
Promise.resolve([] as SCOutputEvent[]) | ||
), | ||
getChainId: jest.fn(() => Promise.resolve(BigInt(1))), | ||
getMinimalFee: jest.fn(() => Promise.resolve(BigInt(1))), | ||
status: {} as NodeStatus, | ||
} |
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
cf21d2b
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.
Coverage report for experimental massa-web3
Test suite run success
48 tests passing in 7 suites.
Report generated by 🧪jest coverage report action from cf21d2b