Add validator public key to genesis transaction

parent f888ce97
Pipeline #26943780 passed with stages
in 3 minutes and 36 seconds
......@@ -234,6 +234,7 @@
(let [from (r/atom nil)
locked (r/atom false)
locked-until (r/atom nil)
validator (r/atom nil)
tx (r/atom nil)]
(fn []
[:div
......@@ -245,15 +246,17 @@
(reset! locked (-> % .-target .-checked))
(reset! locked-until nil))}]]
(when @locked
[:p
[:label "Locked until"]
[:input {:type :number
:min 1
:max (- (js/Math.pow 2 24) 1)
:on-change #(reset! locked-until (-> % .-target .-value js/parseInt))}]])
[:div
[:p
[:label "Locked until"]
[:input {:type :number
:min 1
:max (- (js/Math.pow 2 24) 1)
:on-change #(reset! locked-until (-> % .-target .-value js/parseInt))}]]
(account-select "Validator" validator)])
[:p
[:input {:type :button
:on-click #(reset! tx (tx/genesis-tx @from @locked-until))
:on-click #(reset! tx (tx/genesis-tx @from @locked-until @validator))
:value "Generate"}]]
(when @tx
[:div
......
......@@ -42,12 +42,15 @@
(::a/address account))]
(sign to-sign account)))
(defn genesis-tx [from locked-until]
(defn genesis-tx [from locked-until validator]
(let [locked-until-vec (drop-while #(= 0 %) (uint/uint->vec (or locked-until 0) 3))
to-sign (concat
(uint/str->utf8 "Ercoin ")
(::a/address from)
[(count locked-until-vec)]
(if (> locked-until 0)
(::a/address validator)
[])
locked-until-vec)
signed-msg (sign to-sign from)]
(concat [106 76 (count signed-msg)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment