Skip to content

Commit

Permalink
changed branch to testnet (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouiseMedova authored Feb 24, 2023
1 parent d0e45fc commit b529d11
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 1,363 deletions.
1,599 changes: 258 additions & 1,341 deletions contracts/tamagotchi-battle/contracts/Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/tamagotchi-battle/contracts/battle/.binpath
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../target/wasm32-unknown-unknown/release/battle
../target/wasm32-unknown-unknown/release/battle
8 changes: 4 additions & 4 deletions contracts/tamagotchi-battle/contracts/battle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ version = "0.1.0"
edition = "2021"

[dependencies]
gstd = { git = "https://github.com/gear-tech/gear.git",features = ["debug"], branch = "stable" }
gstd = { git = "https://github.com/gear-tech/gear.git",features = ["debug"], branch = "testnet" }
codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false }
battle-io = { path = "io" }
tmg-io = { path = "../tamagotchi/io" }
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
hex-literal = "0.3.4"

[build-dependencies]
gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git"}
gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", branch = "testnet"}
battle-io = { path = "io" }

[dev-dependencies]
gtest = { git = "https://github.com/gear-tech/gear.git", branch = "stable"}
gclient = { git = "https://github.com/gear-tech/gear.git", branch = "stable" }
gtest = { git = "https://github.com/gear-tech/gear.git", branch = "testnet"}
gclient = { git = "https://github.com/gear-tech/gear.git", branch = "testnet" }
tokio = "1"
hex = "0.4"
battle-state = { path = "state" }
4 changes: 2 additions & 2 deletions contracts/tamagotchi-battle/contracts/battle/io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"] , branch = "stable"}
gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"], branch = "testnet"}
codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false }
gmeta = { git = "https://github.com/gear-tech/gear.git" }
gmeta = { git = "https://github.com/gear-tech/gear.git", branch = "testnet" }
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
6 changes: 3 additions & 3 deletions contracts/tamagotchi-battle/contracts/battle/state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = "0.2.0"
edition = "2021"

[dependencies]
gstd = { git = "https://github.com/gear-tech/gear.git", branch = "stable" }
gmeta = { git = "https://github.com/gear-tech/gear.git", branch = "stable", features = ["codegen"] }
gstd = { git = "https://github.com/gear-tech/gear.git", branch = "testnet" }
gmeta = { git = "https://github.com/gear-tech/gear.git", branch = "testnet", features = ["codegen"] }
battle-io = { path = "../io" }

[build-dependencies]
gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", branch = "stable", features = ["metawasm"] }
gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", branch = "testnet", features = ["metawasm"] }
12 changes: 6 additions & 6 deletions contracts/tamagotchi-battle/contracts/battle/state/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ use gmeta::metawasm;
use gstd::{prelude::*, ActorId};

#[metawasm]
pub trait Metawasm {
type State = Battle;
pub mod metafns {
pub type State = Battle;

fn player(tmg_id: ActorId, state: Self::State) -> Player {
pub fn player(state: State, tmg_id: ActorId) -> Player {
state
.players
.get(&tmg_id)
.unwrap_or(&Default::default())
.clone()
}

fn power_and_health(tmg_id: ActorId, state: Self::State) -> (u16, u16) {
pub fn power_and_health(state: State, tmg_id: ActorId) -> (u16, u16) {
let player = state
.players
.get(&tmg_id)
Expand All @@ -24,11 +24,11 @@ pub trait Metawasm {
(player.power, player.health)
}

fn round(state: Self::State) -> Round {
pub fn round(state: State) -> Round {
state.round
}

fn battle_state(state: Self::State) -> BattleState {
pub fn battle_state(state: State) -> BattleState {
state.state
}
}
2 changes: 1 addition & 1 deletion contracts/tamagotchi-battle/contracts/tamagotchi/.binpath
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../target/wasm32-unknown-unknown/release/tmg
../target/wasm32-unknown-unknown/debug/tmg
6 changes: 3 additions & 3 deletions contracts/tamagotchi-battle/contracts/tamagotchi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ version = "0.1.0"
edition = "2021"

[dependencies]
gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"], branch = "stable" }
gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"], branch = "testnet" }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = ["derive", "full"] }
tmg-io = { path = "io" }

[build-dependencies]
gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git" , branch = "stable" }
gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git" , branch = "testnet" }
tmg-io = { path = "io" }

[dev-dependencies]
gtest = { git = "https://github.com/gear-tech/gear.git", branch = "stable" }
gtest = { git = "https://github.com/gear-tech/gear.git", branch = "testnet" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
gmeta = { git = "https://github.com/gear-tech/gear.git" , branch = "stable" }
gstd = { git = "https://github.com/gear-tech/gear.git" , branch = "stable"}
gmeta = { git = "https://github.com/gear-tech/gear.git" , branch = "testnet" }
gstd = { git = "https://github.com/gear-tech/gear.git" , branch = "testnet"}
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = ["derive", "full"] }

0 comments on commit b529d11

Please sign in to comment.