Skip to content

Commit

Permalink
Fix use-create-ata-and-stake
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisses committed Nov 29, 2023
1 parent 0b6ec86 commit e3d7130
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/nosana_node/nosana.clj
Original file line number Diff line number Diff line change
Expand Up @@ -776,16 +776,17 @@
"Component that creates the NOS ATA and stake account if they don't
exist yet."
[{:nos/keys [conf] :as sys}]
(when (not (sol/get-account-data (:nos-ata sys) (:network sys)))
(when (not (sol/get-account-data (:nos-ata conf) (:network conf)))
(try
(create-nos-ata sys)
(create-nos-ata conf)
(catch Exception e
(log :debug e)
(throw (ex-info "Could not create NOS ATA" {}))
nil)))
(when (not (sol/get-account-data (sol/get-nos-stake-pda (:address sys)) (:network sys)))
(when (not (sol/get-account-data (sol/get-nos-stake-pda (:address conf)) (:network conf)))
;; create stake with 0 NOS and 364 days duration
(try
(open-stake sys 0 (* 24 60 60 364))
(open-stake conf 0 (* 24 60 60 364))
(catch Exception e
(throw (ex-info "Could not create stake" {}))
nil))
Expand Down

0 comments on commit e3d7130

Please sign in to comment.