Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add file_prefix option #4

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions scripts/new-controller.fif
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@
{ show-options-help 1 halt } : usage

begin-options
"<validator-address> <nominator-address> <validator_reward_share> <validator_cover_ability>" +cr +tab
"<validator-address> <nominator-address> <validator_reward_share> <validator_cover_ability> [<file_prefix>]" +cr +tab
+"Creates a queries to deploy validator controller with two proxies" +cr +tab
+"The query will be saved into 'new-controller.boc', 'new-proxy1.boc', 'new-proxy2.boc' "
disable-digit-options generic-help-setopt
"h" "--help" { usage } short-long-option
"Shows a help message" option-help
parse-options

$# dup 4 < swap 4 > or ' usage if
$# dup 4 < swap 5 > or ' usage if
5 :$1..n

$1 $>smca not abort"Expect validator address" drop 2=: val_addr
$2 $>smca not abort"Expect nominator address" drop 2=: nom_addr
$3 parse-int =: validator_reward_share
$4 parse-int =: validator_cover_ability
$5 "new" replace-if-null =: file-base


// Controller
Expand Down Expand Up @@ -72,20 +73,20 @@ dup hashu wc swap 2constant proxy2_addr

<b b{1000100} s, proxy1_addr addr, b{000010} s, proxy1_state_init <s s, b{0} s, b>
2 boc+>B
"new-proxy1.boc" tuck B>file
."(Saved controller creating query to file " type .")" cr
file-base +"-proxy1.boc" tuck B>file
."(Saved proxy 1 creating query to file " type .")" cr

<b b{1000100} s, proxy2_addr addr, b{000010} s, proxy2_state_init <s s, b{0} s, b>
2 boc+>B
"new-proxy2.boc" tuck B>file
."(Saved controller creating query to file " type .")" cr
file-base +"-proxy2.boc" tuck B>file
."(Saved proxy 2 creating query to file " type .")" cr

// Controller deploy


<b b{100} s, proxy1_addr addr, b{100} s, proxy2_addr addr, b> =: controller_init_message
<b b{1000100} s, controller_addr addr, b{000010} s, controller_state_init <s s, b{0} s, controller_init_message <s s, b>
2 boc+>B
"new-controller.boc" tuck B>file
file-base +"-controller.boc" tuck B>file
."(Saved controller creating query to file " type .")" cr