aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/src
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2017-12-25 08:02:01 +0800
committerBrandon Millman <brandon.millman@gmail.com>2017-12-25 08:02:01 +0800
commit9f3acf8e2888b6105062e47664ecd5adaaf3c889 (patch)
tree2dba9c402dedee2be62bde7f5eaa21432efce0c1 /packages/connect/src
parentcbf06b2165715aaadf1afb6fb84040837a7a8827 (diff)
downloaddexon-sol-tools-9f3acf8e2888b6105062e47664ecd5adaaf3c889.tar
dexon-sol-tools-9f3acf8e2888b6105062e47664ecd5adaaf3c889.tar.gz
dexon-sol-tools-9f3acf8e2888b6105062e47664ecd5adaaf3c889.tar.bz2
dexon-sol-tools-9f3acf8e2888b6105062e47664ecd5adaaf3c889.tar.lz
dexon-sol-tools-9f3acf8e2888b6105062e47664ecd5adaaf3c889.tar.xz
dexon-sol-tools-9f3acf8e2888b6105062e47664ecd5adaaf3c889.tar.zst
dexon-sol-tools-9f3acf8e2888b6105062e47664ecd5adaaf3c889.zip
Prevent getFeesAsync method on HttpClient from mutating input
Diffstat (limited to 'packages/connect/src')
-rw-r--r--packages/connect/src/http_client.ts6
-rw-r--r--packages/connect/src/utils/type_converters.ts5
2 files changed, 0 insertions, 11 deletions
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts
index 924421f63..da052ba3c 100644
--- a/packages/connect/src/http_client.ts
+++ b/packages/connect/src/http_client.ts
@@ -112,12 +112,6 @@ export class HttpClient implements Client {
*/
public async getFeesAsync(request: FeesRequest): Promise<FeesResponse> {
assert.doesConformToSchema('request', request, schemas.relayerApiFeesPayloadSchema);
- typeConverters.convertBigNumberFieldsToStrings(request, [
- 'makerTokenAmount',
- 'takerTokenAmount',
- 'expirationUnixTimestampSec',
- 'salt',
- ]);
const requestOpts = {
payload: request,
};
diff --git a/packages/connect/src/utils/type_converters.ts b/packages/connect/src/utils/type_converters.ts
index c136382fd..28810af1a 100644
--- a/packages/connect/src/utils/type_converters.ts
+++ b/packages/connect/src/utils/type_converters.ts
@@ -18,11 +18,6 @@ export const typeConverters = {
'salt',
]);
},
- convertBigNumberFieldsToStrings(obj: object, fields: string[]): void {
- _.each(fields, field => {
- _.update(obj, field, (value: BigNumber) => value.toString());
- });
- },
convertStringsFieldsToBigNumbers(obj: object, fields: string[]): void {
_.each(fields, field => {
_.update(obj, field, (value: string) => new BigNumber(value));