From 450854f2176637b05af72aa72a317e9bb7425887 Mon Sep 17 00:00:00 2001 From: Dmitry Novikov Date: Mon, 4 Dec 2023 15:21:45 +0100 Subject: [PATCH] Implement `cast` fn for `Origin` trait --- common/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/lib.rs b/common/src/lib.rs index e8fdff55497..6f40a64d449 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -84,6 +84,9 @@ pub type Gas = u64; pub trait Origin: Sized { fn into_origin(self) -> H256; fn from_origin(val: H256) -> Self; + fn cast(self) -> T { + T::from_origin(self.into_origin()) + } } impl Origin for u64 {