changed verification console log messages

This commit is contained in:
Joel Gustafson
2021-12-19 15:56:27 -05:00
parent e877b22504
commit ded1e91673
2 changed files with 21 additions and 21 deletions

View File

@@ -50,25 +50,25 @@ export const SelectGroup: React.FC<SelectGroupProps> = (props) => {
const [searchValue, setSearchValue] = useState("")
const [loading, setLoading] = useState(false)
const loadOptions = useDebouncedCallback<
(inputValue: string) => Promise<User[]>
>(async (inputValue: string) => {
setLoading(true)
const res = await fetch(
`/api/search/users?twitterHandle=${encodeURIComponent(inputValue)}`,
{ method: "POST" }
)
if (res.status === 200) {
const { users } = await res.json()
console.log("got users", users)
setLoading(false)
return users
} else {
setLoading(false)
return []
}
}, 500)
const loadOptions = useDebouncedCallback(
(inputValue: string, callback: (group: User[]) => void) => {
setLoading(true)
fetch(
`/api/search/users?twitterHandle=${encodeURIComponent(inputValue)}`,
{ method: "POST" }
).then(async (res) => {
if (res.status === 200) {
const { users } = await res.json()
setLoading(false)
callback(users)
} else {
setLoading(false)
callback([])
}
})
},
200
)
const isClearable = useMemo(
() => props.group.some((user) => user.publicKey !== user?.publicKey),

View File

@@ -53,7 +53,7 @@ export async function verifyMessage(
return false
}
console.log("message hash is good.")
console.log("message hashes match!")
console.log("verifying message proof...")
const verified = await snarkjs.groth16.verify(
vKeys.sign,
@@ -61,7 +61,7 @@ export async function verifyMessage(
message.proof
)
if (verified) {
console.log("message proof is good.")
console.log("message proof is valid!")
} else {
console.error("invalid message proof!")
}