Skip to content

Commit

Permalink
Merge pull request #81 from sicpa-dlab/update-vtp-lib
Browse files Browse the repository at this point in the history
Updated version of VTP library to 0.2.7
  • Loading branch information
Artemkaaas authored Oct 25, 2022
2 parents 064d8e6 + 83557c0 commit dfd6bad
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
- [ ] I built my code on Linux
- [ ] I have considered platform differences
- [ ] I'm using environment-aware scripts (bash, env, build scripts)
[ ] I have published a [pre-release package of AFJ](TODO:link-to-readme), installed and tested it in other apps
[ ] I have published a [pre-release package of AFJ](TODO:link-to-readme), installed and tested it in other apps

### Dependencies (specific to Aries Framework Repo)

Expand All @@ -76,4 +76,3 @@
- Do we need to bump major app version?
- [ ] Small change, bumping only minor version via CI script is fine (need to be done manual)
- [ ] Larger change, so need to bump major version (need to be done manually)

2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@aries-framework/core": "npm:@sicpa-dlab/aries-framework-core",
"@aries-framework/node": "npm:@sicpa-dlab/aries-framework-node",
"@sicpa-dlab/value-transfer-protocol-ts": "0.2.6",
"@sicpa-dlab/value-transfer-protocol-ts": "0.2.7",
"@types/figlet": "^1.5.4",
"@types/inquirer": "^8.1.3",
"clear": "^0.1.0",
Expand Down
20 changes: 19 additions & 1 deletion demo/src/BaseAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {
DidProps,
InboundTransport,
InitConfig,
InternetChecker,
Logger,
OutboundTransport,
ValueTransferConfig,
Expand All @@ -11,6 +12,7 @@ import {
Agent,
AutoAcceptCredential,
AutoAcceptProof,
ConsoleLogger,
HttpOutboundTransport,
LogLevel,
MediatorDeliveryStrategy,
Expand All @@ -30,6 +32,9 @@ const bcovrin = `{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blsk
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.138.255","client_port":9708,"node_ip":"138.197.138.255","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"}`

export const logger: Logger = {
createContextLogger(context: string): Logger {
return new ConsoleLogger(this.logLevel, context)
},
logLevel: LogLevel.info,
test: (message: string) => {
console.log(message)
Expand All @@ -54,6 +59,18 @@ export const logger: Logger = {
},
}

export const internetChecker: InternetChecker = {
hasInternetAccess(): Promise<boolean> {
return Promise.resolve(true)
},
}

export const doesNotHasInternetChecker: InternetChecker = {
hasInternetAccess(): Promise<boolean> {
return Promise.resolve(false)
},
}

export class BaseAgent {
public static defaultMediatorConnectionInvite =
'http://localhost:3000/api/v1?oob=eyJ0eXAiOiJhcHBsaWNhdGlvbi9kaWRjb21tLXBsYWluK2pzb24iLCJpZCI6ImIwMWNiNTI2LTNkNjAtNDY3OC1hMDRhLWY4NDVjMzZkYjRlNCIsImZyb20iOiJkaWQ6cGVlcjoyLkV6NkxTbkhTOWYzaHJNdUxyTjl6NlpobzdUY0JSdlN5SzdIUGpRdHdLbXUzb3NXd0YuVno2TWtyYWhBb1ZMUVM5UzVHRjVzVUt0dWRYTWVkVVNaZGRlSmhqSHRBRmFWNGhvVi5TVzNzaWN5STZJbWgwZEhBNkx5OXNiMk5oYkdodmMzUTZNekF3TUM5aGNHa3ZkakVpTENKMElqb2laRzBpTENKeUlqcGJYWDBzZXlKeklqb2lkM002THk5c2IyTmhiR2h2YzNRNk16QXdNQzloY0drdmRqRWlMQ0owSWpvaVpHMGlMQ0p5SWpwYlhYMWQiLCJib2R5Ijp7ImdvYWxfY29kZSI6Im1lZGlhdG9yLXByb3Zpc2lvbiJ9LCJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9vdXQtb2YtYmFuZC8yLjAvaW52aXRhdGlvbiIsImFsZyI6IkhTMjU2In0='
Expand Down Expand Up @@ -93,6 +110,7 @@ export class BaseAgent {
mediatorConnectionsInvite?: string
endpoints?: string[]
emulateOfflineCase?: boolean
internetChecker?: InternetChecker
}) {
this.name = props.name
this.port = props.port
Expand Down Expand Up @@ -123,7 +141,7 @@ export class BaseAgent {
transports: props.transports,
mediatorConnectionsInvite: props.mediatorConnectionsInvite,
mediatorDeliveryStrategy: MediatorDeliveryStrategy.WebSocket,
emulateOfflineCase: props.emulateOfflineCase,
internetChecker: props.internetChecker ? props.internetChecker : internetChecker,
logger,
}

Expand Down
4 changes: 2 additions & 2 deletions demo/src/Bob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ValueTransferRecord } from '@aries-framework/core'
import { DidMarker, Transports } from '@aries-framework/core'
import { TransactionState } from '@sicpa-dlab/value-transfer-protocol-ts'

import { BaseAgent } from './BaseAgent'
import { BaseAgent, doesNotHasInternetChecker } from './BaseAgent'
import { greenText, Output, redText } from './OutputClass'

export class Bob extends BaseAgent {
Expand All @@ -26,7 +26,7 @@ export class Bob extends BaseAgent {
valueTransferConfig: {
party: {},
},
emulateOfflineCase: true,
internetChecker: doesNotHasInternetChecker,
})
}

Expand Down
2 changes: 1 addition & 1 deletion emulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@aries-framework/core": "npm:@sicpa-dlab/aries-framework-core",
"@aries-framework/node": "npm:@sicpa-dlab/aries-framework-node",
"@sicpa-dlab/value-transfer-protocol-ts": "0.2.6",
"@sicpa-dlab/value-transfer-protocol-ts": "0.2.7",
"@stablelib/ed25519": "^1.0.3",
"@influxdata/influxdb-client": "^1.29.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@sicpa-dlab/aries-framework-core",
"main": "build/index",
"types": "build/index",
"version": "0.2.13",
"version": "0.2.15",
"files": [
"build"
],
Expand All @@ -25,7 +25,7 @@
"dependencies": {
"@multiformats/base-x": "^4.0.1",
"@sicpa-dlab/value-transfer-common-ts": "0.2.4",
"@sicpa-dlab/value-transfer-protocol-ts": "0.2.6",
"@sicpa-dlab/value-transfer-protocol-ts": "0.2.7",
"@sicpa-dlab/witness-gossip-protocol-ts": "0.2.5",
"@stablelib/ed25519": "^1.0.2",
"@stablelib/sha256": "^1.0.1",
Expand Down

0 comments on commit dfd6bad

Please sign in to comment.