Skip to content

Commit

Permalink
bump emulator to remote signer version with unlocking (#48)
Browse files Browse the repository at this point in the history
* bump emulator to remote signer version with unlocking
  • Loading branch information
KonradStaniec authored Nov 28, 2024
1 parent fc3c59c commit 7bf736a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ to derive child private keys from the master key
with encrypted file keyring usage
* [#47](https://github.com/babylonlabs-io/covenant-emulator/pull/47) Add unlocking keyring
through API
* [#48](https://github.com/babylonlabs-io/covenant-emulator/pull/48) Add covenant
signer version that requires unlocking

## v0.9.0

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
cosmossdk.io/math v1.4.0
github.com/avast/retry-go/v4 v4.5.1
github.com/babylonlabs-io/babylon v0.17.1
github.com/babylonlabs-io/covenant-emulator/covenant-signer v0.1.0
github.com/babylonlabs-io/covenant-emulator/covenant-signer v0.2.0
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/btcutil v1.1.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1421,8 +1421,8 @@ github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/babylonlabs-io/babylon v0.17.1 h1:lyWGdR7B49qDw5pllLyTW/HAM5uQWXXPZefjFzy/Xy0=
github.com/babylonlabs-io/babylon v0.17.1/go.mod h1:sT+KG2U+M0tDMNZZ2L5CwlXX0OpagGEs56BiWXqaZFw=
github.com/babylonlabs-io/covenant-emulator/covenant-signer v0.1.0 h1:3xzJyieVpYrv3io7C7nC7muCZQHq5DsWpmibPWNuxSA=
github.com/babylonlabs-io/covenant-emulator/covenant-signer v0.1.0/go.mod h1:9lAyEcdpfS21bMLMEa8WjTyLVfwHJABRh5TmoxC9LKU=
github.com/babylonlabs-io/covenant-emulator/covenant-signer v0.2.0 h1:bIosLYR/HUDN4gtUMqbPZjDKapcTHVJHFs0o9AGJt+U=
github.com/babylonlabs-io/covenant-emulator/covenant-signer v0.2.0/go.mod h1:9lAyEcdpfS21bMLMEa8WjTyLVfwHJABRh5TmoxC9LKU=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
Expand Down
11 changes: 10 additions & 1 deletion itest/test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/babylonlabs-io/covenant-emulator/covenant-signer/keystore/cosmos"
signerMetrics "github.com/babylonlabs-io/covenant-emulator/covenant-signer/observability/metrics"
signerApp "github.com/babylonlabs-io/covenant-emulator/covenant-signer/signerapp"
"github.com/babylonlabs-io/covenant-emulator/covenant-signer/signerservice"
signerService "github.com/babylonlabs-io/covenant-emulator/covenant-signer/signerservice"
covdkeyring "github.com/babylonlabs-io/covenant-emulator/keyring"
"github.com/babylonlabs-io/covenant-emulator/remotesigner"
Expand Down Expand Up @@ -93,7 +94,6 @@ func StartManager(t *testing.T, useRemoteSigner bool) *TestManager {
covenantConfig.RemoteSignerEnabled = true
signerConfig := signerCfg.DefaultConfig()
signerConfig.KeyStore.CosmosKeyStore.ChainID = covenantConfig.BabylonConfig.ChainID
signerConfig.KeyStore.CosmosKeyStore.Passphrase = passphrase
signerConfig.KeyStore.CosmosKeyStore.KeyName = covenantConfig.BabylonConfig.Key
signerConfig.KeyStore.CosmosKeyStore.KeyringBackend = covenantConfig.BabylonConfig.KeyringBackend
signerConfig.KeyStore.CosmosKeyStore.KeyDirectory = covenantConfig.BabylonConfig.KeyDirectory
Expand Down Expand Up @@ -133,6 +133,15 @@ func StartManager(t *testing.T, useRemoteSigner bool) *TestManager {
// Give some time to launch server
time.Sleep(3 * time.Second)

// unlock the signer before usage
err = signerservice.Unlock(
context.Background(),
covenantConfig.RemoteSigner.URL,
covenantConfig.RemoteSigner.Timeout,
passphrase,
)
require.NoError(t, err)

t.Cleanup(func() {
_ = server.Stop(context.TODO())
})
Expand Down

0 comments on commit 7bf736a

Please sign in to comment.