Skip to content

Commit

Permalink
adds generate-block-age-condition function
Browse files Browse the repository at this point in the history
  • Loading branch information
wbendick authored and hoffmang9 committed Feb 4, 2021
1 parent 91a26a3 commit 08b064e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/wallet/rl_wallet/rl.clvm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
(defconstant AGGREGATE_MODE 2)
(defconstant CLAWBACK_MODE 3)
(defconstant AGGSIG 50)
(defconstant ASSERT_BLOCK_AGE_EXCEEDS 56)

(defun sha256tree (TREE)
(if (l TREE)
Expand Down Expand Up @@ -58,7 +59,14 @@
(create-lock)
(create-consolidated))))

(defun template-block-age () ())
(defun >= (a b)
(or (> a b)
(= a b)))

(defun generate-block-age-condition (min_block_time outgoing_amount)
(assert (>= (* min_block_time rate_amount)
(* outgoing_amount interval_time))
(list ASSERT_BLOCK_AGE_EXCEEDS min_block_time)))

(defun create-change () ())

Expand All @@ -79,7 +87,7 @@
(assert (or (= (sha256 parent_parent_id my_puzzlehash parent_amount)
my_parent_id)
(= origin_id my_parent_id))
(list (template-block-age)
(list (generate-block-age-condition min_block_time outgoing_amount)
(create-change)
(template-my-id)
(create-new-coin))))
Expand Down

0 comments on commit 08b064e

Please sign in to comment.