diff --git a/core/src/contact_info.rs b/core/src/contact_info.rs index 69efba1176..feaaf334ec 100644 --- a/core/src/contact_info.rs +++ b/core/src/contact_info.rs @@ -299,8 +299,8 @@ mod tests { assert_eq!(ci.gossip.port(), 11); assert_eq!(ci.tvu.port(), 12); assert_eq!(ci.tpu_forwards.port(), 13); - assert_eq!(ci.rpc.port(), 8899); - assert_eq!(ci.rpc_pubsub.port(), 8900); + assert_eq!(ci.rpc.port(), rpc_port::DEFAULT_RPC_PORT); + assert_eq!(ci.rpc_pubsub.port(), rpc_port::DEFAULT_RPC_PUBSUB_PORT); assert!(ci.storage_addr.ip().is_unspecified()); } #[test] @@ -315,8 +315,14 @@ mod tests { assert_eq!(d1.tvu, socketaddr!("127.0.0.1:1236")); assert_eq!(d1.tpu_forwards, socketaddr!("127.0.0.1:1237")); assert_eq!(d1.tpu, socketaddr!("127.0.0.1:1234")); - assert_eq!(d1.rpc, socketaddr!("127.0.0.1:8899")); - assert_eq!(d1.rpc_pubsub, socketaddr!("127.0.0.1:8900")); + assert_eq!( + d1.rpc, + socketaddr!(format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PORT)) + ); + assert_eq!( + d1.rpc_pubsub, + socketaddr!(format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PUBSUB_PORT)) + ); } #[test] diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 4fc5d234e7..49d61efe72 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -1116,6 +1116,7 @@ pub mod tests { fee_calculator::DEFAULT_BURN_PERCENT, hash::{hash, Hash}, instruction::InstructionError, + rpc_port, signature::{Keypair, KeypairUtil}, system_transaction, transaction::TransactionError, @@ -1354,8 +1355,9 @@ pub mod tests { .expect("actual response deserialization"); let expected = format!( - r#"{{"jsonrpc":"2.0","result":[{{"pubkey": "{}", "gossip": "127.0.0.1:1235", "tpu": "127.0.0.1:1234", "rpc": "127.0.0.1:8899"}}],"id":1}}"#, + r#"{{"jsonrpc":"2.0","result":[{{"pubkey": "{}", "gossip": "127.0.0.1:1235", "tpu": "127.0.0.1:1234", "rpc": "127.0.0.1:{}"}}],"id":1}}"#, leader_pubkey, + rpc_port::DEFAULT_RPC_PORT ); let expected: Response =