Skip to content

Commit

Permalink
Add package pkg/perun/wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgeihs committed Oct 6, 2021
1 parent d39918c commit 90b949a
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions pkg/perun/wallet/test/wallet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2021 PolyCrypt GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package test

import (
"math/rand"
"testing"

pkgtest "perun.network/go-perun/pkg/test"
"perun.network/go-perun/wallet/test"
)

type NewSetupFunc func(rng *rand.Rand) *test.Setup

// TestWallet tests a wallet implementation.
func TestWallet(t *testing.T, newWalletSetup NewSetupFunc) {
t.Run("Generic Address Test", func(t *testing.T) {
t.Parallel()
rng := pkgtest.Prng(t, "address")
test.TestAddress(t, newWalletSetup(rng))
})
t.Run("Test Account, Wallet, and Backend", func(t *testing.T) {
t.Parallel()
rng := pkgtest.Prng(t, "signature")
test.TestAccountWithWalletAndBackend(t, newWalletSetup(rng))
})
t.Run("Generic Signature Size Test", func(t *testing.T) {
t.Parallel()
rng := pkgtest.Prng(t, "signature size")
test.GenericSignatureSizeTest(t, newWalletSetup(rng))
})
}

0 comments on commit 90b949a

Please sign in to comment.