aboutsummaryrefslogtreecommitdiff
path: root/message/message_test.go
blob: be2b233d1aa938df911105485ce63db13b2b3395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test the message package
package message_test

import (
	"testing"
	"time"

	"git.kiefte.eu/lapingvino/infodump/message"
)

// Test if creating a proof of work of 16 leading zeros finishes in 10 seconds
func TestMessageTimeout(t *testing.T) {
	msg := message.Message{Message: "test", Timestamp: time.Now().Unix()}
	err := msg.ProofOfWork(16, 10*time.Second)
	if err != nil {
		t.Error(err)
	}
}