Skip to content

Commit

Permalink
[refactor] Remove valueOf statements
Browse files Browse the repository at this point in the history
These statements are unnecessary, since they don't change values
  • Loading branch information
gregnazario committed Feb 29, 2024
1 parent 60eea49 commit 2dc28fb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/client/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export async function get<Req extends {}, Res extends {}>(
method: "GET",
originMethod,
path,
contentType: contentType?.valueOf(),
acceptType: acceptType?.valueOf(),
contentType,
acceptType,
params,
overrides: {
...aptosConfig.clientConfig,
Expand Down
4 changes: 2 additions & 2 deletions src/client/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export async function post<Req extends {}, Res extends {}>(
originMethod,
path,
body,
contentType: contentType?.valueOf(),
acceptType: acceptType?.valueOf(),
contentType,
acceptType,
params,
overrides: {
...aptosConfig.clientConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/internal/ans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,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),
};
}
2 changes: 1 addition & 1 deletion src/internal/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export async function getProcessorStatus(args: {
const { aptosConfig, processorType } = args;

const whereCondition: { processor: { _eq: string } } = {
processor: { _eq: processorType.valueOf() },
processor: { _eq: processorType },
};

const graphqlQuery = {
Expand Down
4 changes: 2 additions & 2 deletions src/internal/transactionSubmission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/ans/ans.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).getDate() / 1000);
await changeExpirationDate(1, newExpirationDate, name);

await signAndSubmit(alice, await aptos.renewDomain({ name, sender: alice }));
Expand Down

0 comments on commit 2dc28fb

Please sign in to comment.