This repository has been archived by the owner on May 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Version 0.0.1 Co-authored-by: Kuba Płaskonka <[email protected]> Co-authored-by: Krzysztof Pobiarżyn <[email protected]>
- Loading branch information
1 parent
65aa4ff
commit e458bfd
Showing
42 changed files
with
824 additions
and
1,340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: odra-casper-ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
paths-ignore: | ||
- "**.md" | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
- feature/* | ||
paths-ignore: | ||
- "**.md" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
components: rustfmt, clippy | ||
- uses: Swatinem/rust-cache@v1 | ||
- run: make prepare | ||
- run: make build-test-env | ||
- run: make check-lint | ||
- run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/*/target/ | ||
/*/Cargo.lock | ||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
.idea | ||
*/target/ | ||
*/Cargo.lock | ||
test_env/getter_proxy/target | ||
test_env/getter_proxy/Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 odradev | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
prepare: | ||
sudo apt install wabt | ||
rustup target add wasm32-unknown-unknown | ||
|
||
test: | ||
cd shared && cargo test | ||
cd backend && cargo test | ||
|
||
build-test-env: | ||
cd test_env && cargo build --release | ||
|
||
clippy: | ||
cd backend && cargo clippy --all-targets -- -D warnings | ||
cd shared && cargo clippy --all-targets -- -D warnings | ||
cd test_env && cargo clippy --all-targets -- -D warnings | ||
cd test_env/getter_proxy && cargo clippy --all-targets -- -D warnings | ||
|
||
check-lint: clippy | ||
cd backend && cargo fmt -- --check | ||
cd shared && cargo fmt -- --check | ||
cd test_env && cargo fmt -- --check | ||
cd test_env/getter_proxy && cargo fmt -- --check | ||
|
||
lint: clippy | ||
cd backend && cargo fmt | ||
cd shared && cargo fmt | ||
cd test_env && cargo fmt | ||
cd test_env/getter_proxy && cargo fmt | ||
|
||
clean: | ||
cd backend && cargo clean | ||
cd shared && cargo clean | ||
cd test_env && cargo clean | ||
cd test_env/getter_proxy && cargo clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Odra Casper | ||
|
||
Implementation of the Casper backend for the Odra. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Changelog | ||
|
||
Changelog for `odra-casper-backend`. | ||
|
||
## [0.0.1] - 2022-07-18 | ||
### Added | ||
- `codegen` module that is used to generate wasm file. | ||
- `backend` module that exports all required `#[no_mangle]` functions and interacts with the Casper Host. | ||
- `CHANGELOG.md` and `README.md` files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
[package] | ||
name = "casper_backend" | ||
version = "0.1.0" | ||
name = "odra-casper-backend" | ||
version = "0.0.1" | ||
edition = "2021" | ||
authors = ["Jakub Płaskonka <[email protected]>", "Krzysztof Pobiarżyn <[email protected]>", "Maciej Zieliński <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/odradev/odra-casper" | ||
description = "Odra backend bindings and codegen utility for the Casper Blockchain." | ||
keywords = ["wasm", "webassembly", "blockchain"] | ||
categories = ["wasm", "smart contracts"] | ||
|
||
[dependencies] | ||
odra = { git = "https://github.com/odradev/odra.git", default-features = false, features = [ "wasm" ] } | ||
# odra = { path = "../../../odra/core", default-features = false, features = ["wasm"] } | ||
casper-contract = { version = "1.4.4", default-features = false, features = ["std", "test-support"] } | ||
casper-commons = { path = "../common", features = [ "wasm" ] } | ||
casper-contract = { version = "1.4.4", default-features = false, features = ["std"] } | ||
casper-types = "1.5.0" | ||
proc-macro2 = "1.0.39" | ||
quote = "1.0.18" | ||
syn = "1.0.96" | ||
hex = "0.4.3" | ||
convert_case = "0.5.0" | ||
pretty_assertions = "1.2.1" | ||
lazy_static = "1.4.0" | ||
|
||
[features] | ||
default = [ "codegen", "backend" ] | ||
codegen = [] | ||
backend = [] | ||
odra-casper-shared = { version = "0.0.1", path = "../shared" } | ||
odra = { version = "0.0.1", default-features = false, features = [ "wasm" ] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Odra Casper Backend | ||
|
||
This crate implements `#[no_mangle]` bindings for `odra::external_api::contract_env::ContractEnv`. | ||
It also provides codegen capabilites used to build a Casper WebAssembly file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.