Skip to main content
Became Hot Network Question
added 95 characters in body
Source Link
Russo
  • 653
  • 6
  • 10

In Pinocchio 0.10.1, Rent::get()?.minimum_balance(DATA_LEN) has been deprecated.

So I am trying to use the Rent::try_minimum_balance()

  let rent = Rent::from_account_view(my_mint_accountmy_account)?;// fails to run at 
//unlikely(account_view.address() != &RENT_ID) inside the from_account_view().
//What is RENT_ID?

  let rent = Rent::from_bytes(accountmy_account.borrow_unchecked())?;
  // causes the lamports below to be 0 
  let lamports = Rent::try_minimum_balance(&rent, Mint22::BASE_LEN)?;

How to make rent from a given account ?

And what if such my_account does not exist yet?

Docs: https://docs.rs/pinocchio/latest/pinocchio/sysvars/rent/struct.Rent.html

In Pinocchio 0.10.1, Rent::get()?.minimum_balance(DATA_LEN) has been deprecated.

So I am trying to use the Rent::try_minimum_balance()

  let rent = Rent::from_account_view(my_mint_account)?;// fails to run at 
//unlikely(account_view.address() != &RENT_ID) inside the from_account_view().
//What is RENT_ID?

  let rent = Rent::from_bytes(account.borrow_unchecked())?;
  // causes the lamports below to be 0 
  let lamports = Rent::try_minimum_balance(&rent, Mint22::BASE_LEN)?;

Docs: https://docs.rs/pinocchio/latest/pinocchio/sysvars/rent/struct.Rent.html

In Pinocchio 0.10.1, Rent::get()?.minimum_balance(DATA_LEN) has been deprecated.

So I am trying to use the Rent::try_minimum_balance()

  let rent = Rent::from_account_view(my_account)?;// fails to run at 
//unlikely(account_view.address() != &RENT_ID) inside the from_account_view().
//What is RENT_ID?

  let rent = Rent::from_bytes(my_account.borrow_unchecked())?;
  // causes the lamports below to be 0 
  let lamports = Rent::try_minimum_balance(&rent, Mint22::BASE_LEN)?;

How to make rent from a given account ?

And what if such my_account does not exist yet?

Docs: https://docs.rs/pinocchio/latest/pinocchio/sysvars/rent/struct.Rent.html

added 82 characters in body
Source Link
Russo
  • 653
  • 6
  • 10

In Pinocchio 0.10.1, Rent::get()?.minimum_balance(DATA_LEN) has been deprecated.

So I am trying to use the Rent::try_minimum_balance()

  let rent = Rent::from_account_view(my_mint_account)?;// fails to run at 
//unlikely(account_view.address() != &RENT_ID) inside the from_account_view().
//What is RENT_ID?

  let rent = Rent::from_bytes(account.borrow_unchecked())?;
  // causes the lamports below to be 0 
  let lamports = Rent::try_minimum_balance(&rent, Mint22::BASE_LEN)?;

Docs: https://docs.rs/pinocchio/latest/pinocchio/sysvars/rent/struct.Rent.html

In Pinocchio 0.10.1, Rent::get()?.minimum_balance(DATA_LEN) has been deprecated.

So I am trying to use the Rent::try_minimum_balance()

  let rent = Rent::from_account_view(my_mint_account)?;// fails to run at 
//unlikely(account_view.address() != &RENT_ID) inside the from_account_view().
//What is RENT_ID?

  let rent = Rent::from_bytes(account.borrow_unchecked())?;
  // causes the lamports below to be 0 
  let lamports = Rent::try_minimum_balance(&rent, Mint22::BASE_LEN)?;

In Pinocchio 0.10.1, Rent::get()?.minimum_balance(DATA_LEN) has been deprecated.

So I am trying to use the Rent::try_minimum_balance()

  let rent = Rent::from_account_view(my_mint_account)?;// fails to run at 
//unlikely(account_view.address() != &RENT_ID) inside the from_account_view().
//What is RENT_ID?

  let rent = Rent::from_bytes(account.borrow_unchecked())?;
  // causes the lamports below to be 0 
  let lamports = Rent::try_minimum_balance(&rent, Mint22::BASE_LEN)?;

Docs: https://docs.rs/pinocchio/latest/pinocchio/sysvars/rent/struct.Rent.html

Source Link
Russo
  • 653
  • 6
  • 10

How to get minimum balance(rent exempt lamports) from accounts in Pinocchio 0.10.1?

In Pinocchio 0.10.1, Rent::get()?.minimum_balance(DATA_LEN) has been deprecated.

So I am trying to use the Rent::try_minimum_balance()

  let rent = Rent::from_account_view(my_mint_account)?;// fails to run at 
//unlikely(account_view.address() != &RENT_ID) inside the from_account_view().
//What is RENT_ID?

  let rent = Rent::from_bytes(account.borrow_unchecked())?;
  // causes the lamports below to be 0 
  let lamports = Rent::try_minimum_balance(&rent, Mint22::BASE_LEN)?;