{"action":"created","comment":{"url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/comments/197122938","pull_request_review_id":130801153,"id":197122938,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzEyMjkzOA==","diff_hunk":"@@ -0,0 +1,185 @@\n+import { expect } from 'chai'\n+import * as nock from 'nock'\n+import { IpfsStorageAgent } from '../ts/ipfs/index'\n+import { DidDocument } from '../ts/identity/didDocument/index'\n+\n+describe('IpfsStorageAgent', () => {\n+\n+  let storageAgent\n+  // tslint:disable-next-line:max-line-length\n+  const testUserPublicKey = '04334f990cdc1281c6fed73dcc6de3db520c075a41ce2b93f36f85dbd5e0dc0b05975c51acb0bec9747fb3f52fd0146d1dc39d6077db0be1bd6579fd66ac144442'\n+  const key = Buffer.from(testUserPublicKey, 'utf8')\n+  const did = new DidDocument().fromPublicKey(key)\n+  const testHash = 'Qm12345'\n+\n+  beforeEach(() => {\n+\n+    storageAgent = new IpfsStorageAgent()\n+    storageAgent.configure({\n+      host: 'localhost',\n+      port: 5001,\n+      protocol: 'http'\n+    })\n+  })\n+\n+  it('should attempt to store the data', async () => {\n+\n+    const pinBoolean = true\n+\n+    nock('http://localhost:5001')\n+    .post(`/api/v0/add?pin=${pinBoolean}`)\n+    .reply(200, {\n+      Name: 'testFile',\n+      Hash: 'Qm12345',\n+      Bytes: '12345',\n+      Size: '12345'\n+    })\n+\n+    const resultingHash = await storageAgent.storeJSON(did, pinBoolean)\n+    .then((result) => {\n+      return result\n+    })\n+    expect(resultingHash).to.equal('Qm12345')\n+  })\n+\n+  it('should throw an error if submitted data is not an object', async () => {\n+\n+    const pinBoolean = true\n+\n+    const testData = 'testData'\n+\n+    nock('http://localhost:5001')\n+    .post(`/api/v0/add?pin=${pinBoolean}`)\n+    .reply(200, {\n+      Name: 'testFile',\n+      Hash: 'Qm12345',\n+      Bytes: '12345',\n+      Size: '12345'\n+    })\n+\n+    try {","path":"tests/ipfs.test.ts","position":60,"original_position":60,"commit_id":"2f83ef74a684d640b68763385313f111a6098f88","original_commit_id":"2f83ef74a684d640b68763385313f111a6098f88","user":{"login":"Exulansis","id":11832807,"node_id":"MDQ6VXNlcjExODMyODA3","avatar_url":"https://avatars0.githubusercontent.com/u/11832807?v=4","gravatar_id":"","url":"https://api.github.com/users/Exulansis","html_url":"https://github.com/Exulansis","followers_url":"https://api.github.com/users/Exulansis/followers","following_url":"https://api.github.com/users/Exulansis/following{/other_user}","gists_url":"https://api.github.com/users/Exulansis/gists{/gist_id}","starred_url":"https://api.github.com/users/Exulansis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exulansis/subscriptions","organizations_url":"https://api.github.com/users/Exulansis/orgs","repos_url":"https://api.github.com/users/Exulansis/repos","events_url":"https://api.github.com/users/Exulansis/events{/privacy}","received_events_url":"https://api.github.com/users/Exulansis/received_events","type":"User","site_admin":false},"body":"Can this be changed to the `expect(...).to.throw('Error Message')`? Not sure how well that behaves with async / await code.","created_at":"2018-06-21T13:00:03Z","updated_at":"2018-06-21T13:06:40Z","html_url":"https://github.com/jolocom/jolocom-lib/pull/95#discussion_r197122938","pull_request_url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/comments/197122938"},"html":{"href":"https://github.com/jolocom/jolocom-lib/pull/95#discussion_r197122938"},"pull_request":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95"}}},"pull_request":{"url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95","id":195154720,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MTU0NzIw","html_url":"https://github.com/jolocom/jolocom-lib/pull/95","diff_url":"https://github.com/jolocom/jolocom-lib/pull/95.diff","patch_url":"https://github.com/jolocom/jolocom-lib/pull/95.patch","issue_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues/95","number":95,"state":"open","locked":false,"title":"IPLD methods & testing","user":{"login":"charleenfei","id":16255463,"node_id":"MDQ6VXNlcjE2MjU1NDYz","avatar_url":"https://avatars0.githubusercontent.com/u/16255463?v=4","gravatar_id":"","url":"https://api.github.com/users/charleenfei","html_url":"https://github.com/charleenfei","followers_url":"https://api.github.com/users/charleenfei/followers","following_url":"https://api.github.com/users/charleenfei/following{/other_user}","gists_url":"https://api.github.com/users/charleenfei/gists{/gist_id}","starred_url":"https://api.github.com/users/charleenfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charleenfei/subscriptions","organizations_url":"https://api.github.com/users/charleenfei/orgs","repos_url":"https://api.github.com/users/charleenfei/repos","events_url":"https://api.github.com/users/charleenfei/events{/privacy}","received_events_url":"https://api.github.com/users/charleenfei/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\nFixes #88 .\r\n\r\n> What does it solve? \r\n\r\nImplements IPLD add and retrieve DAG objects (CBOR encoding) methods & relevant tests.\r\n\r\n> Were there any particular challenges that you faced and/or things that were not straightforward? \r\n\r\n## Checklist\r\n- [x] Keep flags added to the PR up to date\r\n- [x] Make sure the title describes the code well, description should contain `Fixes #number_of_an_issue` and a brief decscription of changes\r\n- [x] Make sure the PR is readable and contains changes only related to a single issue. Otherwise - divide into separate PRs \r\n- [x] Add new tests and make sure all tests are passing\r\n- [x] Make sure all edge cases are taken into account and covered by tests\r\n- [x] Run linter and fix all the errors and warnings","created_at":"2018-06-15T12:03:47Z","updated_at":"2018-06-21T13:06:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a36e6be42365d527a4228fac48f00cffb2f20831","assignee":null,"assignees":[],"requested_reviewers":[{"login":"katszwn","id":4498443,"node_id":"MDQ6VXNlcjQ0OTg0NDM=","avatar_url":"https://avatars0.githubusercontent.com/u/4498443?v=4","gravatar_id":"","url":"https://api.github.com/users/katszwn","html_url":"https://github.com/katszwn","followers_url":"https://api.github.com/users/katszwn/followers","following_url":"https://api.github.com/users/katszwn/following{/other_user}","gists_url":"https://api.github.com/users/katszwn/gists{/gist_id}","starred_url":"https://api.github.com/users/katszwn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katszwn/subscriptions","organizations_url":"https://api.github.com/users/katszwn/orgs","repos_url":"https://api.github.com/users/katszwn/repos","events_url":"https://api.github.com/users/katszwn/events{/privacy}","received_events_url":"https://api.github.com/users/katszwn/received_events","type":"User","site_admin":false},{"login":"nataschaberg","id":25902252,"node_id":"MDQ6VXNlcjI1OTAyMjUy","avatar_url":"https://avatars0.githubusercontent.com/u/25902252?v=4","gravatar_id":"","url":"https://api.github.com/users/nataschaberg","html_url":"https://github.com/nataschaberg","followers_url":"https://api.github.com/users/nataschaberg/followers","following_url":"https://api.github.com/users/nataschaberg/following{/other_user}","gists_url":"https://api.github.com/users/nataschaberg/gists{/gist_id}","starred_url":"https://api.github.com/users/nataschaberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nataschaberg/subscriptions","organizations_url":"https://api.github.com/users/nataschaberg/orgs","repos_url":"https://api.github.com/users/nataschaberg/repos","events_url":"https://api.github.com/users/nataschaberg/events{/privacy}","received_events_url":"https://api.github.com/users/nataschaberg/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":808947111,"node_id":"MDU6TGFiZWw4MDg5NDcxMTE=","url":"https://api.github.com/repos/jolocom/jolocom-lib/labels/new%20feature","name":"new feature","color":"84b6eb","default":false},{"id":812662345,"node_id":"MDU6TGFiZWw4MTI2NjIzNDU=","url":"https://api.github.com/repos/jolocom/jolocom-lib/labels/review","name":"review","color":"56c42f","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95/commits","review_comments_url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95/comments","review_comment_url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues/95/comments","statuses_url":"https://api.github.com/repos/jolocom/jolocom-lib/statuses/2f83ef74a684d640b68763385313f111a6098f88","head":{"label":"jolocom:feature/88-IPLD","ref":"feature/88-IPLD","sha":"2f83ef74a684d640b68763385313f111a6098f88","user":{"login":"jolocom","id":4603324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDMzMjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4603324?v=4","gravatar_id":"","url":"https://api.github.com/users/jolocom","html_url":"https://github.com/jolocom","followers_url":"https://api.github.com/users/jolocom/followers","following_url":"https://api.github.com/users/jolocom/following{/other_user}","gists_url":"https://api.github.com/users/jolocom/gists{/gist_id}","starred_url":"https://api.github.com/users/jolocom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolocom/subscriptions","organizations_url":"https://api.github.com/users/jolocom/orgs","repos_url":"https://api.github.com/users/jolocom/repos","events_url":"https://api.github.com/users/jolocom/events{/privacy}","received_events_url":"https://api.github.com/users/jolocom/received_events","type":"Organization","site_admin":false},"repo":{"id":118003304,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMDMzMDQ=","name":"jolocom-lib","full_name":"jolocom/jolocom-lib","owner":{"login":"jolocom","id":4603324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDMzMjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4603324?v=4","gravatar_id":"","url":"https://api.github.com/users/jolocom","html_url":"https://github.com/jolocom","followers_url":"https://api.github.com/users/jolocom/followers","following_url":"https://api.github.com/users/jolocom/following{/other_user}","gists_url":"https://api.github.com/users/jolocom/gists{/gist_id}","starred_url":"https://api.github.com/users/jolocom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolocom/subscriptions","organizations_url":"https://api.github.com/users/jolocom/orgs","repos_url":"https://api.github.com/users/jolocom/repos","events_url":"https://api.github.com/users/jolocom/events{/privacy}","received_events_url":"https://api.github.com/users/jolocom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jolocom/jolocom-lib","description":"Library for interacting with the identity solution provided by Jolocom.","fork":false,"url":"https://api.github.com/repos/jolocom/jolocom-lib","forks_url":"https://api.github.com/repos/jolocom/jolocom-lib/forks","keys_url":"https://api.github.com/repos/jolocom/jolocom-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jolocom/jolocom-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jolocom/jolocom-lib/teams","hooks_url":"https://api.github.com/repos/jolocom/jolocom-lib/hooks","issue_events_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues/events{/number}","events_url":"https://api.github.com/repos/jolocom/jolocom-lib/events","assignees_url":"https://api.github.com/repos/jolocom/jolocom-lib/assignees{/user}","branches_url":"https://api.github.com/repos/jolocom/jolocom-lib/branches{/branch}","tags_url":"https://api.github.com/repos/jolocom/jolocom-lib/tags","blobs_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jolocom/jolocom-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/jolocom/jolocom-lib/languages","stargazers_url":"https://api.github.com/repos/jolocom/jolocom-lib/stargazers","contributors_url":"https://api.github.com/repos/jolocom/jolocom-lib/contributors","subscribers_url":"https://api.github.com/repos/jolocom/jolocom-lib/subscribers","subscription_url":"https://api.github.com/repos/jolocom/jolocom-lib/subscription","commits_url":"https://api.github.com/repos/jolocom/jolocom-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/jolocom/jolocom-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/jolocom/jolocom-lib/contents/{+path}","compare_url":"https://api.github.com/repos/jolocom/jolocom-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jolocom/jolocom-lib/merges","archive_url":"https://api.github.com/repos/jolocom/jolocom-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jolocom/jolocom-lib/downloads","issues_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues{/number}","pulls_url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/jolocom/jolocom-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/jolocom/jolocom-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jolocom/jolocom-lib/labels{/name}","releases_url":"https://api.github.com/repos/jolocom/jolocom-lib/releases{/id}","deployments_url":"https://api.github.com/repos/jolocom/jolocom-lib/deployments","created_at":"2018-01-18T15:47:48Z","updated_at":"2018-06-21T11:37:15Z","pushed_at":"2018-06-21T12:58:52Z","git_url":"git://github.com/jolocom/jolocom-lib.git","ssh_url":"git@github.com:jolocom/jolocom-lib.git","clone_url":"https://github.com/jolocom/jolocom-lib.git","svn_url":"https://github.com/jolocom/jolocom-lib","homepage":null,"size":545,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":17,"watchers":0,"default_branch":"master"}},"base":{"label":"jolocom:master","ref":"master","sha":"fa9e320fb0940c652bc8e4182d0a0cb597e903d9","user":{"login":"jolocom","id":4603324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDMzMjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4603324?v=4","gravatar_id":"","url":"https://api.github.com/users/jolocom","html_url":"https://github.com/jolocom","followers_url":"https://api.github.com/users/jolocom/followers","following_url":"https://api.github.com/users/jolocom/following{/other_user}","gists_url":"https://api.github.com/users/jolocom/gists{/gist_id}","starred_url":"https://api.github.com/users/jolocom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolocom/subscriptions","organizations_url":"https://api.github.com/users/jolocom/orgs","repos_url":"https://api.github.com/users/jolocom/repos","events_url":"https://api.github.com/users/jolocom/events{/privacy}","received_events_url":"https://api.github.com/users/jolocom/received_events","type":"Organization","site_admin":false},"repo":{"id":118003304,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMDMzMDQ=","name":"jolocom-lib","full_name":"jolocom/jolocom-lib","owner":{"login":"jolocom","id":4603324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDMzMjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4603324?v=4","gravatar_id":"","url":"https://api.github.com/users/jolocom","html_url":"https://github.com/jolocom","followers_url":"https://api.github.com/users/jolocom/followers","following_url":"https://api.github.com/users/jolocom/following{/other_user}","gists_url":"https://api.github.com/users/jolocom/gists{/gist_id}","starred_url":"https://api.github.com/users/jolocom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolocom/subscriptions","organizations_url":"https://api.github.com/users/jolocom/orgs","repos_url":"https://api.github.com/users/jolocom/repos","events_url":"https://api.github.com/users/jolocom/events{/privacy}","received_events_url":"https://api.github.com/users/jolocom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jolocom/jolocom-lib","description":"Library for interacting with the identity solution provided by Jolocom.","fork":false,"url":"https://api.github.com/repos/jolocom/jolocom-lib","forks_url":"https://api.github.com/repos/jolocom/jolocom-lib/forks","keys_url":"https://api.github.com/repos/jolocom/jolocom-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jolocom/jolocom-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jolocom/jolocom-lib/teams","hooks_url":"https://api.github.com/repos/jolocom/jolocom-lib/hooks","issue_events_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues/events{/number}","events_url":"https://api.github.com/repos/jolocom/jolocom-lib/events","assignees_url":"https://api.github.com/repos/jolocom/jolocom-lib/assignees{/user}","branches_url":"https://api.github.com/repos/jolocom/jolocom-lib/branches{/branch}","tags_url":"https://api.github.com/repos/jolocom/jolocom-lib/tags","blobs_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jolocom/jolocom-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/jolocom/jolocom-lib/languages","stargazers_url":"https://api.github.com/repos/jolocom/jolocom-lib/stargazers","contributors_url":"https://api.github.com/repos/jolocom/jolocom-lib/contributors","subscribers_url":"https://api.github.com/repos/jolocom/jolocom-lib/subscribers","subscription_url":"https://api.github.com/repos/jolocom/jolocom-lib/subscription","commits_url":"https://api.github.com/repos/jolocom/jolocom-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/jolocom/jolocom-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/jolocom/jolocom-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/jolocom/jolocom-lib/contents/{+path}","compare_url":"https://api.github.com/repos/jolocom/jolocom-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jolocom/jolocom-lib/merges","archive_url":"https://api.github.com/repos/jolocom/jolocom-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jolocom/jolocom-lib/downloads","issues_url":"https://api.github.com/repos/jolocom/jolocom-lib/issues{/number}","pulls_url":"https://api.github.com/repos/jolocom/jolocom-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/jolocom/jolocom-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/jolocom/jolocom-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jolocom/jolocom-lib/labels{/name}","releases_url":"https://api.github.com/repos/jolocom/jolocom-lib/releases{/id}","deployments_url":"https://api.github.com/repos/jolocom/jolocom-lib/deployments","created_at":"2018-01-18T15:47:48Z","updated_at":"2018-06-21T11:37:15Z","pushed_at":"2018-06-21T12:58:52Z","git_url":"git://github.com/jolocom/jolocom-lib.git","ssh_url":"git@github.com:jolocom/jolocom-lib.git","clone_url":"https://github.com/jolocom/jolocom-lib.git","svn_url":"https://github.com/jolocom/jolocom-lib","homepage":null,"size":545,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":17,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95"},"html":{"href":"https://github.com/jolocom/jolocom-lib/pull/95"},"issue":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/issues/95"},"comments":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/jolocom/jolocom-lib/statuses/2f83ef74a684d640b68763385313f111a6098f88"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Exulansis"}}