Skip to content

Commit 7ce3573

Browse files
committed
Match host function returning -2 for non-existent sync call entry point
1 parent 6bfccfd commit 7ce3573

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libraries/eosiolib/contracts/eosio/call.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ namespace eosio {
100100
uint64_t flags = read_only ? 0x01 : 0x00; // last bit indicating read only
101101
auto retval = internal_use_do_not_use::call(receiver.value, flags, data.data(), data.size());
102102

103-
if (retval == -1) { // sync call is not supported by the receiver contract
103+
if (retval == -2) { // sync call is not supported by the receiver contract
104104
check(no_op_if_receiver_not_support_sync_call, "receiver does not support sync call but no_op_if_receiver_not_support_sync_call flag is not set");
105105
}
106106
return retval;

tests/unit/test_contracts/call_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class [[eosio::contract]] call_tests : public eosio::contract{
1111
std::vector<char> data{};
1212

1313
// For now, because sync_call entry point has not been implemented yet and
14-
// no_op_if_receiver_no_support_sync_call is set to true, call should return -1
14+
// no_op_if_receiver_no_support_sync_call is set to true, call should return -2
1515
auto rc = eosio::call("calltests"_n, data, false /* read_only */, true /* no_op_if_receiver_no_support_sync_call */)();
16-
eosio::check(rc == -1, "call did not return -1");
16+
eosio::check(rc == -2, "call did not return -2");
1717

1818
// call was not executed. return value size should be 0
1919
std::vector<char> value(10);

0 commit comments

Comments
 (0)