Skip to content

Commit

Permalink
doc(backend/sim/wire & wire/net/simple): add documentation for the wi…
Browse files Browse the repository at this point in the history
…re implementations

Signed-off-by: Minh Huy Tran <[email protected]>
  • Loading branch information
NhoxxKienn committed Feb 19, 2024
1 parent cd2c006 commit 67b4419
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion backend/sim/wire/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package wire contains the implementation of the wire interfaces.
// Package wire contains the simulated implementation of the wire interfaces.
// This wire package is used for internal tests in the packages channel, wire, client Note that the Account.Sign and Address.Verify are mock methods.
// We use the the backend/wire/sim mock implementation for testing other go-perun's functionalities.
// Our default wire.Account and wire.Address implementations can be found in wire/net/simple and are used for our applications.
package wire // import "perun.network/go-perun/backend/sim/wire"
2 changes: 1 addition & 1 deletion wire/net/simple/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
// limitations under the License.

// Package simple contains simplistic implementation for the wire.Dialer and
// wire.Listener interfaces.
// wire.Listener interfaces. It uses TLS to ensures secure peers' connection
package simple // import "perun.network/go-perun/wire/net/simple"
2 changes: 2 additions & 0 deletions wire/net/simple/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ func init() {
wire.SetNewAddressFunc(func() wire.Address {
return NewAddress("")
})
// setup for testing purposes
test.SetNewRandomAddress(func(rng *rand.Rand) wire.Address {
return NewRandomAddress(rng)
})
// setup for testing purposes
test.SetNewRandomAccount(func(rng *rand.Rand) wire.Account {
return NewRandomAccount(rng)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
// 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.

Check failure on line 13 in wire/net/simple/simple_exchange_addr_test.go

View workflow job for this annotation

GitHub Actions / Vetting

Unexpected string:
// This tests uses the wire/net/simple implementation of Account and Address
// to test the default implementation of wire.
//nolint:testpackage

Check failure on line 16 in wire/net/simple/simple_exchange_addr_test.go

View workflow job for this annotation

GitHub Actions / Vetting

directive `//nolint:testpackage` is unused for linter "testpackage" (nolintlint)

package simple

Check failure on line 18 in wire/net/simple/simple_exchange_addr_test.go

View workflow job for this annotation

GitHub Actions / Vetting

package should be `simple_test` instead of `simple` (testpackage)

Expand Down

0 comments on commit 67b4419

Please sign in to comment.