{"action":"created","comment":{"url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/comments/194266814","pull_request_review_id":127406404,"id":194266814,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDI2NjgxNA==","diff_hunk":"@@ -156,48 +187,78 @@ public void onError(final Exception e) {\n                     @Override\n                     public void run() {\n                         if (e instanceof AccountNotFoundException) {\n-                            callback.onResponse(0);\n+                            callback.onResponse(balance.getValue());\n                         } else {\n                             callback.onFailure(e);\n                         }\n                     }\n                 });\n-                Log.d(TAG, \"getCurrentBalance onError: \" + e.getMessage());\n+                Log.d(TAG, \"getBalance onError: \" + e.getMessage());\n             }\n         });\n     }\n \n-    private void setBalance(int balanceValue) {\n-        balance.setValue(balanceValue);\n-        local.setBalance(balanceValue);\n+    @VisibleForTesting\n+    void setBalance(final Balance balanceObj) {\n+        BalanceUpdate balanceUpdate = balance.getValue();\n+        // if the values are not equals so we need to update,\n+        // no need to update for equal values.\n+        if (balanceUpdate.getAmount().compareTo(balanceObj.value()) != 0) {\n+            Log.d(TAG, \"setBalance: Balance changed, should get update\");","path":"kin-ecosystem-sdk/src/main/java/com/kin/ecosystem/data/blockchain/BlockchainSourceImpl.java","position":185,"original_position":185,"commit_id":"e684caab5251526685d6298a1ef3d170d73c9bbd","original_commit_id":"e684caab5251526685d6298a1ef3d170d73c9bbd","user":{"login":"yosriz","id":1626032,"node_id":"MDQ6VXNlcjE2MjYwMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/1626032?v=4","gravatar_id":"","url":"https://api.github.com/users/yosriz","html_url":"https://github.com/yosriz","followers_url":"https://api.github.com/users/yosriz/followers","following_url":"https://api.github.com/users/yosriz/following{/other_user}","gists_url":"https://api.github.com/users/yosriz/gists{/gist_id}","starred_url":"https://api.github.com/users/yosriz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosriz/subscriptions","organizations_url":"https://api.github.com/users/yosriz/orgs","repos_url":"https://api.github.com/users/yosriz/repos","events_url":"https://api.github.com/users/yosriz/events{/privacy}","received_events_url":"https://api.github.com/users/yosriz/received_events","type":"User","site_admin":false},"body":"should remove logs on release builds. (check for BuildConfig.DEBUG, enable for specific log tag)","created_at":"2018-06-10T18:58:52Z","updated_at":"2018-06-10T18:58:52Z","html_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk/pull/82#discussion_r194266814","pull_request_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/comments/194266814"},"html":{"href":"https://github.com/kinecosystem/kin-ecosystem-android-sdk/pull/82#discussion_r194266814"},"pull_request":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82","id":193245032,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMjQ1MDMy","html_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk/pull/82","diff_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk/pull/82.diff","patch_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk/pull/82.patch","issue_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/82","number":82,"state":"open","locked":false,"title":"Eco 372/add balance observable api","user":{"login":"OrenZak","id":8303735,"node_id":"MDQ6VXNlcjgzMDM3MzU=","avatar_url":"https://avatars2.githubusercontent.com/u/8303735?v=4","gravatar_id":"","url":"https://api.github.com/users/OrenZak","html_url":"https://github.com/OrenZak","followers_url":"https://api.github.com/users/OrenZak/followers","following_url":"https://api.github.com/users/OrenZak/following{/other_user}","gists_url":"https://api.github.com/users/OrenZak/gists{/gist_id}","starred_url":"https://api.github.com/users/OrenZak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrenZak/subscriptions","organizations_url":"https://api.github.com/users/OrenZak/orgs","repos_url":"https://api.github.com/users/OrenZak/repos","events_url":"https://api.github.com/users/OrenZak/events{/privacy}","received_events_url":"https://api.github.com/users/OrenZak/received_events","type":"User","site_admin":false},"body":"- Added `addBalanceObserver(@NonNull final Observer<BalanceUpdate> observer)`\r\n- Added `removeBalanceObserver(@NonNull final Observer<BalanceUpdate> observer)`\r\n - Changed all the balance returns to be `BalanceUpdate`, thus `Kin.getCachedBalance` returns `BalanceUpdate` now.\r\n- Added tests for `BlockchainSourceImpl`\r\n- Added code sample to the sample app for all these changes\r\n","created_at":"2018-06-07T08:44:36Z","updated_at":"2018-06-10T18:58:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce194908f91b30b99dda59604c5f23b841332c53","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82/commits","review_comments_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82/comments","review_comment_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/82/comments","statuses_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/statuses/e684caab5251526685d6298a1ef3d170d73c9bbd","head":{"label":"kinecosystem:ECO-372/add_balance_observable_api","ref":"ECO-372/add_balance_observable_api","sha":"e684caab5251526685d6298a1ef3d170d73c9bbd","user":{"login":"kinecosystem","id":28860603,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODYwNjAz","avatar_url":"https://avatars2.githubusercontent.com/u/28860603?v=4","gravatar_id":"","url":"https://api.github.com/users/kinecosystem","html_url":"https://github.com/kinecosystem","followers_url":"https://api.github.com/users/kinecosystem/followers","following_url":"https://api.github.com/users/kinecosystem/following{/other_user}","gists_url":"https://api.github.com/users/kinecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/kinecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinecosystem/subscriptions","organizations_url":"https://api.github.com/users/kinecosystem/orgs","repos_url":"https://api.github.com/users/kinecosystem/repos","events_url":"https://api.github.com/users/kinecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/kinecosystem/received_events","type":"Organization","site_admin":false},"repo":{"id":120272671,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAyNzI2NzE=","name":"kin-ecosystem-android-sdk","full_name":"kinecosystem/kin-ecosystem-android-sdk","owner":{"login":"kinecosystem","id":28860603,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODYwNjAz","avatar_url":"https://avatars2.githubusercontent.com/u/28860603?v=4","gravatar_id":"","url":"https://api.github.com/users/kinecosystem","html_url":"https://github.com/kinecosystem","followers_url":"https://api.github.com/users/kinecosystem/followers","following_url":"https://api.github.com/users/kinecosystem/following{/other_user}","gists_url":"https://api.github.com/users/kinecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/kinecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinecosystem/subscriptions","organizations_url":"https://api.github.com/users/kinecosystem/orgs","repos_url":"https://api.github.com/users/kinecosystem/repos","events_url":"https://api.github.com/users/kinecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/kinecosystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk","description":"Add Kin ecosystem sdk to enable earn and spend opportunities in your app.","fork":false,"url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk","forks_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/forks","keys_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/teams","hooks_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/events","assignees_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/tags","blobs_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/languages","stargazers_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/subscription","commits_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/merges","archive_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/downloads","issues_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/deployments","created_at":"2018-02-05T07:56:03Z","updated_at":"2018-06-09T06:52:03Z","pushed_at":"2018-06-10T09:15:16Z","git_url":"git://github.com/kinecosystem/kin-ecosystem-android-sdk.git","ssh_url":"git@github.com:kinecosystem/kin-ecosystem-android-sdk.git","clone_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk.git","svn_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk","homepage":"","size":1652,"stargazers_count":6,"watchers_count":6,"language":"Java","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":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":3,"watchers":6,"default_branch":"dev"}},"base":{"label":"kinecosystem:dev","ref":"dev","sha":"74d0dda93d576d6f154b29bd1f88473a01c8082b","user":{"login":"kinecosystem","id":28860603,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODYwNjAz","avatar_url":"https://avatars2.githubusercontent.com/u/28860603?v=4","gravatar_id":"","url":"https://api.github.com/users/kinecosystem","html_url":"https://github.com/kinecosystem","followers_url":"https://api.github.com/users/kinecosystem/followers","following_url":"https://api.github.com/users/kinecosystem/following{/other_user}","gists_url":"https://api.github.com/users/kinecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/kinecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinecosystem/subscriptions","organizations_url":"https://api.github.com/users/kinecosystem/orgs","repos_url":"https://api.github.com/users/kinecosystem/repos","events_url":"https://api.github.com/users/kinecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/kinecosystem/received_events","type":"Organization","site_admin":false},"repo":{"id":120272671,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAyNzI2NzE=","name":"kin-ecosystem-android-sdk","full_name":"kinecosystem/kin-ecosystem-android-sdk","owner":{"login":"kinecosystem","id":28860603,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODYwNjAz","avatar_url":"https://avatars2.githubusercontent.com/u/28860603?v=4","gravatar_id":"","url":"https://api.github.com/users/kinecosystem","html_url":"https://github.com/kinecosystem","followers_url":"https://api.github.com/users/kinecosystem/followers","following_url":"https://api.github.com/users/kinecosystem/following{/other_user}","gists_url":"https://api.github.com/users/kinecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/kinecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinecosystem/subscriptions","organizations_url":"https://api.github.com/users/kinecosystem/orgs","repos_url":"https://api.github.com/users/kinecosystem/repos","events_url":"https://api.github.com/users/kinecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/kinecosystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk","description":"Add Kin ecosystem sdk to enable earn and spend opportunities in your app.","fork":false,"url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk","forks_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/forks","keys_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/teams","hooks_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/events","assignees_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/tags","blobs_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/languages","stargazers_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/subscription","commits_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/merges","archive_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/downloads","issues_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/deployments","created_at":"2018-02-05T07:56:03Z","updated_at":"2018-06-09T06:52:03Z","pushed_at":"2018-06-10T09:15:16Z","git_url":"git://github.com/kinecosystem/kin-ecosystem-android-sdk.git","ssh_url":"git@github.com:kinecosystem/kin-ecosystem-android-sdk.git","clone_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk.git","svn_url":"https://github.com/kinecosystem/kin-ecosystem-android-sdk","homepage":"","size":1652,"stargazers_count":6,"watchers_count":6,"language":"Java","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":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":3,"watchers":6,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82"},"html":{"href":"https://github.com/kinecosystem/kin-ecosystem-android-sdk/pull/82"},"issue":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/82"},"comments":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/kinecosystem/kin-ecosystem-android-sdk/statuses/e684caab5251526685d6298a1ef3d170d73c9bbd"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"yosriz"}}