-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Conversation
libraries/chain/wasm_interface.cpp
Outdated
@@ -987,6 +987,13 @@ class authorization_api : public context_aware_api { | |||
return context.is_account( account ); | |||
} | |||
|
|||
void get_code_version( const account_name& account, int64_t& last_code_update_time, fc::sha256& code_hash ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intrinsics with multiple output parameters have very strange semantics when the pointers alias. I would strongly recommend either using a packed struct or splitting this into two intrinsics.
using namespace eosio; | ||
|
||
void code_version_test::reqversion( name name, checksum256 version ) { | ||
check( get_code_version(name) == version, "code version not match" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is not grammatically correct.
} | ||
|
||
void code_version_test::reqtime( name name, time_point last_code_update ) { | ||
check( get_code_last_update_time(name) == last_code_update, "last update time not match" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
|
||
#include <eosio/eosio.hpp> | ||
|
||
namespace eosio { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better not to put this stuff in namespace eosio, as that causes a headache when cdt is eventually updated.
Change Description
Fix #6168.
Consensus Changes
Consensus upgrade.
API Changes
New intrinsic API
get_code_version
is introduced by this PR.Documentation Additions
The documentation of eosio.cdt needs to include
get_code_version
.