diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-09-10 16:11:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 16:11:10 +0800 |
commit | 2439f49063d8498eadf26d4fa1220c5eac8412a8 (patch) | |
tree | 1142ad5a5e4393315f956324191ddb7e03b804c3 /integration_test/validator.go | |
parent | 2b5c97e53e9734dda971456ff483bf2b34f0f021 (diff) | |
download | tangerine-consensus-2439f49063d8498eadf26d4fa1220c5eac8412a8.tar tangerine-consensus-2439f49063d8498eadf26d4fa1220c5eac8412a8.tar.gz tangerine-consensus-2439f49063d8498eadf26d4fa1220c5eac8412a8.tar.bz2 tangerine-consensus-2439f49063d8498eadf26d4fa1220c5eac8412a8.tar.lz tangerine-consensus-2439f49063d8498eadf26d4fa1220c5eac8412a8.tar.xz tangerine-consensus-2439f49063d8498eadf26d4fa1220c5eac8412a8.tar.zst tangerine-consensus-2439f49063d8498eadf26d4fa1220c5eac8412a8.zip |
test: add transport layer (#97)
The purpose of transport layer is to abstract the way to send messages and setup connections between peers in a p2p network. The peer discovery is simulated by a hosted server: every peer sends its address to a known server. Once collecting enough peers, respond the whole peers lists to all peers.
Changes:
- Add test.Trasnport interface
- Add test.Transport implementation by golang channel.
- Add test.transport implementation by TCP connection.
- Move LatencyModel to core/test package
- Add Marshaller interface
Diffstat (limited to 'integration_test/validator.go')
-rw-r--r-- | integration_test/validator.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/integration_test/validator.go b/integration_test/validator.go index bfe517f..5909b46 100644 --- a/integration_test/validator.go +++ b/integration_test/validator.go @@ -68,8 +68,8 @@ type Validator struct { chainID uint32 cons *core.Consensus gov core.Governance - networkLatency LatencyModel - proposingLatency LatencyModel + networkLatency test.LatencyModel + proposingLatency test.LatencyModel } // NewValidator constructs an instance of Validator. @@ -79,8 +79,8 @@ func NewValidator( db blockdb.BlockDatabase, privateKey crypto.PrivateKey, vID types.ValidatorID, - networkLatency LatencyModel, - proposingLatency LatencyModel) *Validator { + networkLatency test.LatencyModel, + proposingLatency test.LatencyModel) *Validator { hashes := make(common.Hashes, 0) for vID := range gov.GetValidatorSet() { |