Skip to content

Commit

Permalink
Prepare v0.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar Oostendorp committed Feb 27, 2024
1 parent 68edbab commit 7c9408c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include .account
export

REPO = ghcr.io/pixelaw/core
CORE_VERSION = 0.1.11
CORE_VERSION = 0.1.12
KEIKO_VERSION = v0.1.5


Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.11
0.1.12
2 changes: 1 addition & 1 deletion deployment/demo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: "0.0.45"
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.11"
appVersion: "0.1.12"
2 changes: 1 addition & 1 deletion deployment/test/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: "0.0.45"
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.11"
appVersion: "0.1.12"
5 changes: 3 additions & 2 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ function App() {
}

let errorMessage = ''

if(setupQuery.isError){
errorMessage = `setupQuery Error: ${setupQuery.error}`
}
console.log({ setupQuery, checkManifests })
if(setupQuery.error) console.error(setupQuery.error)

if (checkRpcUrl.isError) {
errorMessage = `PUBLIC_NODE_URL error: ${checkRpcUrl.error.message}. If this is happening in your local environment, Katana might not be up.`
Expand Down
2 changes: 0 additions & 2 deletions web/src/dojo/createSystemCalls.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { Account, num, TransactionStatus } from 'starknet'
import { ZERO_ADDRESS } from '@/global/constants'
import { IWorld } from '@/dojo/generated'
import { ContractComponents } from '@/dojo/contractComponents'

const FAILURE_REASON_REGEX = /Failure reason: ".+"/;

export type SystemCalls = ReturnType<typeof createSystemCalls>;

export function createSystemCalls(
{ client }: { client: IWorld },
contractComponents: ContractComponents,
) {

/**
Expand Down
21 changes: 12 additions & 9 deletions web/src/dojo/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,41 @@ import { PUBLIC_TORII } from '@/global/constants'
export type SetupResult = Awaited<ReturnType<typeof setup>>;

export async function setup({ ...config }: DojoConfig) {
console.log("setup: createClient")
console.group('setup');

console.log("torii.createClient")
// torii client
const toriiClient = await torii.createClient([], {
rpcUrl: config.rpcUrl,
toriiUrl: config.toriiUrl,
worldAddress: config.manifest.world.address || "",
});

console.log("setup: defineContractComponents")
console.log("defineContractComponents")

// create contract components
const contractComponents = defineContractComponents(world);

console.log("setup: createClientComponents")
console.log("createClientComponents")

// create client components
const clientComponents = createClientComponents({ contractComponents });

console.log("getting entities")
console.log("getSyncEntities")
// fetch all existing entities from torii
await getSyncEntities(toriiClient, contractComponents as any);

console.log("getting entities: new DojoProvider")
console.log("new DojoProvider")

// create dojo provider
const dojoProvider = new DojoProvider(config.manifest, config.rpcUrl);

console.log("getting entities: setupWorld")
console.log("setupWorld")

// setup world
const client = await setupWorld(dojoProvider);

console.log("new BurnerManager")
// create burner manager
const burnerManager = new BurnerManager({
masterAccount: new Account(
Expand All @@ -65,23 +68,23 @@ export async function setup({ ...config }: DojoConfig) {
console.error(e);
}
}
console.log("burnerManager.init()")

await burnerManager.init();

// Utility function to get the SDK.
// Add in new queries or subscriptions in src/graphql/schema.graphql
// then generate them using the codegen and fix-codegen commands in package.json
const createGraphSdk = () => getSdk(new GraphQLClient(`${PUBLIC_TORII}/graphql`));

console.groupEnd();
return {
client,
clientComponents,
contractComponents,
// Define the graph SDK instance.
graphSdk: createGraphSdk(),
systemCalls: createSystemCalls(
{ client },
contractComponents
{ client }
),
config,
dojoProvider,
Expand Down

0 comments on commit 7c9408c

Please sign in to comment.