Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 7 additions & 6 deletions signer/rules/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func initRuleEngine(js string) (*rulesetUI, error) {
}

func TestListRequest(t *testing.T) {
t.Parallel()
accs := make([]core.Account, 5)

for i := range accs {
Expand Down Expand Up @@ -152,7 +153,7 @@ func TestListRequest(t *testing.T) {
}

func TestSignTxRequest(t *testing.T) {

t.Parallel()
js := `
function ApproveTx(r){
console.log("transaction.from", r.transaction.from);
Expand Down Expand Up @@ -245,7 +246,7 @@ func (d *dummyUI) OnSignerStartup(info core.StartupInfo) {

// TestForwarding tests that the rule-engine correctly dispatches requests to the next caller
func TestForwarding(t *testing.T) {

t.Parallel()
js := ""
ui := &dummyUI{make([]string, 0)}
jsBackend := storage.NewEphemeralStorage()
Expand Down Expand Up @@ -302,7 +303,7 @@ func TestMissingFunc(t *testing.T) {

}
func TestStorage(t *testing.T) {

t.Parallel()
js := `
function testStorage(){
storage.Put("mykey", "myvalue")
Expand Down Expand Up @@ -467,7 +468,7 @@ func dummySigned(value *big.Int) *types.Transaction {

}
func TestLimitWindow(t *testing.T) {

t.Parallel()
r, err := initRuleEngine(ExampleTxWindow)
if err != nil {
t.Errorf("Couldn't create evaluator %v", err)
Expand Down Expand Up @@ -557,7 +558,7 @@ func (d *dontCallMe) OnApprovedTx(tx ctxcapi.SignTransactionResult) {
// if it does, that would be bad since developers may rely on that to store data,
// instead of using the disk-based data storage
func TestContextIsCleared(t *testing.T) {

t.Parallel()
js := `
function ApproveTx(){
if (typeof foobar == 'undefined') {
Expand Down Expand Up @@ -589,7 +590,7 @@ func TestContextIsCleared(t *testing.T) {
}

func TestSignData(t *testing.T) {

t.Parallel()
js := `function ApproveListing(){
return "Approve"
}
Expand Down
4 changes: 3 additions & 1 deletion signer/storage/aes_gcm_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
)

func TestEncryption(t *testing.T) {
t.Parallel()
// key := []byte("AES256Key-32Characters1234567890")
// plaintext := []byte(value)
key := []byte("AES256Key-32Characters1234567890")
Expand All @@ -49,7 +50,7 @@ func TestEncryption(t *testing.T) {
}

func TestFileStorage(t *testing.T) {

t.Parallel()
a := map[string]storedCredential{
"secret": {
Iv: common.Hex2Bytes("cdb30036279601aeee60f16b"),
Expand Down Expand Up @@ -91,6 +92,7 @@ func TestFileStorage(t *testing.T) {
}
}
func TestEnd2End(t *testing.T) {
t.Parallel()
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(3), log.StreamHandler(colorable.NewColorableStderr(), log.TerminalFormat(true))))

d, err := os.MkdirTemp("", "ctxc-encrypted-storage-test")
Expand Down