Skip to content

Commit

Permalink
ability to specify protocol when importing key
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi committed Jun 28, 2024
1 parent a6a18a6 commit 0fcadc5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/__xtz/ledger/authorize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ local function setup(options)
table.insert(_args, 2, "http://" .. am.app.get_model("SIGNER_ADDR") .. am.app.get_model("SIGNER_PORT"))
end

local protocol = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"
if type(options.protocol) == "string" then
protocol = options.protocol
end
table.insert(_args, 1, "-p")
table.insert(_args, 2, "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK")
table.insert(_args, 2, protocol)

if options["chain-id"] then
table.insert(_args, "--main-chain-id")
Expand Down
8 changes: 7 additions & 1 deletion src/__xtz/ledger/key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ local function setup(options)
})
ami_assert(_proc.exitcode == 0, "Failed to import key to signer!")

local protocol = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"
if type(options.protocol) == "string" then
protocol = options.protocol
end


log_info("Please confirm key import for client...")
local _proc = proc.spawn("bin/client",
{ "import", "secret", "key", alias or "baker", "ledger://" .. ledgerId .. "/" .. derivationPath,
{ "-p", protocol, "import", "secret", "key", alias or "baker", "ledger://" .. ledgerId .. "/" .. derivationPath,
options.force and "--force" or nil }, {
stdio = "inherit",
wait = true,
Expand Down
12 changes: 6 additions & 6 deletions src/__xtz/sources.hjson
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SOURCE: https://gitlab.com/tezos/tezos/-/releases
{
linux-x86_64: {
client: https://gitlab.com/tezos/tezos/-/package_files/130339263/download
signer: https://gitlab.com/tezos/tezos/-/package_files/130339110/download
}
linux-arm64: {
client: https://gitlab.com/tezos/tezos/-/package_files/130342347/download
signer: https://gitlab.com/tezos/tezos/-/package_files/130341848/download
client: https://gitlab.com/tezos/tezos/-/package_files/133747755/download
signer: https://gitlab.com/tezos/tezos/-/package_files/133747594/download
}
linux-x86_64: {
client: https://gitlab.com/tezos/tezos/-/package_files/133747025/download
signer: https://gitlab.com/tezos/tezos/-/package_files/133746942/download
}
}
4 changes: 4 additions & 0 deletions src/ami.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ return {
description = "skip udev rules setup (if --platform specified and platform is linux)",
type = "boolean"
},
["protocol"] = {
description = "specify protocol (used only if --import-key or --authorize specified)",
type = "string"
},
force = {
description = 'forces operation, e.g. key import',
type = "boolean"
Expand Down
2 changes: 1 addition & 1 deletion src/specs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "xtz.signer",
"version" : "0.23.4+20.1",
"version" : "0.23.5+20.1",
"dependencies": [
{ "id":"xtz.base" }
]
Expand Down

0 comments on commit 0fcadc5

Please sign in to comment.