pub fn share_transfer(&mut self, sender_id: &AccountId, receiver_id: &AccountId, amount: u128) {
        let balance = self.shares.get(&sender_id).expect("ERR_NO_SHARES");
        if let Some(new_balance) = balance.checked_sub(amount) {
            self.shares.insert(&sender_id, &new_balance);
        } else {
            env::panic(b"ERR_NOT_ENOUGH_SHARES");
        }
        let balance_out = self
            .shares
            .get(&receiver_id)
            .expect(ERR13_LP_NOT_REGISTERED);
        self.shares.insert(&receiver_id, &(balance_out + amount));
    }
/// Transfers shares from predecessor to receiver.
Transfers shares from predecessor to receiver.
Transfers shares from predecessor to receiver .
pub fn share_transfer(&mut self, sender_id: &AccountId, receiver_id: &AccountId, amount: u128) {
        let balance = self.shares.get(&sender_id).expect("ERR_NO_SHARES");
        if let Some(new_balance) = balance.checked_sub(amount) {
            self.shares.insert(&sender_id, &new_balance);
        } else {
            env::panic(b"ERR_NOT_ENOUGH_SHARES");
        }
        let balance_out = self
            .shares
            .get(&receiver_id)
            .expect(ERR13_LP_NOT_REGISTERED);
        self.shares.insert(&receiver_id, &(balance_out + amount));
    }
pub fn share_transfer ( & mut self , sender_id : & AccountId , receiver_id : & AccountId , amount : u128 ) { let balance = self . shares . get ( & sender_id ) . expect ( " " ) ; if let Some ( new_balance ) = balance . checked_sub ( amount ) { self . shares . insert ( & sender_id , & new_balance ) ; } else { env :: panic ( b" " ) ; } let balance_out = self . shares . get ( & receiver_id ) . expect ( ERR13_LP_NOT_REGISTERED ) ; self . shares . insert ( & receiver_id , & ( balance_out + amount ) ) ; }
Transfers shares from predecessor to receiver.
Transfers shares from predecessor to receiver .
&mut self
sender_id
&AccountId
receiver_id
&AccountId
amount
u128
&mut self
sender_id
&AccountId
receiver_id
&AccountId
amount
u128