Skip to content

Commit

Permalink
removes encoding of salt during dryrun
Browse files Browse the repository at this point in the history
  • Loading branch information
peetzweg committed Apr 9, 2024
1 parent faac63d commit 43427cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/lib/callOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,3 @@ export function transformUserInput(
});
}
const encoder = new TextEncoder();

Check failure on line 71 in src/lib/callOptions.ts

View workflow job for this annotation

GitHub Actions / install

'encoder' is declared but its value is never read.

export function encodeSalt(salt: Uint8Array | string = randomAsU8a()): Uint8Array {
if (typeof salt === 'string') return encoder.encode(salt);
return salt;
}
9 changes: 2 additions & 7 deletions src/ui/components/instantiate/Step2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ import {
useBalance,
} from 'ui/hooks';
import { AbiMessage, Balance, OrFalsy } from 'types';
import {
decodeStorageDeposit,
encodeSalt,
getGasLimit,
getStorageDepositLimit,
} from 'lib/callOptions';
import { decodeStorageDeposit, getGasLimit, getStorageDepositLimit } from 'lib/callOptions';
import { BN_ZERO } from 'lib/bn';
import { hasRevertFlag } from 'lib/hasRevertFlag';

Expand Down Expand Up @@ -79,7 +74,7 @@ export function Step2() {
getStorageDepositLimit(storageDepositLimit.isActive, storageDepositLimit.value, api.registry),
codeHashUrlParam ? { Existing: codeHashUrlParam } : { Upload: metadata?.info.source.wasm },
inputData ?? '',
isUsingSalt ? encodeSalt(salt.value) : '',
isUsingSalt ? salt.value : '',
];
}, [
accountId,
Expand Down

0 comments on commit 43427cd

Please sign in to comment.