File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
packages/server/tests/acceptance Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import {
33
33
transaction2930 ,
34
34
} from './data/conformity/utils/transactions' ;
35
35
import { getLatestBlockHash , sendRequestToRelay , signAndSendRawTransaction } from './data/conformity/utils/utils' ;
36
- import { getMissingKeys , isResponseValid } from './data/conformity/utils/validations' ;
36
+ import { findMissingKeys , isResponseValid } from './data/conformity/utils/validations' ;
37
37
38
38
const directoryPath = path . resolve ( __dirname , '../../../../node_modules/execution-apis/tests' ) ;
39
39
const overwritesDirectoryPath = path . resolve ( __dirname , 'data/conformity/overwrites' ) ;
@@ -350,7 +350,7 @@ describe('@api-conformity', async function () {
350
350
await new Promise ( ( r ) => setTimeout ( r , 500 ) ) ;
351
351
352
352
const hasMissingKeys =
353
- getMissingKeys ( {
353
+ findMissingKeys ( {
354
354
actual : response ,
355
355
expected : JSON . parse ( testCases [ testName ] . response ) ,
356
356
wildcards : [ ] ,
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export function hasResponseFormatIssues(
84
84
}
85
85
return true ;
86
86
}
87
- const missingKeys = getMissingKeys ( {
87
+ const missingKeys = findMissingKeys ( {
88
88
actual : actualResponse as Record < string , unknown > ,
89
89
expected : parsedExpectedResponse ,
90
90
wildcards,
@@ -97,15 +97,17 @@ export function hasResponseFormatIssues(
97
97
return hasValuesMismatch ( actualResponse , parsedExpectedResponse , wildcards ) ;
98
98
}
99
99
100
- export function getMissingKeys ( response : {
100
+ export function findMissingKeys ( response : {
101
101
actual : Record < string , unknown > ;
102
102
expected : Record < string , unknown > ;
103
103
wildcards : string [ ] ;
104
104
} ) : string [ ] {
105
105
const skipKeys = new Set ( [ ...extractKeys ( response . actual ) , ...response . wildcards ] ) ;
106
- return extractKeys ( response . expected ) . filter ( ( key ) => ! skipKeys . has ( key ) ) ;
106
+ return extractKeys ( response . expected ) . filter ( notIn ( skipKeys ) ) ;
107
107
}
108
108
109
+ const notIn = ( set : ReadonlySet < string > ) => ( k : string ) => ! set . has ( k ) ;
110
+
109
111
/**
110
112
* Checks if the actual response is missing required error properties
111
113
*
You can’t perform that action at this time.
0 commit comments