• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blockexchange / blockexchange / 13110168475

03 Feb 2025 09:18AM UTC coverage: 48.213% (+0.6%) from 47.564%
13110168475

push

github

BuckarooBanzay
http/json overhaul

51 of 102 new or added lines in 14 files covered. (50.0%)

1 existing line in 1 file now uncovered.

985 of 2043 relevant lines covered (48.21%)

1734.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/api/token.lua
1
---------
2
-- token api calls
3

4
local http, url = ...
1✔
5

6
--- exchanges an acces_token with a jwt token (for authorized http calls)
7
-- @param name the username
8
-- @param access_token the access code of the token (used in "/bx_login <username> <access_token>")
9
-- @return a promise with the result
10
function blockexchange.api.get_token(name, access_token)
2✔
11
  return Promise.http(http, url .. "/api/token", {
2✔
12
    extra_headers = { "Content-Type: application/json" },
1✔
13
    method = "POST",
14
    data = minetest.write_json({
2✔
15
      name = name,
1✔
16
      access_token = access_token
1✔
17
    })
1✔
18
  }):next(function(res)
1✔
19
    if res.code == 200 then
1✔
20
      return res:text()
1✔
21
    else
NEW
22
      return Promise.rejected("unexpected http code: " .. res.code)
×
23
    end
24
  end)
25
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc