Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
dynm committed Sep 16, 2022
2 parents 5687bea + 6584897 commit db87d77
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mfer-safe-desktop-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mfer-safe-desktop-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mfer-safe",
"version": "0.1.5",
"version": "0.1.6",
"private": true,
"dependencies": {
"@emotion/react": "^11.9.3",
Expand Down
2 changes: 1 addition & 1 deletion mfer-safe-desktop-app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "MferSafe",
"version": "0.1.5"
"version": "0.1.6"
},
"tauri": {
"allowlist": {
Expand Down
20 changes: 20 additions & 0 deletions mfer-safe-desktop-app/src/SettingsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import LanIcon from "@mui/icons-material/Lan";
import MapIcon from "@mui/icons-material/Map";
import ConfirmationNumberIcon from "@mui/icons-material/ConfirmationNumber";
import MoreTimeIcon from "@mui/icons-material/MoreTime";
import FingerprintIcon from '@mui/icons-material/Fingerprint';
import { ethers } from "ethers";
import { invoke } from "@tauri-apps/api/tauri";

Expand Down Expand Up @@ -54,6 +55,7 @@ export default function SettingsView() {
const [batchSize, setBatchSize] = useState(100);
const [blockNumberDelta, setBlockNumberDelta] = useState(0);
const [blockTimeDelta, setBlockTimeDelta] = useState(0);
const [chainID, setChainID] = useState("0x0");
const [keyCacheFilePath, setKeyCacheFilePath] = useState("");
const [addrRandomize, setAddrRandomize] = useState(false);
const [passthrough, setPassthrough] = useState(true);
Expand Down Expand Up @@ -87,6 +89,11 @@ export default function SettingsView() {
.then((result) => {
setBlockTimeDelta(result.result);
});
docall("eth_chainId", [])
.then((res) => res.json())
.then((result) => {
setChainID(result.result);
});

docall("mfer_randAddrEnabled", [])
.then((res) => res.json())
Expand Down Expand Up @@ -152,6 +159,10 @@ export default function SettingsView() {
docall("mfer_setTimeDelta", [Number(blockTimeDelta)]);
}, [blockTimeDelta]);

const setCID = useCallback(() => {
docall("mfer_overrideChainID", [chainID]);
}, [chainID]);

const setEnableRandAddr = (e) => {
docall("mfer_toggleRandAddr", [e.target.checked]);
setAddrRandomize(e.target.checked);
Expand Down Expand Up @@ -216,6 +227,15 @@ export default function SettingsView() {
icon={ViewModuleIcon}
onClick={() => setBatch()}
/>
<IconButtonTextField
state={chainID}
setState={setChainID}
label="Override ChainID (hex with 0x prefix)"
icon={FingerprintIcon}
onClick={() => setCID()}
/>
</Stack>
<Stack direction="row" width="100%">
<IconButtonTextField
state={blockNumberDelta}
setState={setBlockNumberDelta}
Expand Down
6 changes: 3 additions & 3 deletions mfer-safe-desktop-app/src/SimulateView.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function SimulateView() {
simulate(setCallTrace, participants);
}}
>
🙉Simulate
Build and Simulate ⛑️
</Button>
</div>
<TextField
Expand All @@ -193,10 +193,10 @@ function SimulateView() {
{participants.map((participant, idx) => {
// console.log(participant);
return <TextField
label={participant}
label={"Address: " + participant}
key={idx}
helperText="Signature override"
value={overrideSignature[participant] || ""}
value={ overrideSignature[participant] || ""}
onChange={(e) => {
var sig = e.target.value;
var newOverridedSig = { ...overrideSignature, [participant]: sig };
Expand Down

0 comments on commit db87d77

Please sign in to comment.