Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LS V1.1 #574

Merged
merged 6 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
- get block hash for start block + 1
- interlude should be 2 blocks
- change set entropy method name
starknetdev committed Mar 13, 2024
commit 20ed8eed6f208ff4184af6d5b80e5bd62cd841c1
4 changes: 3 additions & 1 deletion ui/src/app/containers/BeastScreen.tsx
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import { Button } from "@/app/components/buttons/Button";
import useUIStore from "@/app/hooks/useUIStore";
import InterludeScreen from "@/app/containers/InterludeScreen";
import ActionMenu from "@/app/components/menu/ActionMenu";
import { getBlock } from "@/app/api/api";

interface BeastScreenProps {
attack: (
@@ -75,7 +76,8 @@ export default function BeastScreen({
action: async () => {
resetNotification();
if (adventurer?.level === 1) {
await attack(false, beastData, blockData?.block_hash);
const entropyBlockData = await getBlock(adventurer?.startBlock! + 1);
await attack(false, beastData, entropyBlockData?.block_hash);
} else {
await attack(false, beastData);
}
2 changes: 1 addition & 1 deletion ui/src/app/containers/InterludeScreen.tsx
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ export default function InterludeScreen({
const nextBlockHashBlock = adventurer?.revealBlock!;
const adventurerStartBlock = adventurer?.startBlock!;
const blockDifference = nextBlockHashBlock - adventurerStartBlock;
const secondsUntilNextEntropy = (blockDifference + 1) * averageBlockTime; // add one for closer estimate
const secondsUntilNextEntropy = (blockDifference + 2) * averageBlockTime; // add one for closer estimate
const adventurerCreatedTime = new Date(adventurer?.createdTime!).getTime();
const nextEntropyTime =
adventurerCreatedTime + secondsUntilNextEntropy * 1000;
2 changes: 1 addition & 1 deletion ui/src/app/lib/utils/syscalls.ts
Original file line number Diff line number Diff line change
@@ -710,7 +710,7 @@ export function syscalls({
// First we send the current block hash to the contract
const setBlockHashTx: Call = {
contractAddress: gameContract?.address ?? "",
entrypoint: "set_block_hash",
entrypoint: "set_starting_entropy",
calldata: [blockHash!],
};
const attackTx: Call = {