From f16f279259f5c04a1308640b0a1d5c7868c22f2a Mon Sep 17 00:00:00 2001 From: Greg Nazario Date: Wed, 20 Mar 2024 21:26:10 -0700 Subject: [PATCH] [refactor] Remove valueOf() --- src/client/get.ts | 4 ++-- src/client/post.ts | 4 ++-- src/internal/ans.ts | 2 +- src/internal/general.ts | 2 +- src/internal/transactionSubmission.ts | 4 ++-- tests/e2e/ans/ans.test.ts | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/get.ts b/src/client/get.ts index 35f569403..68c83b871 100644 --- a/src/client/get.ts +++ b/src/client/get.ts @@ -59,8 +59,8 @@ export async function get( method: "GET", originMethod, path, - contentType: contentType?.valueOf(), - acceptType: acceptType?.valueOf(), + contentType, + acceptType, params, overrides: { ...aptosConfig.clientConfig, diff --git a/src/client/post.ts b/src/client/post.ts index 74eab5e94..92189744e 100644 --- a/src/client/post.ts +++ b/src/client/post.ts @@ -67,8 +67,8 @@ export async function post( originMethod, path, body, - contentType: contentType?.valueOf(), - acceptType: acceptType?.valueOf(), + contentType, + acceptType, params, overrides: { ...aptosConfig.clientConfig, diff --git a/src/internal/ans.ts b/src/internal/ans.ts index 17300232c..05b070c4d 100644 --- a/src/internal/ans.ts +++ b/src/internal/ans.ts @@ -570,6 +570,6 @@ export async function renewDomain(args: { function sanitizeANSName(name: GetANSNameResponse[0]): GetANSNameResponse[0] { return { ...name, - expiration_timestamp: new Date(name.expiration_timestamp).valueOf(), + expiration_timestamp: new Date(name.expiration_timestamp).getTime(), }; } diff --git a/src/internal/general.ts b/src/internal/general.ts index 4ea17c1aa..7844957a5 100644 --- a/src/internal/general.ts +++ b/src/internal/general.ts @@ -168,7 +168,7 @@ export async function getProcessorStatus(args: { const { aptosConfig, processorType } = args; const whereCondition: { processor: { _eq: string } } = { - processor: { _eq: processorType.valueOf() }, + processor: { _eq: processorType }, }; const graphqlQuery = { diff --git a/src/internal/transactionSubmission.ts b/src/internal/transactionSubmission.ts index 007e40f94..37c9610b2 100644 --- a/src/internal/transactionSubmission.ts +++ b/src/internal/transactionSubmission.ts @@ -365,9 +365,9 @@ export async function rotateAuthKey(args: { data: { function: "0x1::account::rotate_authentication_key", functionArguments: [ - new U8(fromAccount.signingScheme.valueOf()), // from scheme + new U8(fromAccount.signingScheme), // from scheme MoveVector.U8(fromAccount.publicKey.toUint8Array()), - new U8(newAccount.signingScheme.valueOf()), // to scheme + new U8(newAccount.signingScheme), // to scheme MoveVector.U8(newAccount.publicKey.toUint8Array()), MoveVector.U8(proofSignedByCurrentPrivateKey.toUint8Array()), MoveVector.U8(proofSignedByNewPrivateKey.toUint8Array()), diff --git a/tests/e2e/ans/ans.test.ts b/tests/e2e/ans/ans.test.ts index 7bdc361dc..4c227c4a4 100644 --- a/tests/e2e/ans/ans.test.ts +++ b/tests/e2e/ans/ans.test.ts @@ -478,7 +478,7 @@ describe("ANS", () => { ); // Change the expiration date of the name to be tomorrow - const newExpirationDate = Math.floor(new Date(Date.now() + 1 * 24 * 60 * 60 * 1000).valueOf() / 1000); + const newExpirationDate = Math.floor(new Date(Date.now() + 24 * 60 * 60 * 1000).getTime() / 1000); await changeExpirationDate(1, newExpirationDate, name); await signAndSubmit(alice, await aptos.renewDomain({ name, sender: alice }));