-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed calls to deprecated utils function in tests #2845
base: main
Are you sure you want to change the base?
Changes from 2 commits
f5a06d7
b363830
b7adadf
0c84d5b
0b73dc2
6de1de4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { stringToHex } from '@xrplf/isomorphic/utils' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Remove deprecated The deprecated
While the function internally uses the new 🔗 Analysis chainVerify complete removal of deprecated function Let's ensure all instances of the deprecated 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any remaining usage of convertStringToHex
rg "convertStringToHex" --type ts
# Search for all string-to-hex conversion patterns to ensure consistency
rg "(?i)(convert|to).*hex.*string" --type ts
Length of output: 4665 |
||
import { assert } from 'chai' | ||
|
||
import { | ||
|
@@ -8,7 +9,6 @@ import { | |
TxResponse, | ||
TxV1Response, | ||
} from '../../../src' | ||
import { convertStringToHex } from '../../../src/utils' | ||
import serverUrl from '../serverUrl' | ||
import { | ||
setupClient, | ||
|
@@ -35,7 +35,7 @@ describe('tx', function () { | |
const accountSet: AccountSet = { | ||
TransactionType: 'AccountSet', | ||
Account: account, | ||
Domain: convertStringToHex('example.com'), | ||
Domain: stringToHex('example.com'), | ||
} | ||
|
||
const response: SubmitResponse = await testContext.client.submit( | ||
|
@@ -82,7 +82,7 @@ describe('tx', function () { | |
const accountSet: AccountSet = { | ||
TransactionType: 'AccountSet', | ||
Account: account, | ||
Domain: convertStringToHex('example.com'), | ||
Domain: stringToHex('example.com'), | ||
} | ||
|
||
const response: SubmitResponse = await testContext.client.submit( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { stringToHex } from '@xrplf/isomorphic/utils' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Migration to The deprecated
These instances should also be removed to complete the migration to 🔗 Analysis chainLGTM! Consistent migration across all test cases The changes correctly replace all instances of the deprecated
Let's verify that we haven't missed any instances of the deprecated function: Also applies to: 39-39, 93-93, 111-111, 134-134 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any remaining instances of convertStringToHex
rg "convertStringToHex" --type ts
Length of output: 389 Script: #!/bin/bash
# Let's check if there are any remaining usages of convertStringToHex in the codebase
rg "convertStringToHex\(" --type ts -A 2
# Also check for any imports of convertStringToHex
rg "import.*convertStringToHex" --type ts
Length of output: 412 |
||
import { assert } from 'chai' | ||
|
||
import { AccountSet, convertStringToHex, ValidationError } from '../../src' | ||
import { AccountSet, ValidationError } from '../../src' | ||
import { assertRejects } from '../testUtils' | ||
|
||
import serverUrl from './serverUrl' | ||
|
@@ -35,7 +36,7 @@ describe('client.submitAndWait', function () { | |
const accountSet: AccountSet = { | ||
TransactionType: 'AccountSet', | ||
Account: testContext.wallet.classicAddress, | ||
Domain: convertStringToHex('example.com'), | ||
Domain: stringToHex('example.com'), | ||
} | ||
|
||
let retries = 10 | ||
|
@@ -89,7 +90,7 @@ describe('client.submitAndWait', function () { | |
const accountSet: AccountSet = { | ||
TransactionType: 'AccountSet', | ||
Account: testContext.wallet.classicAddress, | ||
Domain: convertStringToHex('example.com'), | ||
Domain: stringToHex('example.com'), | ||
} | ||
|
||
await assertRejects( | ||
|
@@ -107,7 +108,7 @@ describe('client.submitAndWait', function () { | |
const accountSet: AccountSet = { | ||
TransactionType: 'AccountSet', | ||
Account: testContext.wallet.classicAddress, | ||
Domain: convertStringToHex('example.com'), | ||
Domain: stringToHex('example.com'), | ||
} | ||
const { tx_blob: signedAccountSet } = testContext.wallet.sign( | ||
await testContext.client.autofill(accountSet), | ||
|
@@ -130,7 +131,7 @@ describe('client.submitAndWait', function () { | |
const accountSet: AccountSet = { | ||
TransactionType: 'AccountSet', | ||
Account: testContext.wallet.classicAddress, | ||
Domain: convertStringToHex('example.com'), | ||
Domain: stringToHex('example.com'), | ||
} | ||
const { tx_blob: signedAccountSet } = testContext.wallet.sign( | ||
await testContext.client.autofill(accountSet), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Migration is incomplete -
convertStringToHex
is still present in the codebaseThe deprecated
convertStringToHex
function is still present in:packages/xrpl/src/utils/stringConversion.ts
(function definition)packages/xrpl/src/utils/index.ts
(import and re-export)While the function internally uses
stringToHex
, its presence might confuse developers. Consider:stringToHex
directly🔗 Analysis chain
Verify complete migration from deprecated function
Let's ensure there are no remaining instances of the deprecated
convertStringToHex
function in the codebase.Let me gather more information to understand if the old function is still being used or just defined.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1937
Script:
Length of output: 581