diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index 8aeeda06..efdf75f3 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -755,7 +755,7 @@ void database_fixture::force_settle( const account_object& who, asset what ) verify_asset_supplies(db); } FC_CAPTURE_AND_RETHROW( (who)(what) ) } -void database_fixture::borrow(const account_object& who, asset what, asset collateral) +const call_order_object* database_fixture::borrow(const account_object& who, asset what, asset collateral) { try { trx.set_expiration(db.head_block_time() + fc::minutes(1)); trx.operations.clear(); @@ -769,6 +769,14 @@ void database_fixture::borrow(const account_object& who, asset what, asset coll db.push_transaction(trx, ~0); trx.operations.clear(); verify_asset_supplies(db); + + auto& call_idx = db.get_index_type().indices().get(); + auto itr = call_idx.find( boost::make_tuple(who.id, what.asset_id) ); + const call_order_object* call_obj = nullptr; + + if( itr != call_idx.end() ) + call_obj = &*itr; + return call_obj; } FC_CAPTURE_AND_RETHROW( (who.name)(what)(collateral) ) } void database_fixture::cover(const account_object& who, asset what, asset collateral) diff --git a/tests/common/database_fixture.hpp b/tests/common/database_fixture.hpp index 328a3be6..e0a643f9 100644 --- a/tests/common/database_fixture.hpp +++ b/tests/common/database_fixture.hpp @@ -198,9 +198,9 @@ struct database_fixture { void publish_feed(asset_id_type mia, account_id_type by, const price_feed& f) { publish_feed(mia(db), by(db), f); } void publish_feed(const asset_object& mia, const account_object& by, const price_feed& f); - void borrow(account_id_type who, asset what, asset collateral) - { borrow(who(db), what, collateral); } - void borrow(const account_object& who, asset what, asset collateral); + const call_order_object* borrow(account_id_type who, asset what, asset collateral) + { return borrow(who(db), what, collateral); } + const call_order_object* borrow(const account_object& who, asset what, asset collateral); void cover(account_id_type who, asset what, asset collateral_freed) { cover(who(db), what, collateral_freed); } void cover(const account_object& who, asset what, asset collateral_freed);