Abi cannot be generated when the script function name is different from the file name
When multiple functions exist in one file, all function ABI content is the ABI content of the function with the same file name.
To reproduce
build generate ABI
# move build --abi
sample code
filename: run_hello.move, function: main
// scripts/run_hello.move
script {
use std::debug;
fun main() {
debug::print<u8>(&10);
}
}
Stack trace/error message
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', language/move-prover/move-abigen/src/abigen.rs:238:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected Behavior
Generate ABI file successfully, path: build/hello_world/abis/main.abi
Reason
Wrong way to get function bytecode by script file name, the script function bytecode should be obtained using the module name.
🐛 Bug
Description
To reproduce
build generate ABI
sample code filename: run_hello.move, function: main
Stack trace/error message
Expected Behavior
Generate ABI file successfully, path:
build/hello_world/abis/main.abi
Reason
Wrong way to get function bytecode by script file name, the script function bytecode should be obtained using the module name.
Error code segment
Fix suggestion