未验证 提交 65fb77ea 编写于 作者: G Greg Lee 提交者: GitHub

Merge pull request #2135 from larryk85/enhancement/general_user_experience

Enhancement: Better error message for set contract in cleos
......@@ -823,20 +823,22 @@ int main( int argc, char** argv ) {
std::string wast;
std::cout << localized("Reading WAST...") << std::endl;
fc::path cpath(contractPath);
if( cpath.filename().generic_string() == "." ) cpath = cpath.parent_path();
if( wastPath == string() )
if( wastPath.empty() )
{
wastPath = (cpath / (cpath.filename().generic_string()+".wast")).generic_string();
}
if( abiPath == string() )
if( abiPath.empty() )
{
abiPath = (cpath / (cpath.filename().generic_string()+".abi")).generic_string();
}
fc::read_file_contents(wastPath, wast);
FC_ASSERT( !wast.empty(), "no wast file found ${f}", ("f", wastPath) );
vector<uint8_t> wasm;
const string binary_wasm_header("\x00\x61\x73\x6d", 4);
if(wast.compare(0, 4, binary_wasm_header) == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册