Skip to content

Commit 9e45d2c

Browse files
committed
fix: fix a response data
1 parent d3edc3c commit 9e45d2c

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

src/provider/jsonrpc/jsonrpc.test.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,9 @@ describe('JSON-RPC Provider', () => {
4949
};
5050

5151
const mockABCIResponse: ABCIResponse = mock<ABCIResponse>();
52-
mockABCIResponse.response.ResponseBase = {
53-
Log: '',
54-
Info: '',
55-
Error: null,
56-
Events: null,
57-
Data: stringToBase64(JSON.stringify(mockSimulateResponse)),
58-
};
52+
mockABCIResponse.response.Value = stringToBase64(
53+
JSON.stringify(mockSimulateResponse)
54+
);
5955

6056
mockedAxios.post.mockResolvedValue({
6157
data: newResponse<ABCIResponse>(mockABCIResponse),

src/provider/jsonrpc/jsonrpc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class JSONRPCProvider implements Provider {
6262
);
6363

6464
const simulateResult = extractSimulateFromResponse(
65-
abciResponse.response.ResponseBase.Data
65+
abciResponse.response.Value
6666
);
6767
return simulateResult.GasUsed;
6868
}

src/provider/websocket/ws.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ describe('WS Provider', () => {
103103
Height: '',
104104
Key: '',
105105
Proof: null,
106-
Value: null,
106+
Value: stringToBase64(JSON.stringify(mockSimulateResponse)),
107107
ResponseBase: {
108108
Log: '',
109109
Info: '',
110110
Error: null,
111111
Events: null,
112-
Data: stringToBase64(JSON.stringify(mockSimulateResponse)),
112+
Data: '',
113113
},
114114
},
115115
};

src/provider/websocket/ws.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class WSProvider implements Provider {
165165
const abciResponse = this.parseResponse<ABCIResponse>(response);
166166

167167
const simulateResult = extractSimulateFromResponse(
168-
abciResponse.response.ResponseBase.Data
168+
abciResponse.response.Value
169169
);
170170
return simulateResult.GasUsed;
171171
}

0 commit comments

Comments
 (0)