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

solana-remote-wallet does not intialize app version correctly #4218

Open
cavemanloverboy opened this issue Dec 28, 2024 · 2 comments
Open

solana-remote-wallet does not intialize app version correctly #4218

cavemanloverboy opened this issue Dec 28, 2024 · 2 comments

Comments

@cavemanloverboy
Copy link

cavemanloverboy commented Dec 28, 2024

    pub fn new(device: hidapi::HidDevice) -> Self {
        Self {
            device,
            pretty_path: String::default(),
            version: FirmwareVersion::new(0, 0, 0),
        }
    }

is problematic due to the use of

    fn outdated_app(&self) -> bool {
        self.version < DEPRECATE_VERSION_BEFORE
    }

in determining which logic to use. Presently, sign_message does not work with message above the chunk size of 255 on 1.4.1 because the logic for oudated_app is used.

This problem can be fixed by calling get_configuration_vector and reading the last 3 bytes, or get_firmware_version

@cavemanloverboy
Copy link
Author

cavemanloverboy commented Dec 28, 2024

Unclear if we want to break api to fix or introduce new_with_version which returns a Result:

pub fn new_with_version(device: hidapi::HidDevice) -> Result<Self, RemoteWalletError> {
    let mut slf = Self {
        device,
        pretty_path: String::default(),
        version: FirmwareVersion::new(0, 0, 0),
    };
    slf.version = slf.get_firmware_version()?;
    Ok(slf)
}

@cavemanloverboy
Copy link
Author

let me know which way you want to go, western man

@anza-xyz anza-xyz deleted a comment Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@cavemanloverboy and others