Skip to content
Merged
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
33 changes: 20 additions & 13 deletions cmd/interchaincmd/tokentransferrercmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,29 @@ func getHomeKeyAndAddress(app *application.Avalanche, network models.Network, ho
return "", "", err
}

// Propmt for the key to be used.
// Note that this key must have enough funds to cover gas cost on the
// home chain, and also enough of the token on the home chain to collateralize
// the remote chain if it is a native token remote.
homeKey, err := prompts.PromptPrivateKey(
app.Prompt,
"pay for home deployment fees, and collateralization (if necessary)",
app.GetKeyDir(),
app.GetKey,
genesisAddress,
genesisPrivateKey,
)
homeKey, err := homeFlags.privateKeyFlags.GetPrivateKey(app, genesisPrivateKey)
if err != nil {
return "", "", err
}

if homeKey == "" {
// Propmt for the key to be used.
// Note that this key must have enough funds to cover gas cost on the
// home chain, and also enough of the token on the home chain to collateralize
// the remote chain if it is a native token remote.
homeKey, err = prompts.PromptPrivateKey(
app.Prompt,
"pay for home deployment fees, and collateralization (if necessary)",
app.GetKeyDir(),
app.GetKey,
genesisAddress,
genesisPrivateKey,
)
if err != nil {
return "", "", err
}
}

// Calculate the address for the key.
pk, err := crypto.HexToECDSA(homeKey)
if err != nil {
Expand Down Expand Up @@ -408,7 +415,7 @@ func CallDeploy(_ []string, flags DeployFlags) error {
if remoteKey == "" {
remoteKey, err = prompts.PromptPrivateKey(
app.Prompt,
"pay for home deploy fees",
"pay for remote deploy fees",
app.GetKeyDir(),
app.GetKey,
genesisAddress,
Expand Down
Loading