File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,14 @@ impl NodeUpdateTransaction {
225225 self . data_mut ( ) . grpc_proxy_endpoint = Some ( grpc_proxy_endpoint) ;
226226 self
227227 }
228+
229+ /// Deletes the gRPC proxy endpoint and sets it to null.
230+ ///
231+ /// This clears the gRPC proxy endpoint field, effectively removing it from the node update.
232+ pub fn delete_grpc_proxy_endpoint ( & mut self ) -> & mut Self {
233+ self . data_mut ( ) . grpc_proxy_endpoint = None ;
234+ self
235+ }
228236}
229237
230238impl TransactionData for NodeUpdateTransactionData { }
@@ -542,6 +550,26 @@ mod tests {
542550 assert_eq ! ( tx. get_grpc_proxy_endpoint( ) , Some ( & grpc_proxy_endpoint) ) ;
543551 }
544552
553+ #[ test]
554+ fn delete_grpc_proxy_endpoint ( ) {
555+ let grpc_proxy_endpoint = make_ip_address_list ( ) . into_iter ( ) . next ( ) . unwrap ( ) ;
556+ let mut tx = NodeUpdateTransaction :: new ( ) ;
557+
558+ // First set the grpc proxy endpoint
559+ tx. grpc_proxy_endpoint ( grpc_proxy_endpoint. clone ( ) ) ;
560+ assert_eq ! ( tx. get_grpc_proxy_endpoint( ) , Some ( & grpc_proxy_endpoint) ) ;
561+
562+ // Then delete it
563+ tx. delete_grpc_proxy_endpoint ( ) ;
564+ assert_eq ! ( tx. get_grpc_proxy_endpoint( ) , None ) ;
565+ }
566+
567+ #[ test]
568+ #[ should_panic]
569+ fn delete_grpc_proxy_endpoint_frozen_panic ( ) {
570+ make_transaction ( ) . delete_grpc_proxy_endpoint ( ) ;
571+ }
572+
545573 #[ test]
546574 fn get_set_service_endpoints ( ) {
547575 let service_endpoints = make_ip_address_list ( ) ;
You can’t perform that action at this time.
0 commit comments