mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 02:07:55 +00:00
vet cargo docs on CI (#380)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -15,3 +15,6 @@ rustflags = [
|
|||||||
"-Clink-arg=-sSTACK_SIZE=128kb",
|
"-Clink-arg=-sSTACK_SIZE=128kb",
|
||||||
"-Clink-arg=-sNODEJS_CATCH_EXIT=0"
|
"-Clink-arg=-sNODEJS_CATCH_EXIT=0"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[build]
|
||||||
|
rustdocflags = ["-D", "warnings"]
|
||||||
|
|||||||
@@ -57,3 +57,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Test cargo workspace
|
- name: Test cargo workspace
|
||||||
run: make test-workspace
|
run: make test-workspace
|
||||||
|
|
||||||
|
- name: Test docs
|
||||||
|
run: make doc
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
install-revive-explorer \
|
install-revive-explorer \
|
||||||
format \
|
format \
|
||||||
clippy \
|
clippy \
|
||||||
|
doc \
|
||||||
machete \
|
machete \
|
||||||
test \
|
test \
|
||||||
test-integration \
|
test-integration \
|
||||||
@@ -52,11 +53,14 @@ format:
|
|||||||
clippy:
|
clippy:
|
||||||
cargo clippy --all-features --workspace --tests --benches -- --deny warnings
|
cargo clippy --all-features --workspace --tests --benches -- --deny warnings
|
||||||
|
|
||||||
|
doc:
|
||||||
|
cargo doc --all-features --workspace --document-private-items --no-deps
|
||||||
|
|
||||||
machete:
|
machete:
|
||||||
cargo install cargo-machete
|
cargo install cargo-machete
|
||||||
cargo machete
|
cargo machete
|
||||||
|
|
||||||
test: format clippy machete test-workspace install-revive-runner install-revive-explorer
|
test: format clippy machete test-workspace install-revive-runner install-revive-explorer doc
|
||||||
|
|
||||||
test-integration: install-bin
|
test-integration: install-bin
|
||||||
cargo test --package revive-integration
|
cargo test --package revive-integration
|
||||||
@@ -65,7 +69,7 @@ test-resolc: install
|
|||||||
cargo test --package resolc
|
cargo test --package resolc
|
||||||
|
|
||||||
test-workspace: install
|
test-workspace: install
|
||||||
cargo test --workspace --exclude revive-llvm-builder
|
cargo test --workspace --exclude revive-llvm-builder --doc
|
||||||
|
|
||||||
test-wasm: install-wasm
|
test-wasm: install-wasm
|
||||||
npm run test:wasm
|
npm run test:wasm
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ use std::time::Duration;
|
|||||||
/// Parse a go formatted duration.
|
/// Parse a go formatted duration.
|
||||||
///
|
///
|
||||||
/// Sources:
|
/// Sources:
|
||||||
/// - https://crates.io/crates/go-parse-duration (fixed an utf8 bug)
|
/// - <https://crates.io/crates/go-parse-duration> (fixed an utf8 bug)
|
||||||
/// - https://github.com/golang/go/blob/master/src/time/format.go
|
/// - <https://github.com/golang/go/blob/master/src/time/format.go>
|
||||||
pub fn parse_go_duration(value: &str) -> Result<Duration, String> {
|
pub fn parse_go_duration(value: &str) -> Result<Duration, String> {
|
||||||
parse_duration(value).map(|ns| Duration::from_nanos(ns.unsigned_abs()))
|
parse_duration(value).map(|ns| Duration::from_nanos(ns.unsigned_abs()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ impl DwarfdumpAnalyzer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Given a slice of u64 values, returns a Vec<u64> where each element
|
/// Given a slice of u64 values, returns a `Vec<u64>` where each element
|
||||||
/// is linearly scaled into the closed interval [1, 10].
|
/// is linearly scaled into the closed interval [1, 10].
|
||||||
fn scale_to(data: &[u64], scale_max: u64) -> Vec<u64> {
|
fn scale_to(data: &[u64], scale_max: u64) -> Vec<u64> {
|
||||||
if data.is_empty() {
|
if data.is_empty() {
|
||||||
|
|||||||
@@ -664,7 +664,7 @@ impl<'ctx> Context<'ctx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Builds an aligned stack allocation at the current position.
|
/// Builds an aligned stack allocation at the current position.
|
||||||
/// Use this if [`build_alloca_at_entry`] might change program semantics.
|
/// Use this if [`Self::build_alloca_at_entry`] might change program semantics.
|
||||||
/// Otherwise, alloca should always be built at the function prelude!
|
/// Otherwise, alloca should always be built at the function prelude!
|
||||||
pub fn build_alloca<T: BasicType<'ctx> + Clone + Copy>(
|
pub fn build_alloca<T: BasicType<'ctx> + Clone + Copy>(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! Experimental test runner for testing [pallet-revive](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive) contracts.
|
//! Experimental test runner for testing [pallet-revive](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive) contracts.
|
||||||
//! The crate exposes a single function [`run_tests`] that takes a [`Specs`] that defines in a declarative way:
|
//! The crate implements [`Specs`] that defines tests a declarative way:
|
||||||
//! - The Genesis configuration
|
//! - The Genesis configuration.
|
||||||
//! - A list of [`SpecsAction`] that will be executed in order.
|
//! - A list of [`SpecsAction`] that will be executed in order.
|
||||||
//!
|
//!
|
||||||
//! ## Example
|
//! ## Example
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ impl Default for Specs {
|
|||||||
|
|
||||||
impl Specs {
|
impl Specs {
|
||||||
/// Get the list of actions to perform
|
/// Get the list of actions to perform
|
||||||
/// A default [`SpecAction::VerifyCall`] is injected after each Instantiate or Call action when
|
/// A default [`SpecsAction::VerifyCall`] is injected after each Instantiate or Call action when
|
||||||
/// missing and not in differential mode
|
/// missing and not in differential mode
|
||||||
pub fn actions(&self) -> Vec<SpecsAction> {
|
pub fn actions(&self) -> Vec<SpecsAction> {
|
||||||
self.actions
|
self.actions
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use inkwell::{builder::Builder, context::Context, module::Module, values::IntValue};
|
use inkwell::{builder::Builder, context::Context, module::Module, values::IntValue};
|
||||||
|
|
||||||
/// Creates a module that sets the PolkaVM minimum stack size to [`size`] if linked in.
|
/// Creates a module that sets the PolkaVM minimum stack size to `size` if linked in.
|
||||||
pub fn min_stack_size<'context>(
|
pub fn min_stack_size<'context>(
|
||||||
context: &'context Context,
|
context: &'context Context,
|
||||||
module_name: &str,
|
module_name: &str,
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
//! This crate vendors the [PolkaVM][0] C API and provides a LLVM module for interacting
|
//! This crate vendors the [PolkaVM][0] C API and provides a LLVM module for interacting
|
||||||
//! with the `pallet-revive` runtime API.
|
//! with the `pallet-revive` runtime API.
|
||||||
//! At present, the contracts pallet requires blobs to export `call` and `deploy`,
|
//! At present, the contracts pallet requires blobs to export `call` and `deploy`,
|
||||||
//! and offers a bunch of [runtime API methods][1]. The provided [module] implements
|
//! and offers a bunch of [runtime API methods][1]. The provided implements
|
||||||
//! those exports and imports.
|
//! those exports and imports.
|
||||||
//! [0]: [https://crates.io/crates/polkavm]
|
//!
|
||||||
//! [1]: [https://docs.rs/pallet-contracts/26.0.0/pallet_contracts/api_doc/index.html]
|
//! [0]: [<https://crates.io/crates/polkavm>]
|
||||||
|
//! [1]: [<https://docs.rs/pallet-contracts/latest/pallet_contracts/api_doc/index.html>]
|
||||||
|
|
||||||
pub mod calling_convention;
|
pub mod calling_convention;
|
||||||
pub mod immutable_data;
|
pub mod immutable_data;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
//! This crate vendors EVM related standard library functionality and provides a LLVM module,
|
//! This crate vendors EVM related standard library functionality and provides a LLVM module,
|
||||||
//! exporting the standard library functions.
|
//! exporting the standard library functions.
|
||||||
//! The standard library code is inherited and adapted from [0].
|
//! The standard library code is inherited and adapted from [the era compiler][0].
|
||||||
//! [0]: [https://github.com/matter-labs/era-compiler-llvm/blob/v1.4.1/llvm/lib/Target/PolkaVM/polkavm-stdlib.ll]
|
//!
|
||||||
|
//! [0]: [<https://github.com/matter-labs/era-compiler-llvm/blob/v1.4.1/llvm/lib/Target/PolkaVM/polkavm-stdlib.ll>]
|
||||||
|
|
||||||
use inkwell::{context::Context, memory_buffer::MemoryBuffer, module::Module, support::LLVMString};
|
use inkwell::{context::Context, memory_buffer::MemoryBuffer, module::Module, support::LLVMString};
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ pub enum Name {
|
|||||||
BlobHash,
|
BlobHash,
|
||||||
/// difficulty of the current block
|
/// difficulty of the current block
|
||||||
Difficulty,
|
Difficulty,
|
||||||
/// https://eips.ethereum.org/EIPS/eip-4399
|
/// <https://eips.ethereum.org/EIPS/eip-4399>
|
||||||
Prevrandao,
|
Prevrandao,
|
||||||
/// current mining beneficiary
|
/// current mining beneficiary
|
||||||
CoinBase,
|
CoinBase,
|
||||||
|
|||||||
Reference in New Issue
Block a user