Skip to content

Commit

Permalink
feat: removed unnecessary promise
Browse files Browse the repository at this point in the history
  • Loading branch information
70nyIT committed Feb 16, 2024
1 parent 75f59b9 commit f4e98fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/predictStealthSafeAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export async function predictStealthSafeAddressWithClient({
* @param useDefaultAddress {boolean} (optional) if true, the Safe default address will be used - see DefaultAddress inside https://github.com/safe-global/safe-deployments
* @return Promise<{ stealthSafeAddress }> the predicted Safe address (not deployed)
*/
export async function predictStealthSafeAddressWithBytecode({
export function predictStealthSafeAddressWithBytecode({
chainId,
safeProxyBytecode,
threshold,
Expand All @@ -115,7 +115,7 @@ export async function predictStealthSafeAddressWithBytecode({
stealthAddresses: string[];
chainId?: number;
useDefaultAddress?: boolean;
}): Promise<{ stealthSafeAddress: `0x${string}` }> {
}): { stealthSafeAddress: `0x${string}` } {
// if useDefaultAddress is false, chainId is required
if (!useDefaultAddress) {
assert(!!chainId, 'chainId is required when useDefaultAddress is false');
Expand Down
8 changes: 4 additions & 4 deletions test/predictStealthSafeAddress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('predictStealthSafeAddressWithBytecode', () => {
];
const expectedStealthSafeAddress = '0x695fd4ce104c325611ac1696fd4ba3568464810f';

const result = await predictStealthSafeAddressWithBytecode({
const result = predictStealthSafeAddressWithBytecode({
useDefaultAddress: true,
threshold,
stealthAddresses,
Expand All @@ -121,14 +121,14 @@ describe('predictStealthSafeAddressWithBytecode', () => {
'0xfe972d3976f7cc5ba1c9b471d48362b82c6c5fdd',
];

const resultWithUseDefaultAddress = await predictStealthSafeAddressWithBytecode({
const resultWithUseDefaultAddress = predictStealthSafeAddressWithBytecode({
useDefaultAddress: true,
threshold,
stealthAddresses,
safeProxyBytecode,
});

const resultWithChainMainnet = await predictStealthSafeAddressWithBytecode({
const resultWithChainMainnet = predictStealthSafeAddressWithBytecode({
chainId: 1,
threshold,
stealthAddresses,
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('predictStealthSafeAddressWithBytecode', () => {
fc.array(fc.hexaString({ minLength: 40, maxLength: 40 }).map(s => `0x${s}`), { minLength: 1, maxLength: 10 }),
async (chainId, stealthAddresses) => {
const threshold = Math.floor(Math.random() * stealthAddresses.length) + 1;
const result = await predictStealthSafeAddressWithBytecode({
const result = predictStealthSafeAddressWithBytecode({
chainId,
threshold,
stealthAddresses,
Expand Down

0 comments on commit f4e98fb

Please sign in to comment.