-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve message when generating from corrupted scale file #740
Comments
Hi! Manged to reproduce this issue in the following way # 1. Trim the polkadot.scale artifact
dd if=./artifacts/polkadot_metadata.scale of=./artifacts/polkadot_metadata_tmp.scale bs=1 skip=25 count=73
# 2. Run codegen against the incompatible file
cargo run --release -p subxt-cli -- codegen --file artifacts/polkadot_metadata_tmp.scale
Finished release [optimized] target(s) in 3.11s
Running `target/release/subxt codegen --file artifacts/polkadot_metadata_tmp.scale`
The application panicked (crashed).
Message: proc-macro-error API cannot be used outside of `entry_point` invocation, perhaps you forgot to annotate your #[proc_macro] function with `#[proc_macro_error]
Location: /home/lexnv/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:483
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets |
Sounds like a bug to me; I'd hope that we can do better here! |
and I found root cause. I used AcalaNetwork/chopsticks#80 to generate metadata. it starts not as Metadata, but with prefix VersionMetadata. may be there is another issue with that subxt could support versioned prefix too (feature, not bug so) |
Hopefully #841 resolves the original issue; now instead of a panic you should get back a slightly nicer error message at least. |
It is very unclear what happens here:
The text was updated successfully, but these errors were encountered: