mirror of
https://github.com/stake-house/wagyu-key-gen.git
synced 2026-01-09 12:48:05 -05:00
fix: key generation error
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { Dispatch, SetStateAction, createContext, useContext, useState } from "react";
|
||||
import { Network, NetworkConfig } from "./types";
|
||||
import { GlobalContext } from "./GlobalContext";
|
||||
import { Dispatch, SetStateAction, createContext, useState } from "react";
|
||||
|
||||
interface KeyCreationContextType {
|
||||
folderLocation: string;
|
||||
@@ -52,7 +50,6 @@ const KeyCreationContextWrapper = ({ children }: { children: React.ReactNode}) =
|
||||
const [password, setPassword] = useState<string>("");
|
||||
const [withdrawalAddress, setWithdrawalAddress] = useState<string>("");
|
||||
const [compounding, setCompounding] = useState<boolean>(false);
|
||||
const { network } = useContext(GlobalContext);
|
||||
|
||||
return (
|
||||
<KeyCreationContext.Provider value={{
|
||||
@@ -64,7 +61,7 @@ const KeyCreationContextWrapper = ({ children }: { children: React.ReactNode}) =
|
||||
setMnemonic,
|
||||
numberOfKeys,
|
||||
setNumberOfKeys,
|
||||
amount: amount / NetworkConfig[network].multiplier,
|
||||
amount: amount,
|
||||
setAmount,
|
||||
password,
|
||||
setPassword,
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
} from "../constants";
|
||||
import { GlobalContext } from "../GlobalContext";
|
||||
import { KeyCreationContext } from "../KeyCreationContext";
|
||||
import { NetworkConfig } from "../types";
|
||||
|
||||
/**
|
||||
* Form to provide number of keys, index, password, and optional withdrawal address necessary to
|
||||
@@ -64,7 +65,7 @@ const ConfigureValidatorKeys = () => {
|
||||
const [inputIndex, setInputIndex] = useState(index);
|
||||
const [inputIndexError, setInputIndexError] = useState(false);
|
||||
|
||||
const [inputAmount, setInputAmount] = useState(amount);
|
||||
const [inputAmount, setInputAmount] = useState(amount / NetworkConfig[network].multiplier);
|
||||
const [inputAmountError, setInputAmountError] = useState(false);
|
||||
|
||||
const [inputPassword, setInputPassword] = useState(password);
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
} from "../constants";
|
||||
import { GlobalContext } from "../GlobalContext";
|
||||
import { KeyCreationContext } from "../KeyCreationContext";
|
||||
import { NetworkConfig } from "../types";
|
||||
|
||||
/**
|
||||
* Allows the user to select a destination folder for the validator keys.
|
||||
@@ -61,7 +62,7 @@ const CreateValidatorKeys = () => {
|
||||
}
|
||||
|
||||
// Convert user provided amount to integer representation of gwei
|
||||
const gweiAmount = parseInt((amount * ETH_TO_GWEI).toString());
|
||||
const gweiAmount = parseInt((amount * NetworkConfig[network].multiplier * ETH_TO_GWEI).toString());
|
||||
|
||||
window.eth2Deposit.generateKeys(
|
||||
mnemonic,
|
||||
|
||||
Reference in New Issue
Block a user