From 5295334a6c3d481b19e6fad8f039951d2e41d693 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 26 Oct 2017 15:06:00 +0200 Subject: [PATCH] Issue #202: Make sure the ipfs mock repo/stat endpoint behaves like ipfs This should fix tests. License: MIT Signed-off-by: Hector Sanjuan --- test/ipfs_mock.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/ipfs_mock.go b/test/ipfs_mock.go index 4ac2d9163..d65fa8ef8 100644 --- a/test/ipfs_mock.go +++ b/test/ipfs_mock.go @@ -46,8 +46,9 @@ type mockIDResp struct { } type mockRepoStatResp struct { - RepoSize int - RepoCount int + RepoSize uint64 + NumObjects uint64 + StorageMax uint64 } type mockConfigResp struct { @@ -201,8 +202,9 @@ func (m *IpfsMock) handler(w http.ResponseWriter, r *http.Request) { case "repo/stat": len := len(m.pinMap.List()) resp := mockRepoStatResp{ - RepoSize: len * 1000, - RepoCount: len, + RepoSize: uint64(len) * 1000, + NumObjects: uint64(len), + StorageMax: 10000000000, //10 GB } j, _ := json.Marshal(resp) w.Write(j)