Skip to content

Commit

Permalink
Sync with fedibtc/fedi 0a5b17c8702e9d83f1b984cfa8c12b5294da38df (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Fedi CI <[email protected]>
  • Loading branch information
fedigord and Fedi CI authored Dec 18, 2024
1 parent 3124946 commit 3f54e42
Show file tree
Hide file tree
Showing 65 changed files with 1,289 additions and 1,678 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:
name: fedibtc
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Generate release credentials
env:
ANDROID_KEYSTORE_FILE_ENCODED: ${{ secrets.ANDROID_KEYSTORE_FILE_ENCODED }}
ANDROID_KEYSTORE_PROPERTIES_ENCODED: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES_ENCODED }}
PLAY_STORE_JSON_CREDENTIALS_ENCODED: ${{ secrets.PLAY_STORE_JSON_CREDENTIALS_ENCODED }}
run: nix develop -c ./scripts/ci/make-android-release-creds.sh

- name: Build bridge
run: nix develop -c env BUILD_ALL_BRIDGE_TARGETS=1 CARGO_PROFILE=release scripts/ci/run-in-fs-dir-cache.sh build-bridge-android ./scripts/bridge/build-bridge-android.sh

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ bridge/fedi-android/plugins/bin/

# FIXME don't merge this into master
/ui/common/wasm/fedi_wasm*

# make-android-release-creds.sh uses this
/tmp
/ui/native/android/keystore.properties
89 changes: 0 additions & 89 deletions bridge/fedi-android/gradlew.bat

This file was deleted.

3 changes: 2 additions & 1 deletion bridge/fedi-ffi/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use fedimint_derive_secret::ChildId;

pub const PAY_INVOICE_TIMEOUT: Duration = Duration::from_secs(90);
pub const REISSUE_ECASH_TIMEOUT: Duration = Duration::from_secs(60);
pub const ONE_WEEK: Duration = Duration::from_secs(604800);
/// 3 days
pub const ECASH_AUTO_CANCEL_DURATION: Duration = Duration::from_secs(60 * 60 * 24 * 3);
pub const SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(10);
pub const LNURL_CHILD_ID: u64 = 11;
pub const XMPP_CHILD_ID: u64 = 10;
Expand Down
13 changes: 7 additions & 6 deletions bridge/fedi-ffi/src/federation_v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ use self::dev::{
use self::ln_gateway_service::LnGatewayService;
use self::stability_pool_sweeper_service::StabilityPoolSweeperService;
use super::constants::{
LIGHTNING_OPERATION_TYPE, MILLION, MINT_OPERATION_TYPE, ONE_WEEK, PAY_INVOICE_TIMEOUT,
REISSUE_ECASH_TIMEOUT, STABILITY_POOL_OPERATION_TYPE, WALLET_OPERATION_TYPE,
ECASH_AUTO_CANCEL_DURATION, LIGHTNING_OPERATION_TYPE, MILLION, MINT_OPERATION_TYPE,
PAY_INVOICE_TIMEOUT, REISSUE_ECASH_TIMEOUT, STABILITY_POOL_OPERATION_TYPE,
WALLET_OPERATION_TYPE,
};
use super::event::{Event, EventSink, TypedEventExt};
use super::types::{
Expand Down Expand Up @@ -1739,12 +1740,12 @@ impl FederationV2 {
// Immediately cancel, which will reissue the notes attempting to fill in lower
// denominations. And then generate using AT LEAST strategy again, which
// will now have a high chance to producing the exact amount.
let cancel_time = fedimint_core::time::now() + ONE_WEEK;
let cancel_time = fedimint_core::time::now() + ECASH_AUTO_CANCEL_DURATION;
let (spend_guard, operation_id, notes) = match mint
.spend_notes_with_selector(
&SelectNotesWithExactAmount,
amount,
ONE_WEEK,
ECASH_AUTO_CANCEL_DURATION,
false,
EcashSendMetadata { internal: false },
)
Expand All @@ -1755,7 +1756,7 @@ impl FederationV2 {
let (_, notes) = mint
.spend_notes(
amount,
ONE_WEEK,
ECASH_AUTO_CANCEL_DURATION,
false,
EcashSendMetadata { internal: true },
)
Expand Down Expand Up @@ -1784,7 +1785,7 @@ impl FederationV2 {
let (operation_id, notes) = mint
.spend_notes(
amount,
ONE_WEEK,
ECASH_AUTO_CANCEL_DURATION,
false,
EcashSendMetadata { internal: false },
)
Expand Down
6 changes: 6 additions & 0 deletions bridge/fedi-ffi/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ async fn backupStatus(federation: Arc<FederationV2>) -> anyhow::Result<BackupSer
federation.backup_status().await
}

#[macro_rules_derive(rpc_method!)]
async fn fedimintVersion(_bridge: Arc<Bridge>) -> anyhow::Result<String> {
Ok(fedimint_core::version::cargo_pkg().to_string())
}

#[macro_rules_derive(rpc_method!)]
async fn getNostrSecret(bridge: Arc<Bridge>) -> anyhow::Result<RpcNostrSecret> {
bridge.get_nostr_secret().await
Expand Down Expand Up @@ -1418,6 +1423,7 @@ macro_rules! rpc_methods {
rpc_methods!(RpcMethods {
bridgeStatus,
onAppForeground,
fedimintVersion,
// Federations
joinFederation,
federationPreview,
Expand Down
168 changes: 0 additions & 168 deletions nix/cargo-wrapper/cargo

This file was deleted.

Loading

0 comments on commit 3f54e42

Please sign in to comment.