File tree Expand file tree Collapse file tree 5 files changed +12
-11
lines changed
nervous_system/integration_tests/src Expand file tree Collapse file tree 5 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -830,7 +830,7 @@ pub mod nns {
830
830
Encode ! ( & ListNeurons {
831
831
neuron_ids: vec![ ] ,
832
832
include_neurons_readable_by_caller: true ,
833
- include_empty_neurons_readable_by_caller: None ,
833
+ include_empty_neurons_readable_by_caller: Some ( true ) ,
834
834
include_public_neurons_in_full_neurons: None ,
835
835
page_number: None ,
836
836
page_size: None
Original file line number Diff line number Diff line change @@ -2285,11 +2285,8 @@ impl Governance {
2285
2285
. unwrap_or ( MAX_LIST_NEURONS_RESULTS as u64 )
2286
2286
. min ( MAX_LIST_NEURONS_RESULTS as u64 ) ;
2287
2287
2288
- let include_empty_neurons_readable_by_caller = include_empty_neurons_readable_by_caller
2289
- // This default is to maintain the previous behavior. (Unlike
2290
- // protobuf, we do not have a convention that says "the default
2291
- // value is falsy".)
2292
- . unwrap_or ( true ) ;
2288
+ let include_empty_neurons_readable_by_caller =
2289
+ include_empty_neurons_readable_by_caller. unwrap_or ( false ) ;
2293
2290
let include_public_neurons_in_full_neurons =
2294
2291
include_public_neurons_in_full_neurons. unwrap_or ( false ) ;
2295
2292
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ fn test_list_neurons_with_paging() {
46
46
let mut request = ListNeurons {
47
47
neuron_ids : vec ! [ ] ,
48
48
include_neurons_readable_by_caller : true ,
49
- include_empty_neurons_readable_by_caller : None ,
49
+ include_empty_neurons_readable_by_caller : Some ( true ) ,
50
50
include_public_neurons_in_full_neurons : None ,
51
51
page_number : None ,
52
52
page_size : None ,
@@ -64,7 +64,7 @@ fn test_list_neurons_with_paging() {
64
64
& ListNeurons {
65
65
neuron_ids : vec ! [ ] ,
66
66
include_neurons_readable_by_caller : true ,
67
- include_empty_neurons_readable_by_caller : None ,
67
+ include_empty_neurons_readable_by_caller : Some ( true ) ,
68
68
include_public_neurons_in_full_neurons : None ,
69
69
page_number : Some ( 1 ) ,
70
70
page_size : None ,
@@ -80,7 +80,7 @@ fn test_list_neurons_with_paging() {
80
80
& ListNeurons {
81
81
neuron_ids : vec ! [ ] ,
82
82
include_neurons_readable_by_caller : true ,
83
- include_empty_neurons_readable_by_caller : None ,
83
+ include_empty_neurons_readable_by_caller : Some ( true ) ,
84
84
include_public_neurons_in_full_neurons : None ,
85
85
page_number : Some ( 0 ) ,
86
86
page_size : Some ( 501 ) ,
Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ No neurons are actually migrated yet.
74
74
* ` InstallCode ` proposal payload hashes are now computed when making the proposal instead of when
75
75
listing proposal. Hashes for existing proposals are backfilled.
76
76
77
+ * The ` list_neurons ` behavior is slightly changed: the ` include_empty_neurons_readable_by_caller `
78
+ was default to true before, and now it's default to true. More details can be found at:
79
+ https://forum.dfinity.org/t/listneurons-api-change-empty-neurons/40311
80
+
77
81
## Deprecated
78
82
79
83
## Removed
Original file line number Diff line number Diff line change @@ -604,6 +604,6 @@ fn test_list_neurons() {
604
604
page_size : None ,
605
605
} ,
606
606
) ;
607
- assert_eq ! ( list_neurons_response. neuron_infos. len( ) , 3 ) ;
608
- assert_eq ! ( list_neurons_response. full_neurons. len( ) , 2 ) ;
607
+ assert_eq ! ( list_neurons_response. neuron_infos. len( ) , 2 ) ;
608
+ assert_eq ! ( list_neurons_response. full_neurons. len( ) , 1 ) ;
609
609
}
You can’t perform that action at this time.
0 commit comments