未验证 提交 1038ab36 编写于 作者: W wanderingbort 提交者: GitHub

Merge pull request #2316 from taokayan/accept_wasm

fix 2189 prioritize .wasm files over .wast files
......@@ -829,14 +829,15 @@ int main( int argc, char** argv ) {
add_standard_transaction_options(contractSubcommand, "account@active");
contractSubcommand->set_callback([&] {
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.empty() )
{
wastPath = (cpath / (cpath.filename().generic_string()+".wast")).generic_string();
wastPath = (cpath / (cpath.filename().generic_string()+".wasm")).generic_string();
if (!fc::exists(wastPath))
wastPath = (cpath / (cpath.filename().generic_string()+".wast")).generic_string();
}
if( abiPath.empty() )
......@@ -844,7 +845,7 @@ int main( int argc, char** argv ) {
abiPath = (cpath / (cpath.filename().generic_string()+".abi")).generic_string();
}
std::cout << localized(("Reading WAST/WASM from " + wastPath + "...").c_str()) << std::endl;
fc::read_file_contents(wastPath, wast);
FC_ASSERT( !wast.empty(), "no wast file found ${f}", ("f", wastPath) );
vector<uint8_t> wasm;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册