Skip to content

Commit

Permalink
Merge pull request #13 from starkbamse/invoice-removal
Browse files Browse the repository at this point in the history
Fix doc test error and introduce native_currency_name
  • Loading branch information
saefstroem authored May 23, 2024
2 parents 26dd72b + 7c5200b commit c95b6be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gateway/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ pub fn get_unix_time_seconds() -> u64 {
/// let provider = Provider::try_from("https://bsc-dataseed1.binance.org/").expect("Invalid RPC URL");
/// let gateway = PaymentGateway::new(
/// PaymentGatewayConfiguration{
/// native_currency_name:"ETH".to_string(),
/// provider,
/// treasury_address: "0xdac17f958d2ee523a2206206994597c13d831ec7".parse::<Address>().unwrap(),
/// min_confirmations: 10,
/// reflector,
/// invoice_delay_seconds: 10,
/// poller_delay_seconds: 10,
/// transaction_type,
/// eip1559_estimation_retry_max: 3,
/// eip1559_estimation_retry_delay_seconds: 10,
Expand Down Expand Up @@ -146,6 +147,7 @@ pub enum TransactionType {
/// - `eip1559_estimation_retry_delay_seconds`: the delay between each retry in seconds.
#[derive(Clone)]
pub struct PaymentGatewayConfiguration {
pub native_currency_name: String,
pub provider: Provider<Http>,
pub treasury_address: Address,
pub poller_delay_seconds: u64,
Expand Down Expand Up @@ -216,11 +218,12 @@ impl PaymentGateway {
/// let provider = Provider::try_from("https://bsc-dataseed1.binance.org/").expect("Invalid RPC URL");
/// let gateway = PaymentGateway::new(
/// PaymentGatewayConfiguration{
/// native_currency_name:"ETH".to_string(),
/// provider,
/// treasury_address: "0xdac17f958d2ee523a2206206994597c13d831ec7".parse::<Address>().unwrap(),
/// min_confirmations: 10,
/// reflector,
/// invoice_delay_seconds: 10,
/// poller_delay_seconds: 10,
/// transaction_type,
/// eip1559_estimation_retry_max: 3,
/// eip1559_estimation_retry_delay_seconds: 10,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ mod tests {

PaymentGateway::new(
PaymentGatewayConfiguration{
native_currency_name:"ETH".to_string(),
provider,
treasury_address: "0xdac17f958d2ee523a2206206994597c13d831ec7".parse::<Address>().unwrap(),
min_confirmations: 10,
Expand Down

0 comments on commit c95b6be

Please sign in to comment.