Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
feat(job-payment): payments working (#9)
Browse files Browse the repository at this point in the history
* Feat/manual job assignment (#8)

* feat(manual-job-assignment): added extrinsic call to manually assign a job

* chore(): updated docs

* feat(job-payment): payments working

feat(job-payment): first commit

feat(statemint-backed-native-asset): all working as intended. At some point we need acurast to statemint transfers by burning native token, but not needed for now

fix(xcmp-panic): statemint not compiling

chore(proxy-pallet): refactoring, new events and errors

chore(proxy-pallet): removed unnecessary xcm-emulator folder

feat(proxy-pallet): emulator test added but ran with simulator (mock runtimes added in mock.rs instead of using real runtimes)

emulator

fix(attestation-origin-validation): added origin validation when submitting an attestation (#6)

doc(wasm-contract-integration): added section for example wasm smart … (#5)

* doc(wasm-contract-integration): added section for example wasm smart contract integration

* Update pallets/acurast/README.md

Co-authored-by: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com>

Co-authored-by: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com>

fix(imports): fixed imports (#4)

Feat/unit tests (#3)

* feat(unit-tests): started to add unit tests

* feat(unit-tests): added more unit tests

* feat(unit-tests): moved tests to their own file

* feat(unit-tests): restructured source code

* chore(): removed unused dependency

readme

pallet proxy working

* feat(job-payment): simulation working after rebase

* feat(job-payment): rebase

* task(job-payment): cargo fmt and node setup tutorial added on examples folder

* chore(feat/job-payment): removed cargo patch

* chore(): fixed tests

* chore(): removed emulations and examples

Co-authored-by: Mike Godenzi <m.godenzi@papers.ch>
Co-authored-by: Juan <j.rios@papers.ch>
  • Loading branch information
3 people authored Oct 13, 2022
1 parent 463b9f9 commit 940bbf3
Show file tree
Hide file tree
Showing 17 changed files with 2,362 additions and 1,715 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ panic = "unwind"
members = [
"pallets/*",
"p256-crypto",
]
]
74 changes: 37 additions & 37 deletions p256-crypto/src/application_crypto.rs
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
pub mod p256 {
use sp_application_crypto::RuntimePublic;
use sp_core::crypto::KeyTypeId;
use sp_runtime::traits::Verify;
use sp_std::prelude::*;
use sp_application_crypto::RuntimePublic;
use sp_core::crypto::KeyTypeId;
use sp_runtime::traits::Verify;
use sp_std::prelude::*;

pub use crate::core::p256::*;
pub use crate::core::p256::*;

pub const P256: KeyTypeId = KeyTypeId(*b"p256");
pub const P256: KeyTypeId = KeyTypeId(*b"p256");

mod app {
use sp_application_crypto::app_crypto;
use sp_runtime::BoundToRuntimeAppPublic;
mod app {
use sp_application_crypto::app_crypto;
use sp_runtime::BoundToRuntimeAppPublic;

use crate::core::p256;
use crate::core::p256;

use super::P256;
use super::P256;

app_crypto!(p256, P256);
app_crypto!(p256, P256);

impl BoundToRuntimeAppPublic for Public {
type Public = Self;
}
}
impl BoundToRuntimeAppPublic for Public {
type Public = Self;
}
}

pub use app::{Public as AppPublic, Signature as AppSignature};
pub use app::{Public as AppPublic, Signature as AppSignature};

impl RuntimePublic for Public {
type Signature = Signature;
impl RuntimePublic for Public {
type Signature = Signature;

fn all(_key_type: KeyTypeId) -> Vec<Self> {
vec![]
}
fn all(_key_type: KeyTypeId) -> Vec<Self> {
vec![]
}

fn generate_pair(_key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
Pair::generate_from_seed_bytes(&seed.expect("seed needs to be provided"))
.expect("Pair generation")
.get_public()
}
fn generate_pair(_key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self {
Pair::generate_from_seed_bytes(&seed.expect("seed needs to be provided"))
.expect("Pair generation")
.get_public()
}

fn sign<M: AsRef<[u8]>>(&self, _key_type: KeyTypeId, _msg: &M) -> Option<Self::Signature> {
None
}
fn sign<M: AsRef<[u8]>>(&self, _key_type: KeyTypeId, _msg: &M) -> Option<Self::Signature> {
None
}

fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
signature.verify(msg.as_ref(), &self)
}
fn verify<M: AsRef<[u8]>>(&self, msg: &M, signature: &Self::Signature) -> bool {
signature.verify(msg.as_ref(), &self)
}

fn to_raw_vec(&self) -> Vec<u8> {
sp_core::crypto::ByteArray::to_raw_vec(self)
}
}
fn to_raw_vec(&self) -> Vec<u8> {
sp_core::crypto::ByteArray::to_raw_vec(self)
}
}
}
Loading

0 comments on commit 940bbf3

Please sign in to comment.