File tree 2 files changed +14
-3
lines changed
substrate/client/rpc-spec-v2/src
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change
1
+ title: Rename archive call method result to value
2
+
3
+ doc:
4
+ - audience: [Node Dev, Node Operator]
5
+ description: |
6
+ Previously, the method result was encoded to a json containing a "result" field. However,
7
+ the spec specifies a "value" field. This aims to rectify that.
8
+
9
+ crates:
10
+ - name: sc-rpc-spec-v2
11
+ bump: major
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ pub enum MethodResult {
49
49
impl MethodResult {
50
50
/// Constructs a successful result.
51
51
pub fn ok ( result : impl Into < String > ) -> MethodResult {
52
- MethodResult :: Ok ( MethodResultOk { success : true , result : result. into ( ) } )
52
+ MethodResult :: Ok ( MethodResultOk { success : true , value : result. into ( ) } )
53
53
}
54
54
55
55
/// Constructs an error result.
@@ -65,7 +65,7 @@ pub struct MethodResultOk {
65
65
/// Method was successful.
66
66
success : bool ,
67
67
/// The result of the method.
68
- pub result : String ,
68
+ pub value : String ,
69
69
}
70
70
71
71
/// The error result of an RPC method.
@@ -92,7 +92,7 @@ mod tests {
92
92
let ok = MethodResult :: ok ( "hello" ) ;
93
93
94
94
let ser = serde_json:: to_string ( & ok) . unwrap ( ) ;
95
- let exp = r#"{"success":true,"result ":"hello"}"# ;
95
+ let exp = r#"{"success":true,"value ":"hello"}"# ;
96
96
assert_eq ! ( ser, exp) ;
97
97
98
98
let ok_dec: MethodResult = serde_json:: from_str ( exp) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments