Skip to content

Commit

Permalink
feat: support node v12+ (#294)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra authored May 27, 2021
1 parent cebe765 commit 6ec201b
Show file tree
Hide file tree
Showing 14 changed files with 1,453 additions and 1,489 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup node v12
- name: Setup node v16
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16

- name: Install dependencies
run: yarn install
Expand All @@ -65,6 +65,11 @@ jobs:
integration-test:
runs-on: ubuntu-20.04
name: Integration Tests

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- name: Checkout aries-framework-javascript
uses: actions/checkout@v2
Expand Down Expand Up @@ -92,10 +97,10 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup node v12
- name: Setup NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: 12
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install
Expand Down Expand Up @@ -155,10 +160,10 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup node v12
- name: Setup node v16
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16

- name: Install dependencies
run: yarn install
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"eslint-plugin-prettier": "^3.3.1",
"express": "^4.17.1",
"husky": "^5.1.3",
"indy-sdk": "^1.16.0",
"indy-sdk": "^1.16.0-dev-1633",
"jest": "^26.6.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
Expand Down Expand Up @@ -89,6 +89,6 @@
}
},
"engines": {
"node": "^12"
"node": ">= 12"
}
}
5 changes: 1 addition & 4 deletions src/modules/connections/ConnectionsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ export class ConnectionsModule {
this.registerHandlers(dispatcher)
}

public async createConnection(config?: {
autoAcceptConnection?: boolean
alias?: string
}): Promise<{
public async createConnection(config?: { autoAcceptConnection?: boolean; alias?: string }): Promise<{
invitation: ConnectionInvitationMessage
connectionRecord: ConnectionRecord
}> {
Expand Down
16 changes: 4 additions & 12 deletions src/modules/connections/models/did/__tests__/PublicKey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ describe('Did | PublicKey', () => {
expect(transformed).toEqual(json)
})

const publicKeyJsonToClassTests: [
string,
ClassConstructor<PublicKey>,
Record<string, string | undefined>,
string
][] = publicKeysJson.map((pk) => [pk.class.name, pk.class, pk.json, pk.valueKey])
const publicKeyJsonToClassTests: [string, ClassConstructor<PublicKey>, Record<string, string | undefined>, string][] =
publicKeysJson.map((pk) => [pk.class.name, pk.class, pk.json, pk.valueKey])
test.each(publicKeyJsonToClassTests)(
'should correctly transform Json to %s class',
async (_, publicKeyClass, json, valueKey) => {
Expand All @@ -86,12 +82,8 @@ describe('Did | PublicKey', () => {
}
)

const publicKeyClassToJsonTests: [
string,
PublicKey,
Record<string, string | undefined>,
string
][] = publicKeysJson.map((pk) => [pk.class.name, new pk.class({ ...(pk.json as any) }), pk.json, pk.valueKey])
const publicKeyClassToJsonTests: [string, PublicKey, Record<string, string | undefined>, string][] =
publicKeysJson.map((pk) => [pk.class.name, new pk.class({ ...(pk.json as any) }), pk.json, pk.valueKey])

test.each(publicKeyClassToJsonTests)(
'should correctly transform %s class to Json',
Expand Down
12 changes: 4 additions & 8 deletions src/modules/credentials/__tests__/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ export const credDef = {
tag: 'TAG',
value: {
primary: {
n:
'92498022445845202032348897620554299694896009176315493627722439892023558526259875239808280186111059586069456394012963552956574651629517633396592827947162983189649269173220440607665417484696688946624963596710652063849006738050417440697782608643095591808084344059908523401576738321329706597491345875134180790935098782801918369980296355919072827164363500681884641551147645504164254206270541724042784184712124576190438261715948768681331862924634233043594086219221089373455065715714369325926959533971768008691000560918594972006312159600845441063618991760512232714992293187779673708252226326233136573974603552763615191259713',
s:
'10526250116244590830801226936689232818708299684432892622156345407187391699799320507237066062806731083222465421809988887959680863378202697458984451550048737847231343182195679453915452156726746705017249911605739136361885518044604626564286545453132948801604882107628140153824106426249153436206037648809856342458324897885659120708767794055147846459394129610878181859361616754832462886951623882371283575513182530118220334228417923423365966593298195040550255217053655606887026300020680355874881473255854564974899509540795154002250551880061649183753819902391970912501350100175974791776321455551753882483918632271326727061054',
n: '92498022445845202032348897620554299694896009176315493627722439892023558526259875239808280186111059586069456394012963552956574651629517633396592827947162983189649269173220440607665417484696688946624963596710652063849006738050417440697782608643095591808084344059908523401576738321329706597491345875134180790935098782801918369980296355919072827164363500681884641551147645504164254206270541724042784184712124576190438261715948768681331862924634233043594086219221089373455065715714369325926959533971768008691000560918594972006312159600845441063618991760512232714992293187779673708252226326233136573974603552763615191259713',
s: '10526250116244590830801226936689232818708299684432892622156345407187391699799320507237066062806731083222465421809988887959680863378202697458984451550048737847231343182195679453915452156726746705017249911605739136361885518044604626564286545453132948801604882107628140153824106426249153436206037648809856342458324897885659120708767794055147846459394129610878181859361616754832462886951623882371283575513182530118220334228417923423365966593298195040550255217053655606887026300020680355874881473255854564974899509540795154002250551880061649183753819902391970912501350100175974791776321455551753882483918632271326727061054',
r: [Object],
rctxt:
'46370806529776888197599056685386177334629311939451963919411093310852010284763705864375085256873240323432329015015526097014834809926159013231804170844321552080493355339505872140068998254185756917091385820365193200970156007391350745837300010513687490459142965515562285631984769068796922482977754955668569724352923519618227464510753980134744424528043503232724934196990461197793822566137436901258663918660818511283047475389958180983391173176526879694302021471636017119966755980327241734084462963412467297412455580500138233383229217300797768907396564522366006433982511590491966618857814545264741708965590546773466047139517',
z:
'84153935869396527029518633753040092509512111365149323230260584738724940130382637900926220255597132853379358675015222072417404334537543844616589463419189203852221375511010886284448841979468767444910003114007224993233448170299654815710399828255375084265247114471334540928216537567325499206413940771681156686116516158907421215752364889506967984343660576422672840921988126699885304325384925457260272972771547695861942114712679509318179363715259460727275178310181122162544785290813713205047589943947592273130618286905125194410421355167030389500160371886870735704712739886223342214864760968555566496288314800410716250791012',
z: '84153935869396527029518633753040092509512111365149323230260584738724940130382637900926220255597132853379358675015222072417404334537543844616589463419189203852221375511010886284448841979468767444910003114007224993233448170299654815710399828255375084265247114471334540928216537567325499206413940771681156686116516158907421215752364889506967984343660576422672840921988126699885304325384925457260272972771547695861942114712679509318179363715259460727275178310181122162544785290813713205047589943947592273130618286905125194410421355167030389500160371886870735704712739886223342214864760968555566496288314800410716250791012',
},
},
}
Expand All @@ -35,8 +32,7 @@ export const credReq = {
prover_did: 'did:sov:Y8iyDrCHfUpBY2jkd7Utfx',
cred_def_id: 'TL1EaPFCZ8Si5aUrqScBDt:3:CL:51:TAG',
blinded_ms: {
u:
'110610123432332476473375007487247709218419524765032439076208019871743569018252586850427838771931221771227203551775289761586009084292284314207436640231052129266015503401118322009304919643287710408379757802540667358968471419257863330969561198349637578063688118910240720917456714103872180385172499545967921817473077820161374967377407759331556210823439440478684915287345759439215952485377081630435110911287494666818169608863639467996786227107447757434904894305851282532340335379056077475867151483520074334113239997171746478579695337411744772387197598863836759115206573022265599781958164663366458791934494773405738216913411',
u: '110610123432332476473375007487247709218419524765032439076208019871743569018252586850427838771931221771227203551775289761586009084292284314207436640231052129266015503401118322009304919643287710408379757802540667358968471419257863330969561198349637578063688118910240720917456714103872180385172499545967921817473077820161374967377407759331556210823439440478684915287345759439215952485377081630435110911287494666818169608863639467996786227107447757434904894305851282532340335379056077475867151483520074334113239997171746478579695337411744772387197598863836759115206573022265599781958164663366458791934494773405738216913411',
ur: null,
hidden_attributes: ['master_secret'],
committed_attributes: {},
Expand Down
2 changes: 1 addition & 1 deletion src/modules/credentials/models/Credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export class Credential {
public interval?: RevocationInterval

public toJSON(): IndyCredential {
return (JsonTransformer.toJSON(this) as unknown) as IndyCredential
return JsonTransformer.toJSON(this) as unknown as IndyCredential
}
}
2 changes: 1 addition & 1 deletion src/modules/credentials/models/IndyCredentialInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ export class IndyCredentialInfo {
public credentialRevocationId?: string

public toJSON(): IndySDKCredentialInfo {
return (JsonTransformer.toJSON(this) as unknown) as IndySDKCredentialInfo
return JsonTransformer.toJSON(this) as unknown as IndySDKCredentialInfo
}
}
2 changes: 1 addition & 1 deletion src/modules/proofs/models/ProofRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ export class ProofRequest {

public toJSON() {
// IndyProofRequest is indy-sdk json type
return (JsonTransformer.toJSON(this) as unknown) as IndyProofRequest
return JsonTransformer.toJSON(this) as unknown as IndyProofRequest
}
}
2 changes: 1 addition & 1 deletion src/modules/proofs/models/RequestedCredentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RequestedCredentials {

public toJSON() {
// IndyRequestedCredentials is indy-sdk json type
return (JsonTransformer.toJSON(this) as unknown) as IndyRequestedCredentials
return JsonTransformer.toJSON(this) as unknown as IndyRequestedCredentials
}

public getCredentialIdentifiers(): string[] {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/proofs/services/ProofService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ export class ProofService {
attributeReferent,
})

return (JsonTransformer.fromJSON(credentialsJson, Credential) as unknown) as Credential[]
return JsonTransformer.fromJSON(credentialsJson, Credential) as unknown as Credential[]
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/storage/__tests__/Repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { mockFunction } from '../../__tests__/helpers'

jest.mock('../IndyStorageService')

const StorageMock = (IndyStorageService as unknown) as jest.Mock<IndyStorageService<TestRecord>>
const StorageMock = IndyStorageService as unknown as jest.Mock<IndyStorageService<TestRecord>>

describe('Repository', () => {
let repository: Repository<TestRecord>
Expand Down
3 changes: 1 addition & 2 deletions src/utils/__tests__/BufferEncoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ describe('BufferEncoder', () => {
prover_did: 'did:sov:4xRwQoKEBcLMR3ni1uEVxo',
cred_def_id: 'TL1EaPFCZ8Si5aUrqScBDt:3:CL:132:TAG',
blinded_ms: {
u:
'29923358933378594884016949116015048362197910313115517615886712002247549877203754161040662113193681067971700889005059954680562568543707874455462734614770719857476517583732118175472117258262243524371047244612027670795341517678404538774311254888125372395478117859977957781545203614422057872425388379038174161933077364160507888216751250173474993459002409808169413785534283242566104648944508528553665015907898791106766199966107619949762668272339931067050394002255637771035855365582098862561250576470504742036107864292062117797625825433248517924504550308968312780301031964645548333248088593015937359889688860141757860414963',
u: '29923358933378594884016949116015048362197910313115517615886712002247549877203754161040662113193681067971700889005059954680562568543707874455462734614770719857476517583732118175472117258262243524371047244612027670795341517678404538774311254888125372395478117859977957781545203614422057872425388379038174161933077364160507888216751250173474993459002409808169413785534283242566104648944508528553665015907898791106766199966107619949762668272339931067050394002255637771035855365582098862561250576470504742036107864292062117797625825433248517924504550308968312780301031964645548333248088593015937359889688860141757860414963',
ur: null,
hidden_attributes: ['master_secret'],
committed_attributes: {},
Expand Down
3 changes: 1 addition & 2 deletions src/utils/__tests__/JsonEncoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ describe('JsonEncoder', () => {
prover_did: 'did:sov:4xRwQoKEBcLMR3ni1uEVxo',
cred_def_id: 'TL1EaPFCZ8Si5aUrqScBDt:3:CL:132:TAG',
blinded_ms: {
u:
'29923358933378594884016949116015048362197910313115517615886712002247549877203754161040662113193681067971700889005059954680562568543707874455462734614770719857476517583732118175472117258262243524371047244612027670795341517678404538774311254888125372395478117859977957781545203614422057872425388379038174161933077364160507888216751250173474993459002409808169413785534283242566104648944508528553665015907898791106766199966107619949762668272339931067050394002255637771035855365582098862561250576470504742036107864292062117797625825433248517924504550308968312780301031964645548333248088593015937359889688860141757860414963',
u: '29923358933378594884016949116015048362197910313115517615886712002247549877203754161040662113193681067971700889005059954680562568543707874455462734614770719857476517583732118175472117258262243524371047244612027670795341517678404538774311254888125372395478117859977957781545203614422057872425388379038174161933077364160507888216751250173474993459002409808169413785534283242566104648944508528553665015907898791106766199966107619949762668272339931067050394002255637771035855365582098862561250576470504742036107864292062117797625825433248517924504550308968312780301031964645548333248088593015937359889688860141757860414963',
ur: null,
hidden_attributes: ['master_secret'],
committed_attributes: {},
Expand Down
Loading

0 comments on commit 6ec201b

Please sign in to comment.