From 20b8d91ae1917476881ec64b210006cabd778ef0 Mon Sep 17 00:00:00 2001 From: Nitish-bot <86357181+Nitish-bot@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:47:51 +0530 Subject: [PATCH] Achieve technical completeness --- basics/pda-rent-payer/steel/api/src/instruction.rs | 2 +- basics/pda-rent-payer/steel/program/src/create_new_account.rs | 2 +- basics/pda-rent-payer/steel/program/src/init_rent_vault.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/basics/pda-rent-payer/steel/api/src/instruction.rs b/basics/pda-rent-payer/steel/api/src/instruction.rs index 14c6972c0..94249e540 100644 --- a/basics/pda-rent-payer/steel/api/src/instruction.rs +++ b/basics/pda-rent-payer/steel/api/src/instruction.rs @@ -1,4 +1,4 @@ -use borsh::{ BorshDeserialize, BorshSerialize }; +use borsh::{BorshDeserialize, BorshSerialize}; use steel::*; #[repr(u8)] diff --git a/basics/pda-rent-payer/steel/program/src/create_new_account.rs b/basics/pda-rent-payer/steel/program/src/create_new_account.rs index 1cf624c6f..72a1b112d 100644 --- a/basics/pda-rent-payer/steel/program/src/create_new_account.rs +++ b/basics/pda-rent-payer/steel/program/src/create_new_account.rs @@ -22,7 +22,7 @@ pub fn process_create_account(accounts: &[AccountInfo<'_>]) -> ProgramResult { // First we get the lamports required for rent // assuming this account has no inner data let lamports_required_for_rent = (Rent::get()?).minimum_balance(0); - + if vault_balance < lamports_required_for_rent { return Err(ProgramError::InsufficientFunds); } diff --git a/basics/pda-rent-payer/steel/program/src/init_rent_vault.rs b/basics/pda-rent-payer/steel/program/src/init_rent_vault.rs index 6add3dc7b..54b74dfeb 100644 --- a/basics/pda-rent-payer/steel/program/src/init_rent_vault.rs +++ b/basics/pda-rent-payer/steel/program/src/init_rent_vault.rs @@ -51,7 +51,7 @@ pub fn process_initialize_vault(accounts: &[AccountInfo<'_>], data: &[u8]) -> Pr match transfer { Ok(_) => (), - Err(e) => return Err(e.into()), + Err(e) => return Err(e), } msg!("Initialized rent vault.");