pub fn add_gif(ctx: Context<AddGif>, gif_link: String) -> ProgramResult {
        // - Get a reference to the account & increment the gif total
        let base_account = &mut ctx.accounts.base_account;
        let user  = &mut ctx.accounts.user;

        // - Initialize the item for the gif_list
        let item = ItemStruct {
            gif_link: gif_link.to_string(),
            linker_address: *user.to_account_info().key,
        };

        // - add the new gif to the list and update the count
        base_account.gif_list.push(item);
        base_account.total_gifs += 1;
        Ok(())
    }
// - function with type signature
// - Add a gif to the total_gif count on the base accout
function with type signature
Add a gif to the total_gif count on the base accout
function with type signature Add a gif to the total_gif count on the base accout
pub fn add_gif(ctx: Context<AddGif>, gif_link: String) -> ProgramResult {
        // - Get a reference to the account & increment the gif total
        let base_account = &mut ctx.accounts.base_account;
        let user  = &mut ctx.accounts.user;
        // - Initialize the item for the gif_list
        let item = ItemStruct {
            gif_link: gif_link.to_string(),
            linker_address: *user.to_account_info().key,
        };
        // - add the new gif to the list and update the count
        base_account.gif_list.push(item);
        base_account.total_gifs += 1;
        Ok(())
    }
pub fn add_gif ( ctx : Context < AddGif > , gif_link : String ) -> ProgramResult { // - Get a reference to the account & increment the gif total let base_account = & mut ctx . accounts . base_account ; let user = & mut ctx . accounts . user ; // - Initialize the item for the gif_list let item = ItemStruct { gif_link : gif_link . to_string ( ) , linker_address : * user . to_account_info ( ) . key , } ; // - add the new gif to the list and update the count base_account . gif_list . push ( item ) ; base_account . total_gifs += 1 ; Ok ( ( ) ) }
function with type signature
 Add a gif to the total_gif count on the base accout
function with type signature Add a gif to the total_gif count on the base accout
ctx
Context<AddGif>
gif_link
String
ctx
Context<AddGif>
gif_link
String