Skip to content

Commit

Permalink
Merge branch 'dev' into update-readme-of-client-api
Browse files Browse the repository at this point in the history
  • Loading branch information
0xverin authored Jun 11, 2024
2 parents f11f7fe + 6b470c6 commit 711b971
Show file tree
Hide file tree
Showing 88 changed files with 4,772 additions and 1,090 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bitacross-worker/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/

use bc_enclave_registry::EnclaveRegistry;
use bc_relayer_registry::RelayerRegistry;
use bc_signer_registry::SignerRegistry;
use codec::{Decode, Encode};
use ita_stf::TrustedCallSigned;
use itc_parentchain_indirect_calls_executor::{
Expand All @@ -29,8 +32,16 @@ pub struct InvokeArgs {
request: RsaRequest,
}

impl<Executor: IndirectExecutor<TrustedCallSigned, Error>>
IndirectDispatch<Executor, TrustedCallSigned> for InvokeArgs
impl<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
> IndirectDispatch<Executor, TrustedCallSigned, RelayerRegistry, SignerRegistry, EnclaveRegistry>
for InvokeArgs
{
type Args = ();
fn dispatch(&self, executor: &Executor, _args: Self::Args) -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Litentry. If not, see <https://www.gnu.org/licenses/>.

use bc_enclave_registry::EnclaveRegistry;
use bc_relayer_registry::RelayerRegistry;
use bc_signer_registry::SignerRegistry;
use codec::Encode;
use ita_stf::{Getter, TrustedCall, TrustedCallSigned};
use itc_parentchain_indirect_calls_executor::error::{Error, Result};
Expand All @@ -26,13 +29,29 @@ pub trait ArgsExecutor {
fn error(&self) -> Error;
fn name() -> &'static str;
fn shard(&self) -> ShardIdentifier;
fn prepare_trusted_call<Executor: IndirectExecutor<TrustedCallSigned, Error>>(
fn prepare_trusted_call<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
>(
&self,
executor: &Executor,
address: MultiAddress<AccountId32, ()>,
hash: H256,
) -> Result<TrustedCall>;
fn execute<Executor: IndirectExecutor<TrustedCallSigned, Error>>(
fn execute<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
>(
&self,
executor: &Executor,
address: Option<MultiAddress<AccountId32, ()>>,
Expand All @@ -44,7 +63,15 @@ pub trait ArgsExecutor {
Ok(())
}

fn submit<Executor: IndirectExecutor<TrustedCallSigned, Error>>(
fn submit<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
>(
&self,
executor: &Executor,
address: MultiAddress<AccountId32, ()>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Litentry. If not, see <https://www.gnu.org/licenses/>.

use bc_enclave_registry::EnclaveRegistry;
use bc_relayer_registry::RelayerRegistry;
use bc_signer_registry::SignerRegistry;
use codec::{Decode, Encode};
use ita_stf::TrustedCallSigned;
use itc_parentchain_indirect_calls_executor::{
Expand All @@ -32,8 +35,16 @@ pub struct SetScheduledEnclaveArgs {
mrenclave: MrEnclave,
}

impl<Executor: IndirectExecutor<TrustedCallSigned, Error>>
IndirectDispatch<Executor, TrustedCallSigned> for SetScheduledEnclaveArgs
impl<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
> IndirectDispatch<Executor, TrustedCallSigned, RelayerRegistry, SignerRegistry, EnclaveRegistry>
for SetScheduledEnclaveArgs
{
type Args = ();
fn dispatch(&self, _executor: &Executor, _args: Self::Args) -> Result<()> {
Expand All @@ -53,8 +64,16 @@ pub struct RemoveScheduledEnclaveArgs {
sbn: SidechainBlockNumber,
}

impl<Executor: IndirectExecutor<TrustedCallSigned, Error>>
IndirectDispatch<Executor, TrustedCallSigned> for RemoveScheduledEnclaveArgs
impl<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
> IndirectDispatch<Executor, TrustedCallSigned, RelayerRegistry, SignerRegistry, EnclaveRegistry>
for RemoveScheduledEnclaveArgs
{
type Args = ();
fn dispatch(&self, _executor: &Executor, _args: Self::Args) -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/

use bc_enclave_registry::EnclaveRegistry;
use bc_relayer_registry::RelayerRegistry;
use bc_signer_registry::SignerRegistry;
use codec::{Decode, Encode};
use ita_stf::{Getter, TrustedCall, TrustedCallSigned};
use itc_parentchain_indirect_calls_executor::{
Expand All @@ -37,8 +40,16 @@ pub struct ShieldFundsArgs {
shard: ShardIdentifier,
}

impl<Executor: IndirectExecutor<TrustedCallSigned, Error>>
IndirectDispatch<Executor, TrustedCallSigned> for ShieldFundsArgs
impl<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
> IndirectDispatch<Executor, TrustedCallSigned, RelayerRegistry, SignerRegistry, EnclaveRegistry>
for ShieldFundsArgs
{
type Args = ();
fn dispatch(&self, executor: &Executor, _args: Self::Args) -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
*/

use crate::{Litentry, ParentchainInstance, TargetA, TargetB};
use bc_enclave_registry::EnclaveRegistry;
use bc_relayer_registry::RelayerRegistry;
use bc_signer_registry::SignerRegistry;
use codec::{Compact, Decode, Encode};
use core::{any::TypeId, marker::PhantomData};
use ita_stf::{Getter, TrustedCall, TrustedCallSigned};
Expand All @@ -33,8 +36,17 @@ pub struct TimestampSetArgs<I: ParentchainInstance> {
_phantom: PhantomData<I>,
}

impl<Executor: IndirectExecutor<TrustedCallSigned, Error>, I: ParentchainInstance + 'static>
IndirectDispatch<Executor, TrustedCallSigned> for TimestampSetArgs<I>
impl<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
I: ParentchainInstance + 'static,
> IndirectDispatch<Executor, TrustedCallSigned, RelayerRegistry, SignerRegistry, EnclaveRegistry>
for TimestampSetArgs<I>
{
type Args = ();
fn dispatch(&self, executor: &Executor, _args: Self::Args) -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/

use bc_enclave_registry::EnclaveRegistry;
use bc_relayer_registry::RelayerRegistry;
use bc_signer_registry::SignerRegistry;
use codec::{Decode, Encode};
use core::fmt::Debug;
use ita_stf::{Getter, TrustedCall, TrustedCallSigned};
Expand Down Expand Up @@ -58,8 +61,16 @@ pub const ALICE_ACCOUNT_ID: AccountId = AccountId::new([
76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125,
]);

impl<Executor: IndirectExecutor<TrustedCallSigned, Error>>
IndirectDispatch<Executor, TrustedCallSigned> for TransferToAliceShieldsFundsArgs
impl<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
> IndirectDispatch<Executor, TrustedCallSigned, RelayerRegistry, SignerRegistry, EnclaveRegistry>
for TransferToAliceShieldsFundsArgs
{
type Args = ();
fn dispatch(&self, executor: &Executor, _args: Self::Args) -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
*/

use bc_relayer_registry::RelayerRegistry;
use bc_signer_registry::SignerRegistry;
use codec::Encode;

use bc_enclave_registry::EnclaveRegistry;
pub use ita_sgx_runtime::{Balance, Index};
use ita_stf::{Getter, TrustedCall, TrustedCallSigned};
use itc_parentchain_indirect_calls_executor::error::Error;
Expand All @@ -30,7 +33,15 @@ use log::*;
pub struct ParentchainEventHandler {}

impl ParentchainEventHandler {
fn shield_funds<Executor: IndirectExecutor<TrustedCallSigned, Error>>(
fn shield_funds<
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
>(
executor: &Executor,
account: &AccountId,
amount: Balance,
Expand All @@ -55,10 +66,23 @@ impl ParentchainEventHandler {
}
}

impl<Executor> HandleParentchainEvents<Executor, TrustedCallSigned, Error>
for ParentchainEventHandler
impl<Executor>
HandleParentchainEvents<
Executor,
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
> for ParentchainEventHandler
where
Executor: IndirectExecutor<TrustedCallSigned, Error>,
Executor: IndirectExecutor<
TrustedCallSigned,
Error,
RelayerRegistry,
SignerRegistry,
EnclaveRegistry,
>,
{
fn handle_events(
executor: &Executor,
Expand Down
Loading

0 comments on commit 711b971

Please sign in to comment.