You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

  1. package p2p_test
  2. import (
  3. "github.com/tendermint/tendermint/crypto"
  4. "github.com/tendermint/tendermint/crypto/ed25519"
  5. "github.com/tendermint/tendermint/internal/p2p"
  6. "github.com/tendermint/tendermint/internal/p2p/p2ptest"
  7. "github.com/tendermint/tendermint/types"
  8. )
  9. // Common setup for P2P tests.
  10. var (
  11. chID = p2p.ChannelID(1)
  12. chDesc = &p2p.ChannelDescriptor{
  13. ID: chID,
  14. MessageType: &p2ptest.Message{},
  15. Priority: 5,
  16. SendQueueCapacity: 10,
  17. RecvMessageCapacity: 10,
  18. }
  19. selfKey crypto.PrivKey = ed25519.GenPrivKeyFromSecret([]byte{0xf9, 0x1b, 0x08, 0xaa, 0x38, 0xee, 0x34, 0xdd})
  20. selfID = types.NodeIDFromPubKey(selfKey.PubKey())
  21. selfInfo = types.NodeInfo{
  22. NodeID: selfID,
  23. ListenAddr: "0.0.0.0:0",
  24. Network: "test",
  25. Moniker: string(selfID),
  26. Channels: []byte{0x01, 0x02},
  27. }
  28. peerKey crypto.PrivKey = ed25519.GenPrivKeyFromSecret([]byte{0x84, 0xd7, 0x01, 0xbf, 0x83, 0x20, 0x1c, 0xfe})
  29. peerID = types.NodeIDFromPubKey(peerKey.PubKey())
  30. peerInfo = types.NodeInfo{
  31. NodeID: peerID,
  32. ListenAddr: "0.0.0.0:0",
  33. Network: "test",
  34. Moniker: string(peerID),
  35. Channels: []byte{0x01, 0x02},
  36. }
  37. )