@@ -104,6 +104,7 @@ use clap::Parser as _;
104104use ubyte:: ToByteUnit as _;
105105use num:: ToPrimitive as _;
106106
107+ mod cmn;
107108mod config;
108109mod identity;
109110mod env_key;
@@ -112,14 +113,6 @@ mod saga;
112113mod stream;
113114mod sub_system;
114115
115- #[ derive( Debug ) ]
116- #[ derive( Clone ) ]
117- #[ derive( derive_more:: From ) ]
118- enum Or < A , B > {
119- Lhs ( A ) ,
120- Rhs ( B )
121- }
122-
123116#[ derive( Debug ) ]
124117#[ derive( Clone ) ]
125118#[ derive( PartialEq ) ]
@@ -192,25 +185,15 @@ struct Proof {
192185 relays : Vec < ( identity:: PublicKey , identity:: Signature ) >
193186}
194187
195- trait Unpack < T > {
196- fn unpack ( self ) -> T ;
197- }
198-
199- trait TryUnpack < T > {
200- type Error ;
201-
202- fn unpack ( self ) -> std:: result:: Result < T , Self :: Error > ;
203- }
204-
205188/// External dns source of truth provider, may be swapped and implemented by
206189/// other chains or networks, the nodes rely on this sytem for value transfer
207190/// and cryptographic proofs
208191#[ async_trait:: async_trait]
209192trait Dns {
210193 async fn receive_attestation (
211194 & self ,
212- public_key : identity:: PublicKey ,
213- signature : identity:: Signature
195+ pk : identity:: PublicKey ,
196+ sg : identity:: Signature
214197 ) -> Result ;
215198
216199 /// Receives a proof of trasit from src to dst through possible relays.
@@ -219,7 +202,7 @@ trait Dns {
219202 // for a given foreign key will return the onchain identity
220203 //
221204 // i own this pk offchain, this is who i am onchain
222- async fn attestation ( & self , key : identity:: PublicKey ) -> Result < Address > ;
205+ async fn attestation ( & self , pk : identity:: PublicKey ) -> Result < Address > ;
223206
224207 async fn foreign_attestation ( & self ) -> Result < identity:: PublicKey > ;
225208
@@ -263,6 +246,61 @@ trait Dns {
263246 async fn age ( & self , pk : identity:: PublicKey ) -> Result < Option < Age > > ;
264247}
265248
249+ #[ derive( Debug ) ]
250+ struct StellarTestnet ;
251+
252+ #[ async_trait:: async_trait]
253+ impl Dns for StellarTestnet {
254+ async fn receive_attestation (
255+ & self ,
256+ pk : identity:: PublicKey ,
257+ sg : identity:: Signature
258+ ) -> Result {
259+
260+ }
261+
262+ async fn receive_proof ( & self , proof : Proof ) -> Result {
263+
264+ }
265+
266+ async fn attestation ( & self , pk : identity:: PublicKey ) -> Result < Address > {
267+
268+ }
269+
270+ async fn renew ( & self , domain : Domain ) -> Result {
271+ todo ! ( )
272+ }
273+
274+ async fn mint ( & self , domain : Domain ) -> Result {
275+ todo ! ( )
276+ }
277+
278+ async fn congestion_charge ( & self ) -> Result < Fee > {
279+ todo ! ( )
280+ }
281+
282+ async fn fee ( & self ) -> Result < Fee > {
283+ todo ! ( )
284+ }
285+
286+ async fn traffic ( & self , domain : Domain ) -> Result < Traffic > {
287+ todo ! ( )
288+ }
289+
290+ async fn total_spend ( & self ) -> Result < Balance > {
291+ todo ! ( )
292+ }
293+
294+ async fn total_claim ( & self ) -> Result < Balance > {
295+ todo ! ( )
296+ }
297+
298+ async fn age ( & self , pk : identity:: PublicKey ) -> Result < Option < Age > > {
299+ todo ! ( )
300+ }
301+ }
302+
303+
266304type Result < T = ( ) > = std:: result:: Result < T , Box < dyn std:: error:: Error > > ;
267305
268306type Swarm = swarm:: Swarm < Behaviour > ;
0 commit comments