Skip to content

Commit

Permalink
fix: enum name
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomariscal committed Jul 18, 2024
1 parent 0f9bc0e commit 64d049c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const StealthActionsExample = () => {
useState<`0x${string}`>();
const [error, setError] = useState<string | null>(null);

enum CURRENT_STEP {
enum CurrentStep {
GENERATE_STEALTH_ADDRESS = 1,
SEND_TO_STEALTH_ADDRESS = 2,
TRANSFER_FROM_STEALTH_ADDRESS = 3,
TRANSFER_FROM_STEALTH_ADDRESS_COMPLETE = 4
}

const [currentStep, setCurrentStep] = useState(
CURRENT_STEP.GENERATE_STEALTH_ADDRESS
CurrentStep.GENERATE_STEALTH_ADDRESS
);

const {
Expand Down Expand Up @@ -90,7 +90,7 @@ const StealthActionsExample = () => {
try {
const [address] = await walletClient.requestAddresses();
setConnectedAccount(address);
setCurrentStep(CURRENT_STEP.GENERATE_STEALTH_ADDRESS);
setCurrentStep(CurrentStep.GENERATE_STEALTH_ADDRESS);
} catch (error) {
handleError('Error connecting wallet');
}
Expand All @@ -116,7 +116,7 @@ const StealthActionsExample = () => {
schemeId: SCHEME_ID
});
setStealthAddressDetails(details);
setCurrentStep(CURRENT_STEP.SEND_TO_STEALTH_ADDRESS);
setCurrentStep(CurrentStep.SEND_TO_STEALTH_ADDRESS);
} catch (error) {
handleError('Error generating stealth address');
}
Expand All @@ -133,7 +133,7 @@ const StealthActionsExample = () => {
value: parseEther(SEND_AMOUNT)
});
setSendToStealthTxHash(hash);
setCurrentStep(CURRENT_STEP.TRANSFER_FROM_STEALTH_ADDRESS);
setCurrentStep(CurrentStep.TRANSFER_FROM_STEALTH_ADDRESS);
} catch (error) {
handleError('Error sending to stealth address');
}
Expand Down Expand Up @@ -163,7 +163,7 @@ const StealthActionsExample = () => {
value: parseEther(WITHDRAW_AMOUNT)
});
setTransferFromStealthTxHash(hash);
setCurrentStep(CURRENT_STEP.TRANSFER_FROM_STEALTH_ADDRESS_COMPLETE);
setCurrentStep(CurrentStep.TRANSFER_FROM_STEALTH_ADDRESS_COMPLETE);
} catch (error) {
handleError('Error transferring from stealth address');
}
Expand All @@ -172,7 +172,7 @@ const StealthActionsExample = () => {
const handleError = (msg: string) => {
console.error(msg);
setError(msg);
setCurrentStep(CURRENT_STEP.GENERATE_STEALTH_ADDRESS);
setCurrentStep(CurrentStep.GENERATE_STEALTH_ADDRESS);
};

useEffect(() => {
Expand Down

0 comments on commit 64d049c

Please sign in to comment.