onflow/hybrid-custody

Manager.giveOwnerShip() removes owned account twice

sisyphusSmiling opened this issue · 0 comments

Manager.giveOwnerShip() removes the specified owned account twice:

pub fun giveOwnerShip(addr: Address, to: Address) {
    let acct = self.ownedAccounts.remove(key: addr)
        ?? panic("account not found")
    self.ownedAccounts.remove(key: acct.address)

    acct.borrow()!.giveOwnership(to: to)
}

Very minor, but I'd like to include coverage for this method and rename to giveOwnership() for consistency with the ChildAccount method.