diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1fb88f1..f942dfc 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -151,8 +151,10 @@ jobs: export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH" ls node_modules/.bin npm i -g @coral-xyz/anchor-cli@${{ env.anchor_version }} ts-mocha typescript - anchor build + solana-test-validator > /dev/null & + sleep 5 anchor idl build + anchor deploy - name: run tests run: anchor test diff --git a/Anchor.toml b/Anchor.toml index 90822cb..f570286 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -10,7 +10,7 @@ bolt-system = "7X4EFsDJ5aYTcEjKzJ94rD8FRKgQeXC89fkpeTS4KaqP" component-position = "Fn1JzzEdyb55fsyduWS94mYHizGhJZuhvjX6DVvrmGbQ" component-velocity = "CbHEFbSQdRN4Wnoby9r16umnJ1zWbULBHg4yqzGQonU1" system-apply-velocity = "6LHhFVwif6N9Po3jHtSmMVtPjF6zRfL3xMosSzcrQAS8" -system-fly = "BAQXfRwpNE43pdkeajsffA4rEkFQxwmUEDZKJjQHuvAN" +system-fly = "HT2YawJjkNmqWcLNfPAMvNsLdWwPvvvbKA5bpMw4eUpq" system-simple-movement = "FSa6qoJXFBR3a7ThQkTAMrC15p6NkchPEjBdd4n6dXxA" world = "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" diff --git a/crates/bolt-lang/attribute/component/src/lib.rs b/crates/bolt-lang/attribute/component/src/lib.rs index 4ee1b7e..1f3847a 100644 --- a/crates/bolt-lang/attribute/component/src/lib.rs +++ b/crates/bolt-lang/attribute/component/src/lib.rs @@ -62,10 +62,11 @@ pub fn component(attr: TokenStream, item: TokenStream) -> TokenStream { let name = &input.ident; let component_name = syn::Ident::new(&name.to_string().to_lowercase(), input.ident.span()); + let mod_name = syn::Ident::new(&format!("component_{}", component_name), input.ident.span()); let anchor_program = quote! { #[bolt_program(#name)] - pub mod #component_name { + pub mod #mod_name { use super::*; } }; diff --git a/tests/bolt.ts b/tests/bolt.ts index e1bb7d2..b3f0342 100644 --- a/tests/bolt.ts +++ b/tests/bolt.ts @@ -1,8 +1,8 @@ import * as anchor from "@coral-xyz/anchor"; import { type Program } from "@coral-xyz/anchor"; import { PublicKey } from "@solana/web3.js"; -import { type Position } from "../target/types/position"; -import { type Velocity } from "../target/types/velocity"; +import { type ComponentPosition } from "../target/types/component_position"; +import { type ComponentVelocity } from "../target/types/component_velocity"; import { type BoltComponent } from "../target/types/bolt_component"; import { type SystemSimpleMovement } from "../target/types/system_simple_movement"; import { type SystemFly } from "../target/types/system_fly"; @@ -45,9 +45,9 @@ describe("bolt", () => { const worldProgram = anchor.workspace.World as Program; const boltComponentPositionProgram = anchor.workspace - .Position as Program; + .ComponentPosition as Program; const boltComponentVelocityProgram = anchor.workspace - .Velocity as Program; + .ComponentVelocity as Program; const boltComponentProgramOrigin = anchor.workspace .BoltComponent as Program;