From 43427cdaef46cd9259c7b38c48734211166b8caf Mon Sep 17 00:00:00 2001 From: peetzweg/ Date: Tue, 9 Apr 2024 13:36:43 +0200 Subject: [PATCH] removes encoding of salt during dryrun --- src/lib/callOptions.ts | 5 ----- src/ui/components/instantiate/Step2.tsx | 9 ++------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/lib/callOptions.ts b/src/lib/callOptions.ts index 6c47989a..ea1adef9 100644 --- a/src/lib/callOptions.ts +++ b/src/lib/callOptions.ts @@ -69,8 +69,3 @@ export function transformUserInput( }); } const encoder = new TextEncoder(); - -export function encodeSalt(salt: Uint8Array | string = randomAsU8a()): Uint8Array { - if (typeof salt === 'string') return encoder.encode(salt); - return salt; -} diff --git a/src/ui/components/instantiate/Step2.tsx b/src/ui/components/instantiate/Step2.tsx index b73e561f..3f7d4380 100644 --- a/src/ui/components/instantiate/Step2.tsx +++ b/src/ui/components/instantiate/Step2.tsx @@ -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'; @@ -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,