Skip to content

Commit

Permalink
Updated API smoke tests to match new find smt contributions prototype #…
Browse files Browse the repository at this point in the history
  • Loading branch information
sgerbino committed Nov 29, 2018
1 parent 5e886a8 commit 87ad1fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libraries/plugins/apis/database_api/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ DEFINE_API_IMPL( database_api_impl, find_smt_contributions )

const auto& idx = _db.get_index< chain::smt_contribution_index, chain::by_symbol_contributor >();

for( auto& symbol_contributor : args.symbol_contributor )
for( auto& symbol_contributor : args.symbol_contributors )
{
auto itr = idx.lower_bound( boost::make_tuple( symbol_contributor.first, symbol_contributor.second, 0 ) );
while( itr != idx.end() && itr->symbol == symbol_contributor.first && itr->contributor == symbol_contributor.second && result.contributions.size() <= DATABASE_API_SINGLE_QUERY_LIMIT )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ struct list_smt_contributions_return

struct find_smt_contributions_args
{
vector< std::pair< asset_symbol_type, account_name_type > > symbol_contributor;
vector< std::pair< asset_symbol_type, account_name_type > > symbol_contributors;
};

typedef list_smt_contributions_return find_smt_contributions_return;
Expand Down Expand Up @@ -757,7 +757,7 @@ FC_REFLECT( steem::plugins::database_api::list_smt_contributions_return,
(contributions) )

FC_REFLECT( steem::plugins::database_api::find_smt_contributions_args,
(symbol_contributor) )
(symbol_contributors) )

FC_REFLECT( steem::plugins::database_api::list_smt_tokens_return,
(tokens) )
Expand Down
6 changes: 3 additions & 3 deletions tests/scripts/api_error_smoketest.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,12 @@
"params": {"asset_symbol": {"nai":"@@100000006", "decimals": 3}}
}
{
"method": "database_api.list_smt_contribution",
"method": "database_api.list_smt_contributions",
"params": {"limit": 100, "order": "by_symbol_contributor", "start": []}
},
{
"method": "database_api.find_smt_contribution",
"params": {"asset_symbol": {"nai":"@@100000006", "decimals": 3}, "account": "temp"}
"method": "database_api.find_smt_contributions",
"params": {"symbol_contributor": [["asset_symbol": {"nai":"@@100000006", "decimals": 3}, "account": "temp"]] }
}
]

Expand Down

0 comments on commit 87ad1fb

Please sign in to comment.