@@ -85,14 +85,14 @@ mod tests {
85
85
use super :: PingpongPayload ;
86
86
87
87
#[ test]
88
- fn test_heartbeat_payload ( ) {
88
+ fn test_pingpong_payload ( ) {
89
89
let pk = PublicKey :: parse_compressed ( & hex_literal:: hex!(
90
90
"0208ef5e65a9c656a6f92fb2c770d5d5e2ecffe02a6aade19207f75110be6ae658"
91
91
) )
92
92
. expect ( "Should parse public key" ) ;
93
93
let message = DKNMessage {
94
94
payload : "Y2RmODcyNDlhY2U3YzQ2MDIzYzNkMzBhOTc4ZWY3NjViMWVhZDlmNWJhMDUyY2MxMmY0NzIzMjQyYjc0YmYyODFjMDA1MTdmMGYzM2VkNTgzMzk1YWUzMTY1ODQ3NWQyNDRlODAxYzAxZDE5MjYwMDM1MTRkNzEwMThmYTJkNjEwMXsidXVpZCI6ICI4MWE2M2EzNC05NmM2LTRlNWEtOTliNS02YjI3NGQ5ZGUxNzUiLCAiZGVhZGxpbmUiOiAxNzE0MTI4NzkyfQ==" . to_string ( ) ,
95
- topic : "heartbeat " . to_string ( ) ,
95
+ topic : "pingpong " . to_string ( ) ,
96
96
version : "0.0.0" . to_string ( ) ,
97
97
timestamp : 1714129073557846272 ,
98
98
} ;
@@ -106,22 +106,21 @@ mod tests {
106
106
assert_eq ! ( obj. deadline, 1714128792 ) ;
107
107
}
108
108
109
- /// This test demonstrates the process of heartbeat & task assignment.
109
+ /// This test demonstrates the process of pingpong & task assignment.
110
110
///
111
111
/// A heart-beat message is sent over the network by Admin Node, and compute node responds with a signature.
112
112
#[ test]
113
- fn test_heartbeat_and_task_assignment ( ) {
113
+ fn test_pingpong_and_task_assignment ( ) {
114
114
let config = DriaComputeNodeConfig :: default ( ) ;
115
115
116
- // a heartbeat message is signed and sent to Admin Node over the p2p network
117
- let heartbeat_message = Message :: parse ( & sha256hash ( b"sign-me" ) ) ;
118
- let ( heartbeat_signature , heartbeat_recid ) =
119
- libsecp256k1:: sign ( & heartbeat_message , & config. secret_key ) ;
116
+ // a pingpong message is signed and sent to Admin Node over the p2p network
117
+ let pingpong_message = Message :: parse ( & sha256hash ( b"sign-me" ) ) ;
118
+ let ( pingpong_signature , pingpong_recid ) =
119
+ libsecp256k1:: sign ( & pingpong_message , & config. secret_key ) ;
120
120
121
121
// admin recovers the address from the signature
122
- let recovered_public_key =
123
- recover ( & heartbeat_message, & heartbeat_signature, & heartbeat_recid)
124
- . expect ( "Could not recover" ) ;
122
+ let recovered_public_key = recover ( & pingpong_message, & pingpong_signature, & pingpong_recid)
123
+ . expect ( "Could not recover" ) ;
125
124
assert_eq ! (
126
125
config. public_key, recovered_public_key,
127
126
"Public key mismatch"
0 commit comments