Trust-Machines / BNS-V2

MIT License
10 stars 3 forks source link

Extract Out 'shift-primary-name' #27

Closed setzeus closed 4 months ago

setzeus commented 4 months ago

Description The current version of BNS-v2 has re-uses the same logic for internally shifting the primary name of a user multiple times, it should be extracted out into it's own private function:

(if (is-eq (some id) owner-primary-name) 
            ;; If the is is the primary name, then check if there are other names owned by the user
            (match (element-at? (filter is-not-removeable all-nfts-owned-by-owner) u0) 
                next-name 
                ;; If the user does have more names then set it to the index0 name
                (map-set primary-name owner next-name) 
                ;; If the user doesn't have more names then delete the primary-name map associated to that user
                (map-delete primary-name owner)
            )
            ;; If it is not equal then do nothing
            false
        )

Action Items

Open Questions

setzeus commented 4 months ago

Closed out with #29