Skip to content
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

Error while subscribing transfer event #761

Closed
shanithkk opened this issue Apr 15, 2024 · 8 comments
Closed

Error while subscribing transfer event #761

shanithkk opened this issue Apr 15, 2024 · 8 comments
Assignees

Comments

@shanithkk
Copy link
Contributor

Description

When trying to subscribe the transfer events from rococo local chain, getting deserialise error

Codec(Error { cause: Some(Error { cause: None, desc: "Could not decode `RuntimeEvent`, variant doesn't exist" }), desc: "Could not decode `EventRecord::event`" })

Code Examle

 let event_records = subscription
            .next_events::<RuntimeEvent, Hash>()
            .await
            .unwrap()
            .unwrap();
        for event_record in &event_records {
            println!("decoded: {:?} {:?}", event_record.phase, event_record.event);
            match &event_record.event {
                RuntimeEvent::Balances(balances_event) => {
                    println!(">>>>>>>>>> balances event: {:?}", balances_event);
                    match &balances_event {
                        pallet_balances::Event::Transfer { from, to, amount } => {
                            println!("Transactor: {:?}", from);
                            println!("Destination: {:?}", to);
                            println!("Value: {:?}", amount);
                            // return;
                        }
                        _ => {
                            debug!("ignoring unsupported balances event");
                        }
                    }
                }
                RuntimeEvent::System(system_event) => {
                    println!(">>>>>>>>>> system event: {:?}", system_event);
                    match &system_event {
                        frame_system::Event::ExtrinsicSuccess { dispatch_info } => {
                            println!("DispatchInfo: {:?}", dispatch_info);
                            // return;
                        }
                        _ => {
                            debug!("ignoring unsupported system event");
                        }
                    }
                }
                _ => debug!(
                    "ignoring unsupported module event: {:?}",
                    event_record.event
                ),
            }
        }

Running chain

docker run -p 9944:9944 parity/polkadot:latest --dev  --rpc-external
@Niederb Niederb self-assigned this Apr 16, 2024
@Niederb
Copy link
Contributor

Niederb commented Apr 16, 2024

I tried to reproduce your issue, but so far without success. Can you try the following:

  • We use a different docker image for our tests: paritypr/substrate:latest. Can you try with this one?
  • Can you try to pull a fresh version of parity/polkadot:latest? Docker does not pull a new version if you have already one on your system
  • Can you specify which image/version you are using exactly?

@shanithkk
Copy link
Contributor Author

@Niederb sure, i will try these images, i tried latest version of polkadot image. i will update and try it again and get back to you, Thank you

@Niederb
Copy link
Contributor

Niederb commented May 13, 2024

@shanithkk Does it work with the other images? Then I would close this issue

@shanithkk
Copy link
Contributor Author

shanithkk commented May 13, 2024

@Niederb still i'm getting error while using parity/polkadot latest image

image

@shanithkk
Copy link
Contributor Author

@Niederb tested with provided image "paritypr/substrate:latest". works fine for me but parity/polkadot image is not working as expected

@Niederb
Copy link
Contributor

Niederb commented May 16, 2024

Glad to hear that it works with paritypr/substrate:latest. Do you know what kind of event causes the crash?

@Niederb
Copy link
Contributor

Niederb commented Sep 2, 2024

@shanithkk Is this still a problem for you? Otherwise I will close this issue

@Niederb
Copy link
Contributor

Niederb commented Sep 19, 2024

This issue should be fixed with #802, therefore I close this

@Niederb Niederb closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants