Skip to content

Commit

Permalink
eth tests
Browse files Browse the repository at this point in the history
Signed-off-by: Philip-21 <[email protected]>
  • Loading branch information
Philip-21 committed Jan 31, 2024
1 parent 4dcceb0 commit 2a29589
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
42 changes: 42 additions & 0 deletions internal/blockchain/ethereum/ethsigner/accounts_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package ethsigner

import (
"context"
"testing"

"github.com/hyperledger/firefly-cli/internal/log"
"github.com/stretchr/testify/assert"
)

func TestWriteTomlKeyFile(t *testing.T) {
t.Run("TestwriteTomlKeyFile", func(t *testing.T) {
directory := "testdata"
FilePath := directory + "/wallet.toml"

p := &EthSignerProvider{}

File, err := p.writeTomlKeyFile(FilePath)
if err != nil {
t.Fatalf("unable to write file: %v", err)
}
assert.NotNil(t, File)
})

}

func TestCopyTomlFileToVolume(t *testing.T) {
t.Run("TestCopyTomltoVolume", func(t *testing.T) {
ctx := log.WithLogger(context.Background(), &log.StdoutLogger{})

directory := "testdata"
tomlPath := directory + "/copy.toml"
VolumeName := "ethsigner"

p := &EthSignerProvider{}
err := p.copyTomlFileToVolume(ctx, tomlPath, VolumeName)
if err != nil {
t.Fatalf("unable to copy file: %v", err)
}
})

}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[metadata]
createdAt = 2019-11-05T08:15:30-05:00
description = "File based configuration"

[signing]
type = "file-based-signer"
key-file = "/data/keystore/wallet.toml"
password-file = "/data/password"

0 comments on commit 2a29589

Please sign in to comment.