-
-
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.
- Loading branch information
1 parent
a898a93
commit 29bff25
Showing
10 changed files
with
424 additions
and
116 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,28 @@ | ||
[package] | ||
name = "sonare-request" | ||
version.workspace = true | ||
authors.workspace = true | ||
description = "SONARE request builders and parsers" | ||
repository.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
categories = ["algorithms", "cryptography", "science", "no-std"] | ||
readme.workspace = true | ||
license.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
exclude = [".github"] | ||
|
||
[dependencies] | ||
amplify.workspace = true | ||
strict_encoding.workspace = true | ||
strict_types.workspace = true | ||
ultrasonic.workspace = true | ||
sonare = { version = "0.12.0-alpha.1", path = ".." } | ||
serde = { workspace = true, optional = true } | ||
|
||
[features] | ||
default = ["std"] | ||
all = ["std"] | ||
|
||
std = [] |
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,44 @@ | ||
// SONARE: Runtime environment for formally-verifiable distributed software | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Designed in 2019-2024 by Dr Maxim Orlovsky <[email protected]> | ||
// Written in 2024-2025 by Dr Maxim Orlovsky <[email protected]> | ||
// | ||
// Copyright (C) 2019-2025 LNP/BP Standards Association, Switzerland. | ||
// Copyright (C) 2024-2025 Laboratories for Ubiquitous Deterministic Computing (UBIDECO), | ||
// Institute for Distributed and Cognitive Systems (InDCS), Switzerland. | ||
// Copyright (C) 2019-2025 Dr Maxim Orlovsky. | ||
// All rights under the above copyrights are reserved. | ||
// | ||
// 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 amplify::confinement::{TinyString, TinyVec}; | ||
use strict_types::StrictVal; | ||
use ultrasonic::{ContractId, ProofOfPubl}; | ||
|
||
pub trait SonareProtocol { | ||
const URL_SCHEME: &'static str; | ||
type PoP: ProofOfPubl; | ||
} | ||
|
||
pub struct Request<S: SonareProtocol> { | ||
pub pop: S::PoP, | ||
pub contract_id: Option<ContractId>, | ||
pub interface: Option<TinyString>, | ||
pub method: Option<TinyString>, | ||
pub args: TinyVec<RequestArg>, | ||
} | ||
|
||
pub struct RequestArg { | ||
pub name: TinyString, | ||
pub value: StrictVal, | ||
} |
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 @@ | ||
// SONARE: Runtime environment for formally-verifiable distributed software | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Designed in 2019-2024 by Dr Maxim Orlovsky <[email protected]> | ||
// Written in 2024-2025 by Dr Maxim Orlovsky <[email protected]> | ||
// | ||
// Copyright (C) 2019-2025 LNP/BP Standards Association, Switzerland. | ||
// Copyright (C) 2024-2025 Laboratories for Ubiquitous Deterministic Computing (UBIDECO), | ||
// Institute for Distributed and Cognitive Systems (InDCS), Switzerland. | ||
// Copyright (C) 2019-2025 Dr Maxim Orlovsky. | ||
// All rights under the above copyrights are reserved. | ||
// | ||
// 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. | ||
|
||
#![cfg_attr(docsrs, feature(doc_auto_cfg))] | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
//! _Request_ (or _transaction request_) is a specification on constructing a transaction for a | ||
//! SONARE contract. | ||
mod data; | ||
|
||
extern crate alloc; |
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,53 @@ | ||
// SONARE: Runtime environment for formally-verifiable distributed software | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Designed in 2019-2024 by Dr Maxim Orlovsky <[email protected]> | ||
// Written in 2024-2025 by Dr Maxim Orlovsky <[email protected]> | ||
// | ||
// Copyright (C) 2019-2025 LNP/BP Standards Association, Switzerland. | ||
// Copyright (C) 2024-2025 Laboratories for Ubiquitous Deterministic Computing (UBIDECO), | ||
// Institute for Distributed and Cognitive Systems (InDCS), Switzerland. | ||
// Copyright (C) 2019-2025 Dr Maxim Orlovsky. | ||
// All rights under the above copyrights are reserved. | ||
// | ||
// 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 aluvm::LibSite; | ||
|
||
use super::{ApiVm, ApiVmType, StateArithm}; | ||
use crate::StructData; | ||
|
||
impl ApiVm for aluvm::Vm { | ||
const TYPE: ApiVmType = ApiVmType::AluVM; | ||
type Arithm = AluVMArithm; | ||
type ReaderSite = LibSite; | ||
type AdaptorSite = LibSite; | ||
} | ||
|
||
pub struct AluVMArithm { | ||
pub vm: Option<aluvm::Vm>, | ||
pub accumulate: LibSite, | ||
pub lessen: LibSite, | ||
pub diff: LibSite, | ||
} | ||
|
||
impl StateArithm for AluVMArithm { | ||
type Site = LibSite; | ||
|
||
fn measure(&self, state: StructData) -> Option<u8> { todo!() } | ||
|
||
fn accumulate(&mut self, state: StructData) -> Option<()> { todo!() } | ||
|
||
fn lessen(&mut self, state: StructData) -> Option<()> { todo!() } | ||
|
||
fn diff(&self) -> Option<StructData> { todo!() } | ||
} |
Oops, something went wrong.