Skip to content

Commit

Permalink
Merge pull request #54 from starknet-id/feat/add_altcoins_support
Browse files Browse the repository at this point in the history
fix: pipeline expiry date
  • Loading branch information
Th0rgal authored Mar 26, 2024
2 parents 9722e12 + 6664322 commit 5299e41
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ Cargo.lock
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

config.testnet.toml
config.testnet.toml
config/
1 change: 1 addition & 0 deletions bot/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub_struct!(Clone, Deserialize; MyAccount {

pub_struct!(Clone, Deserialize; Renewals {
delay: u64,
expiry_days: i64,
});

pub_struct!(Clone, Deserialize; IndexerServer {
Expand Down
4 changes: 2 additions & 2 deletions bot/src/pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub async fn get_auto_renewal_data(
state: &Arc<AppState>,
) -> Result<Vec<DomainAggregateResult>> {
let auto_renews_collection = state.db.collection::<Domain>("auto_renew_flows");
let min_expiry_date = Utc::now() + Duration::days(400);
let min_expiry_date = Utc::now() + Duration::days(config.renewals.expiry_days);
let erc20_addr = to_hex(config.contract.erc20);
let auto_renew_contract = FieldElement::to_string(&config.contract.renewal);
println!("timestamp: {}", min_expiry_date.timestamp());
Expand Down Expand Up @@ -110,7 +110,7 @@ pub async fn get_auto_renewal_altcoins_data(
state: &Arc<AppState>,
) -> Result<Vec<DomainAggregateResult>> {
let auto_renews_collection = state.db.collection::<Domain>("auto_renew_flows_altcoins");
let min_expiry_date = Utc::now() + Duration::days(400); // todo : change to 30 days
let min_expiry_date = Utc::now() + Duration::days(config.renewals.expiry_days);

// Define aggregate pipeline
let pipeline = vec![
Expand Down
1 change: 1 addition & 0 deletions config.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ address = "0x123"

[renewals]
delay = 86400 # 24 hours
expiry_days = 30 # number of days before expiry to renew

[indexer_server]
port = [8005, 8007, 8008]
Expand Down

0 comments on commit 5299e41

Please sign in to comment.