@@ -3,7 +3,49 @@ import {
3
3
setEnvVariables ,
4
4
} from '@chainlink/external-adapter-framework/util/testing-utils'
5
5
import * as nock from 'nock'
6
- import { mockBitcoinRPCResponseSuccess , mockContractCallResponseSuccess } from './fixtures'
6
+ import { mockBitcoinRPCResponseSuccess } from './fixtures'
7
+ import { ethers } from 'ethers'
8
+
9
+ jest . mock ( 'ethers' , ( ) => {
10
+ const actualModule = jest . requireActual ( 'ethers' )
11
+ return {
12
+ ...actualModule ,
13
+ ethers : {
14
+ ...actualModule . ethers ,
15
+ providers : {
16
+ JsonRpcProvider : function ( ) : ethers . providers . JsonRpcProvider {
17
+ return { } as ethers . providers . JsonRpcProvider
18
+ } ,
19
+ } ,
20
+ Contract : function ( ) {
21
+ return {
22
+ attestorGroupPubKey : jest . fn ( ) . mockImplementation ( ( ) => {
23
+ return 'xpub6C1F2SwADP3TNajQjg2PaniEGpZLvWdMiFP8ChPjQBRWD1XUBeMdE4YkQYvnNhAYGoZKfcQbsRCefserB5DyJM7R9VR6ce6vLrXHVfeqyH3'
24
+ } ) ,
25
+ getAllDLCs : jest . fn ( ) . mockImplementation ( ( ) => {
26
+ return [
27
+ {
28
+ uuid : '0x9399fc7c386e7357fc101e638f3e208dcb95fbe06c47e3ff4219d5c726635222' ,
29
+ protocolContract : '0x2940FcBb3C32901Df405da0E96fd97D1E2a53f34' ,
30
+ timestamp : 0x665f1dd7 ,
31
+ valueLocked : 0x01312d00 ,
32
+ creator : '0x0DD4f29E21F10cb2E485cf9bDAb9F2dD1f240Bfa' ,
33
+ status : 1 ,
34
+ fundingTxId : '2d64eefe48cd209c4d549b065d3c04dcb29af57b01ca2a98c24274eae2732029' ,
35
+ closingTxId : '' ,
36
+ btcFeeRecipient :
37
+ '021b34f36d8487ce3a7a6f0124f58854d561cb52077593d1e86973fac0fea1a8b1' ,
38
+ btcMintFeeBasisPoints : 0x64 ,
39
+ btcRedeemFeeBasisPoints : 0x64 ,
40
+ taprootPubKey : 'b362931e3e4cf3cc20f75ae11ff5a4c115ec1548cb5f2c7c48294929f1e8979c' ,
41
+ } ,
42
+ ]
43
+ } ) ,
44
+ }
45
+ } ,
46
+ } ,
47
+ }
48
+ } )
7
49
8
50
describe ( 'execute' , ( ) => {
9
51
let spy : jest . SpyInstance
@@ -40,7 +82,6 @@ describe('execute', () => {
40
82
41
83
describe ( 'por endpoint' , ( ) => {
42
84
it ( 'should return success' , async ( ) => {
43
- mockContractCallResponseSuccess ( )
44
85
mockBitcoinRPCResponseSuccess ( )
45
86
const response = await testAdapter . request ( {
46
87
network : 'arbitrum' ,
0 commit comments