Skip to content

Commit

Permalink
revert: 1.0.23 package update
Browse files Browse the repository at this point in the history
This reverts commit 52b0270.
  • Loading branch information
Polybius93 committed Jul 18, 2024
1 parent f61cd39 commit 7decf0d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "dlc-btc-lib",
"version": "1.0.23",
"version": "1.0.22",
"description": "This library provides a comprehensive set of interfaces and functions for minting dlcBTC tokens on supported blockchains.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
51 changes: 51 additions & 0 deletions tests/unit/attestor-request-functions.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import * as attestorRequestFunctions from '../../src/functions/attestor/attestor-request.functions.js';
import { submitFundingPSBT } from '../../src/functions/attestor/attestor-request.functions.js';

describe('Attestor ', () => {
beforeEach(() => {
jest.clearAllMocks();
});
describe('submitFundingPSBT', () => {
it('should not throw an error if all requests were succesful', async () => {
jest
.spyOn(attestorRequestFunctions, 'sendRequest')
.mockImplementationOnce(async () => true)
.mockImplementationOnce(async () => true)
.mockImplementationOnce(async () => true);

await expect(
submitFundingPSBT(
['http://localhost:3000', 'http://localhost:4000', 'http://localhost:5000'],
{
vaultUUID: 'vaultUUID',
fundingPSBT: 'fundingPSBT',
userEthereumAddress: 'userEthereumAddress',
attestorChainID: 'evm-arbitrum',
userBitcoinTaprootPublicKey: 'userBitcoinTaprootPublicKey',
}
)
).resolves.not.toThrow();
});

it('should not throw an error if not all requests were succesful', async () => {
jest
.spyOn(attestorRequestFunctions, 'sendRequest')
.mockImplementationOnce(async () => true)
.mockImplementationOnce(async () => true)
.mockImplementationOnce(async () => false);

await expect(
submitFundingPSBT(
['http://localhost:3000', 'http://localhost:4000', 'http://localhost:5000'],
{
vaultUUID: 'vaultUUID',
fundingPSBT: 'fundingPSBT',
userEthereumAddress: 'userEthereumAddress',
attestorChainID: 'evm-arbitrum',
userBitcoinTaprootPublicKey: 'userBitcoinTaprootPublicKey',
}
)
).resolves.not.toThrow();
});
});
});

0 comments on commit 7decf0d

Please sign in to comment.