Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bobdos
committed
May 29, 2018
1 parent
4b3bd25
commit d0d1630
Showing
2 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,53 @@ | ||
local steem = require("steem-corona-sdk.steem-corona") | ||
local json = require("json") | ||
|
||
local account_array = {"steemsdk.test"} | ||
|
||
--[[ test case: get_config ]] | ||
steem.get_config( | ||
function(event) | ||
if event.isError then | ||
print( "Network error: ", event.response ) | ||
else | ||
print("response: "..event.response) | ||
end | ||
end) | ||
end | ||
) | ||
|
||
--[[ test case: get_version ]] | ||
steem.get_version( | ||
function(event) | ||
if event.isError then | ||
print( "Network error: ", event.response ) | ||
else | ||
print("response: "..event.response) | ||
end | ||
end) | ||
end | ||
) | ||
|
||
steem.get_account_count(function(event) | ||
--[[ test case: get_account_count ]] | ||
steem.get_account_count( | ||
function(event) | ||
if event.isError then | ||
print( "Network error: ", event.response ) | ||
else | ||
print("response: "..event.response) | ||
end | ||
end) | ||
end | ||
) | ||
|
||
--[[ test case: get_accounts ]] | ||
steem.get_accounts( | ||
account_array, | ||
function(event) | ||
if event.isError then | ||
print( "Network error: ", event.response ) | ||
else | ||
print("response: "..json.prettify(event.response)) | ||
local decoded_response = json.decode(event.response) | ||
print("id: "..decoded_response[1]["id"].."\n".. | ||
"name: "..decoded_response[1]["name"]) | ||
end | ||
end | ||
) | ||
|