-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from dashpay/v0.7-dev
v0.7-dev to master
- Loading branch information
Showing
46 changed files
with
2,419 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::env; | ||
use std::fs; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
// Fetch the version from CARGO_PKG_VERSION | ||
let version = env::var("CARGO_PKG_VERSION").unwrap_or_else(|_| "??".to_string()); | ||
|
||
// Generate a Rust file with the version constant | ||
let out_dir = env::var("OUT_DIR").unwrap(); | ||
let dest_path = Path::new(&out_dir).join("version.rs"); | ||
fs::write( | ||
dest_path, | ||
format!(r#"pub const VERSION: &str = "{}";"#, version), | ||
) | ||
.expect("Failed to write version.rs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use dash_sdk::{ | ||
dpp::state_transition::StateTransition, | ||
platform::transition::broadcast::BroadcastStateTransition, Sdk, | ||
}; | ||
|
||
use crate::context::AppContext; | ||
|
||
use super::BackendTaskSuccessResult; | ||
|
||
impl AppContext { | ||
pub async fn broadcast_state_transition( | ||
&self, | ||
state_transition: StateTransition, | ||
sdk: &Sdk, | ||
) -> Result<BackendTaskSuccessResult, String> { | ||
match state_transition.broadcast_and_wait(sdk, None).await { | ||
Ok(_) => Ok(BackendTaskSuccessResult::Message( | ||
"State transition broadcasted successfully".to_string(), | ||
)), | ||
Err(e) => Err(format!("Error broadcasting state transition: {}", e)), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.