Skip to content

Anchor version 0.25.0 gives error with lifetime specifier #70

@anoushk1234

Description

@anoushk1234

Cargo.toml

[dependencies]
anchor-lang = "0.25.0"
switchboard-v2 = "0.1.16"

lib.rs

pub fn initialize(ctx: Context<GetResult>) -> Result<()> {
        let aggregator = &ctx.accounts.aggregator_feed;
        let val: u64 = AggregatorAccountData::new(aggregator)?
            .get_result()?
            .try_into()?;
        Ok(())
    }

AggregatorAccountData::new(aggregator) throws an error saying

lifetime may not live long enough
argument requires that `'1` must outlive `'2`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions