Skip to content

Commit

Permalink
tic-tac-toe backend part (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevoronov committed Feb 24, 2019
1 parent 83b1a61 commit 2b868c0
Show file tree
Hide file tree
Showing 13 changed files with 1,259 additions and 2 deletions.
21 changes: 19 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ lazy val `vm-hello-world2-2018` = (project in file("vm/examples/hello-world2/app
)

lazy val `vm-hello-world2-runner` = (project in file("vm/examples/hello-world2/runner"))
.configs(IntegrationTest)
.settings(inConfig(IntegrationTest)(Defaults.itSettings): _*)
.settings(
commons,
libraryDependencies ++= Seq(
Expand All @@ -82,6 +80,25 @@ lazy val `vm-llamadb` = (project in file("vm/examples/llamadb"))
rustVmExample("llamadb")
)

lazy val `tic-tac-toe` = (project in file("vm/examples/tic-tac-toe/app"))
.settings(
rustVmExample("tic-tac-toe/app")
)

lazy val `tic-tac-toe-runner` = (project in file("vm/examples/tic-tac-toe/runner"))
.settings(
commons,
libraryDependencies ++= Seq(
asmble,
cats,
catsEffect,
pureConfig,
cryptoHashing,
)
)
.dependsOn(vm, `tic-tac-toe`)
.enablePlugins(AutomateHeaderPlugin)

lazy val `statemachine-control` = (project in file("statemachine/control"))
.settings(
commons,
Expand Down
237 changes: 237 additions & 0 deletions vm/examples/tic-tac-toe/app/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions vm/examples/tic-tac-toe/app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "tic-tac-toe"
version = "0.1.0"
authors = ["Fluence Labs"]
publish = false
description = "A tic-tac-toe example for the Fluence network"
edition = "2018"

[lib]
name = "tic_tac_toe"
path = "src/lib.rs"
crate-type = ["cdylib"]

[profile.release]
debug = false
lto = true
opt-level = "z"
panic = "abort"

[dependencies]
log = "0.4"
arraydeque = "0.4.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.38"
boolinator = "2.4.0"
fluence = { version = "0.0.10", features = ["export_allocator", "wasm_logger"] }

#[dev-dependencies]
simple_logger = "1.0.1"
1 change: 1 addition & 0 deletions vm/examples/tic-tac-toe/app/rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nightly
19 changes: 19 additions & 0 deletions vm/examples/tic-tac-toe/app/src/error_type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2018 Fluence Labs Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

use std::error::Error;

pub type AppResult<T> = ::std::result::Result<T, Box<Error>>;
Loading

0 comments on commit 2b868c0

Please sign in to comment.