Skip to content

Commit 1ee6047

Browse files
committed
fixed insufficient gas error
1 parent b242dc3 commit 1ee6047

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-app/src/page/Battle.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const Battle = () => {
7070
};
7171

7272
if (contract && gameData.activeBattle) getPlayerInfo();
73-
}, [contract, gameData, battleName, battleStateChange]);
73+
}, [contract, gameData, battleName, battleStateChange, writeContracts]);
7474

7575
useEffect(() => {
7676
const timer = setTimeout(() => {
@@ -85,7 +85,7 @@ const Battle = () => {
8585

8686
try {
8787
// await contract.attackOrDefendChoice(choice, battleName, { gasLimit: 200000 });
88-
await tx(writeContracts.AVAXGods.attackOrDefendChoice(choice, battleName, { gasLimit: 200000 }), update => {
88+
await tx(writeContracts.AVAXGods.attackOrDefendChoice(choice, battleName, { gasLimit: 300000 }), update => {
8989
if (update && (update.status === "confirmed" || update.status === 1)) {
9090
setBattleStateChange(!battleStateChange);
9191
setShowAlert({
@@ -94,7 +94,7 @@ const Battle = () => {
9494
message: `Initiating ${choice === 1 ? "attack" : "defense"}`,
9595
});
9696
} else {
97-
console.log(update);
97+
console.log(update.message);
9898
}
9999
});
100100
} catch (error) {

0 commit comments

Comments
 (0)