22// SPDX-License-Identifier: Apache-2.0
33
44use std:: {
5- collections:: { HashMap , HashSet } ,
5+ collections:: { BTreeMap , HashMap , HashSet } ,
66 env,
77 net:: { Ipv4Addr , SocketAddr , SocketAddrV4 } ,
88 path:: PathBuf ,
@@ -396,6 +396,9 @@ pub struct DipsConfig {
396396 pub host : String ,
397397 pub port : String ,
398398 pub allowed_payers : Vec < Address > ,
399+
400+ pub price_per_entity : u64 ,
401+ pub price_per_epoch : BTreeMap < String , u64 > ,
399402}
400403
401404impl Default for DipsConfig {
@@ -404,6 +407,8 @@ impl Default for DipsConfig {
404407 host : "0.0.0.0" . to_string ( ) ,
405408 port : "7601" . to_string ( ) ,
406409 allowed_payers : vec ! [ ] ,
410+ price_per_entity : 100 ,
411+ price_per_epoch : BTreeMap :: new ( ) ,
407412 }
408413 }
409414}
@@ -437,7 +442,12 @@ pub struct RavRequestConfig {
437442
438443#[ cfg( test) ]
439444mod tests {
440- use std:: { collections:: HashSet , env, fs, path:: PathBuf , str:: FromStr } ;
445+ use std:: {
446+ collections:: { BTreeMap , HashMap , HashSet } ,
447+ env, fs,
448+ path:: PathBuf ,
449+ str:: FromStr ,
450+ } ;
441451
442452 use figment:: value:: Uncased ;
443453 use sealed_test:: prelude:: * ;
@@ -470,6 +480,11 @@ mod tests {
470480 allowed_payers : vec ! [ Address (
471481 FixedBytes :: <20 >:: from_str( "0x3333333333333333333333333333333333333333" ) . unwrap( ) ,
472482 ) ] ,
483+ price_per_entity : 1000 ,
484+ price_per_epoch : BTreeMap :: from_iter ( vec ! [
485+ ( "mainnet" . to_string( ) , 100 ) ,
486+ ( "hardhat" . to_string( ) , 100 ) ,
487+ ] ) ,
473488 ..Default :: default ( )
474489 } ) ;
475490
0 commit comments