Check-in [dcaff32689]
Overview
Comment:Added a work generation test
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: dcaff326894bbc08fbf6e2616123930319edf5c69a56b06aa23417c631655491
User & Date: rkeene on 2018-07-03 19:16:45
Other Links: manifest | tags
Context
2018-07-03
19:29
Added an example for generating work from a given hash check-in: 4a127ff396 user: rkeene tags: trunk
19:16
Added a work generation test check-in: dcaff32689 user: rkeene tags: trunk
19:03
Add support for computing and validating work check-in: 78a7632dc9 user: rkeene tags: trunk
Changes

Modified build/test/test.tcl from [9b1e3719a4] to [14c732d43e].

237
238
239
240
241
242
243






244


245
246
247
248
249
250
251
		puts "\[2.FAIL\] Got: $verify"
		puts "\[2.FAIL\] Exp: false"

		return false
	}

	# Generation






	## XXX:TODO



	return true
}

set tests {
	selftest
	signatures







>
>
>
>
>
>
|
>
>







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
		puts "\[2.FAIL\] Got: $verify"
		puts "\[2.FAIL\] Exp: false"

		return false
	}

	# Generation
	set blockhash "1C840FED01000000D8CBCF440CB1E4DF386761E6E66609563BD62A649DF6D0BE"
	set work      [binary encode hex [::nano::internal::generateWork [binary decode hex $blockhash]]]
	set verify [::nano::internal::validateWork [binary decode hex $blockhash] [binary decode hex $work]]
	if {!$verify} {
		puts "\[3.FAIL\] Got: $verify"
		puts "\[3.FAIL\] Exp: true"

		return false
	}

	return true
}

set tests {
	selftest
	signatures