File tree 4 files changed +104
-0
lines changed
packages/non-deployable/token-allocation
4 files changed +104
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @chainlink/token-allocation-adapter ' : minor
3
+ ---
4
+
5
+ Fix blocksize-capital as source
Original file line number Diff line number Diff line change @@ -136,6 +136,10 @@ export const inputParameters: InputParameters<TInputParameters> = {
136
136
}
137
137
138
138
export const execute = async ( input : AdapterRequest , config : Config ) : Promise < AdapterResponse > => {
139
+ if ( input . data ) {
140
+ input . data . source = ( input . data . source as string ) ?. replace ( '-' , '_' ) || ''
141
+ }
142
+
139
143
const paramOptions = makeOptions ( config )
140
144
const validator = new Validator ( input , inputParameters , paramOptions )
141
145
if ( validator . error ) throw validator . error
Original file line number Diff line number Diff line change @@ -60,6 +60,36 @@ exports[`execute additional input parameter pass through should return the corre
60
60
}
61
61
` ;
62
62
63
+ exports [` execute additional input parameter pass through should return the correct price for source blocksize-capital with additional input 1` ] = `
64
+ {
65
+ " data" : {
66
+ " payload" : {
67
+ " DAI" : {
68
+ " quote" : {
69
+ " EUR" : {
70
+ " price" : 130.27 ,
71
+ },
72
+ },
73
+ },
74
+ " WBTC" : {
75
+ " quote" : {
76
+ " EUR" : {
77
+ " price" : 130.27 ,
78
+ },
79
+ },
80
+ },
81
+ },
82
+ " result" : 260.54 ,
83
+ " sources" : [],
84
+ },
85
+ " debug" : undefined ,
86
+ " jobRunID" : " 1" ,
87
+ " providerStatusCode" : 200 ,
88
+ " result" : 260.54 ,
89
+ " statusCode" : 200 ,
90
+ }
91
+ ` ;
92
+
63
93
exports [` execute additional input parameter pass through should return the correct price for source coinapi with additional input 1` ] = `
64
94
{
65
95
" data" : {
@@ -360,6 +390,36 @@ exports[`execute marketcap method should return the correct price for source blo
360
390
}
361
391
` ;
362
392
393
+ exports [` execute marketcap method should return the correct price for source blocksize-capital 1` ] = `
394
+ {
395
+ " data" : {
396
+ " payload" : {
397
+ " DAI" : {
398
+ " quote" : {
399
+ " EUR" : {
400
+ " marketCap" : 130.27 ,
401
+ },
402
+ },
403
+ },
404
+ " WBTC" : {
405
+ " quote" : {
406
+ " EUR" : {
407
+ " marketCap" : 130.27 ,
408
+ },
409
+ },
410
+ },
411
+ },
412
+ " result" : 260.54 ,
413
+ " sources" : [],
414
+ },
415
+ " debug" : undefined ,
416
+ " jobRunID" : " 1" ,
417
+ " providerStatusCode" : 200 ,
418
+ " result" : 260.54 ,
419
+ " statusCode" : 200 ,
420
+ }
421
+ ` ;
422
+
363
423
exports [` execute marketcap method should return the correct price for source coinapi 1` ] = `
364
424
{
365
425
" data" : {
@@ -690,6 +750,36 @@ exports[`execute price method should return the correct price for source blocksi
690
750
}
691
751
` ;
692
752
753
+ exports [` execute price method should return the correct price for source blocksize-capital 1` ] = `
754
+ {
755
+ " data" : {
756
+ " payload" : {
757
+ " DAI" : {
758
+ " quote" : {
759
+ " EUR" : {
760
+ " price" : 130.27 ,
761
+ },
762
+ },
763
+ },
764
+ " WBTC" : {
765
+ " quote" : {
766
+ " EUR" : {
767
+ " price" : 130.27 ,
768
+ },
769
+ },
770
+ },
771
+ },
772
+ " result" : 260.54 ,
773
+ " sources" : [],
774
+ },
775
+ " debug" : undefined ,
776
+ " jobRunID" : " 1" ,
777
+ " providerStatusCode" : 200 ,
778
+ " result" : 260.54 ,
779
+ " statusCode" : 200 ,
780
+ }
781
+ ` ;
782
+
693
783
exports [` execute price method should return the correct price for source coinapi 1` ] = `
694
784
{
695
785
" data" : {
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ export const dataProviderConfig: TokenAllocationTest = {
51
51
providerUrlEnvVar : 'TIINGO_ADAPTER_URL' ,
52
52
additional : { } ,
53
53
} ,
54
+ 'blocksize-capital' : {
55
+ providerUrl : 'http://localhost:3010' ,
56
+ providerUrlEnvVar : 'BLOCKSIZE_CAPITAL_ADAPTER_URL' ,
57
+ additional : { } ,
58
+ } ,
54
59
blocksize_capital : {
55
60
providerUrl : 'http://localhost:3010' ,
56
61
providerUrlEnvVar : 'BLOCKSIZE_CAPITAL_ADAPTER_URL' ,
You can’t perform that action at this time.
0 commit comments