Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web4 scripts from socialdb #148

Merged
merged 17 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"image": "ghcr.io/near/near-devcontainer:latest",
"features": {
"ghcr.io/devcontainers/features/rust:1": {},
},
"customizations": {
"vscode": {
"extensions": [
"dtsvet.vscode-wasm",
"rust-lang.rust-analyzer",
"github.vscode-github-actions"
"github.vscode-github-actions",
"vadimcn.vscode-lldb"
]
}
},
"postCreateCommand": "./.devcontainer/post-create.sh"
}
}
11 changes: 7 additions & 4 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

(cd discussions && cargo near build)
(cd community && cargo near build)
(cd community-factory && cargo near build)
cargo near build
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
(cd discussions && cargo near build --no-docker)
(cd community && cargo near build --no-docker)
(cd community-factory && cargo near build --no-docker)
cargo near build --no-docker
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Install cargo-near
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- name: Build discussions contract
run: cd discussions && cargo near build
run: cd discussions && cargo near build --no-docker
- name: Build community contract
run: cd community && cargo near build
run: cd community && cargo near build --no-docker
- name: Build community factory contract
run: cd community-factory && cargo near build
run: cd community-factory && cargo near build --no-docker
- name: Build devhub contract
run: cargo near build
run: cargo near build --no-docker
- name: Unit tests
run: cargo test
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
- name: Install cargo-near
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- name: Build discussions contract
run: cd discussions && cargo near build
run: cd discussions && cargo near build --no-docker
- name: Build community contract
run: cd community && cargo near build
run: cd community && cargo near build --no-docker
- name: Build community factory contract
run: cd community-factory && cargo near build
run: cd community-factory && cargo near build --no-docker
- name: Build devhub contract
run: cargo near build
run: cargo near build --no-docker
- name: Install near CLI
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.3.1/near-cli-rs-v0.3.1-installer.sh | sh
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "devhub"
version = "0.2.0"
authors = ["NEAR DevHub <neardevhub.org>"]
edition = "2021"
repository = "https://github.com/NEAR-DevHub/neardevhub-contract"

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions community-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "devhub-community-factory"
version = "0.1.0"
authors = ["NEAR DevHub <neardevhub.org>"]
edition = "2021"
repository = "https://github.com/NEAR-DevHub/neardevhub-contract"

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions community/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "devhub-community"
version = "0.1.0"
authors = ["NEAR DevHub <neardevhub.org>"]
edition = "2021"
repository = "https://github.com/NEAR-DevHub/neardevhub-contract"

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions discussions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "devhub-discussions"
version = "0.1.0"
authors = ["NEAR DevHub <neardevhub.org>"]
edition = "2021"
repository = "https://github.com/NEAR-DevHub/neardevhub-contract"

[lib]
crate-type = ["cdylib"]
Expand Down
6 changes: 0 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,7 @@ impl Contract {
let author_id = env::predecessor_account_id();
let editor_id = author_id.clone();

let current_block_height = env::block_height();

if let Some(accepted_terms_and_conditions_version) = accepted_terms_and_conditions_version {
// require!(
// accepted_terms_and_conditions_version + 10000 >= current_block_height,
// "Terms and conditions version is too old"
// );
require!(
accepted_terms_and_conditions_version <= env::block_height(),
"Terms and conditions version cannot be from the future"
Expand Down
Loading