Compare commits

..

4 Commits

Author SHA1 Message Date
Valtteri Karesto
5aeed7c246 Few more changes to deleteHook function 2022-03-29 15:23:30 +03:00
Valtteri Karesto
8d03edc299 Fixes issue #148 2022-03-29 14:03:06 +03:00
Valtteri Karesto
4519906b78 hotfix/remove-console-log 2022-03-28 15:35:27 +03:00
Valtteri Karesto
88a47c49a4 Merge pull request #149 from eqlabs/fix/fix-hook-params
Convert hook params to hex blobs
2022-03-28 15:33:23 +03:00
2 changed files with 11 additions and 6 deletions

View File

@@ -249,6 +249,7 @@ export const AccountDialog = ({
<Button
size="xs"
outline
disabled={activeAccount.isLoading}
css={{ mt: "$3", mr: "$1", ml: "auto" }}
onClick={() => {
deleteHook(activeAccount);

View File

@@ -81,7 +81,7 @@ export const deployHook = async (account: IAccount & { name?: string }, data: Se
// }
// }
// });
console.log(filteredHookParameters)
if (typeof window !== "undefined") {
const tx = {
Account: account.address,
@@ -153,13 +153,18 @@ export const deleteHook = async (account: IAccount & { name?: string }) => {
if (!state.client) {
return;
}
const currentAccount = state.accounts.find(
(acc) => acc.address === account.address
);
if (currentAccount?.isLoading || !currentAccount?.hooks.length) {
return
}
if (typeof window !== "undefined") {
const tx = {
Account: account.address,
TransactionType: "SetHook",
Sequence: account.sequence,
Fee: "1000000",
Fee: "100000",
Hooks: [
{
Hook: {
@@ -172,9 +177,7 @@ export const deleteHook = async (account: IAccount & { name?: string }) => {
const keypair = derive.familySeed(account.secret);
const { signedTransaction } = sign(tx, keypair);
const currentAccount = state.accounts.find(
(acc) => acc.address === account.address
);
if (currentAccount) {
currentAccount.isLoading = true;
}
@@ -196,6 +199,7 @@ export const deleteHook = async (account: IAccount & { name?: string }) => {
type: "success",
message: `[${submitRes.engine_result}] ${submitRes.engine_result_message} Validated ledger index: ${submitRes.validated_ledger_index}`,
});
currentAccount.hooks = [];
} else {
toast.error(`${submitRes.engine_result_message || submitRes.error_exception}`, { id: toastId })
state.deployLogs.push({