Skip to content

Commit

Permalink
bug: issue with traits, added small todo
Browse files Browse the repository at this point in the history
  • Loading branch information
whoabuddy committed Feb 8, 2024
1 parent 1e32d55 commit d97aa1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/stacks-m2m-trait-v1.clar
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(define-trait stacks-m2m-trait-v1
(
(set-payment-address (principal principal) (response bool uint))
(add-resource (uint (string-utf8 50) (string-utf8 255)) (response bool uint))
(delete-resource (uint) (response bool uint))
(delete-resource-by-name ((string-utf8 50)) (response bool uint))
;; (pay-invoice (uint (optional (buff 34))) (response bool uint))
;; (pay-invoice-by-resource-name ((string-utf8 50) (optional (buff 34))) (response bool uint))
(set-payment-address (principal principal) (response bool uint)) ;; works
(add-resource ((string-utf8 50) (string-utf8 255) uint) (response bool uint)) ;; error
(delete-resource (uint) (response bool uint)) ;; works
(delete-resource-by-name ((string-utf8 50)) (response bool uint)) ;; works
(pay-invoice (uint (optional (buff 34))) (response bool uint))
(pay-invoice-by-resource-name ((string-utf8 50) (optional (buff 34))) (response bool uint))
)
)
3 changes: 2 additions & 1 deletion src/stacks-m2m-v2.clar
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

;; tracks resources added by deployer keyed by resource index
;; can iterate over full map with resourceCount data-var
;; TODO: add string for URL / health checks? could it change?
(define-map ResourceData
uint ;; resource index
{
Expand Down Expand Up @@ -258,7 +259,7 @@

;; adds active resource that invoices can be generated for
;; only accessible by deployer
(define-public (add-resource (price uint) (name (string-utf8 50)) (description (string-utf8 255)))
(define-public (add-resource (name (string-utf8 50)) (description (string-utf8 255)) (price uint))
(let
(
(newCount (+ (get-total-resources) u1))
Expand Down

0 comments on commit d97aa1a

Please sign in to comment.