-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c4b307
commit a27e707
Showing
22 changed files
with
682 additions
and
93 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
Binary file not shown.
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 |
---|---|---|
@@ -1,4 +1,21 @@ | ||
#!/bin/sh | ||
cd scripts && python3 copyright.py | ||
cargo clippy --fix --lib -p libmonero --allow-staged --allow-dirty # For fixing clippy warnings | ||
cargo test | ||
echo "" | ||
echo "STARTING: Running precommit checks" | ||
echo "" | ||
# First step, run copyright script, update the output as the status | ||
printf "1 - status: running - process: running copyright" && python3 scripts/copyright.py && printf "\r1 - status: success - process: running copyright\n" | ||
# Second step, run clippy | ||
printf "2 - status: running - process: running clippy" && cargo clippy -q --all-targets --all-features -- -D warnings && printf "\r2 - status: success - process: running clippy\n" | ||
# Third step, run test with no output, check if process exited with 0 | ||
printf "3 - status: running - process: running test" && if cargo test &> /dev/null; then | ||
printf "\r3 - status: success - process: running test\n"; | ||
else | ||
printf "\r3 - status: failed - process: running tes\n"; | ||
echo "" | ||
echo "RESULT: FAIL - Tests failed, please check the tests with 'cargo test' command" | ||
echo "" | ||
exit 1 | ||
fi | ||
echo "" | ||
echo "RESULT: SUCCESS - All precommit checks passed, you can commit now!" | ||
echo "" |
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,147 @@ | ||
/* | ||
* This file is part of Monume's library libmonero | ||
* | ||
* Copyright (c) 2023-2024, Monume (monume.xyz) | ||
* All Rights Reserved | ||
* The code is distributed under MIT license, see LICENSE file for details. | ||
* Generated by Monume | ||
* | ||
*/ | ||
|
||
#![allow(non_snake_case)] | ||
|
||
// Block structs | ||
|
||
pub struct BlockHeader { | ||
pub block_size: u64, | ||
pub block_weight: u64, | ||
pub cumulative_difficulty: u64, | ||
pub cumulative_difficulty_top64: u64, | ||
pub depth: u64, | ||
pub difficulty: u64, | ||
pub difficulty_top64: u64, | ||
pub hash: String, | ||
pub height: u64, | ||
pub long_term_weight: u64, | ||
pub major_version: u64, | ||
pub miner_tx_hash: String, | ||
pub minor_version: u64, | ||
pub nonce: u64, | ||
pub num_txes: u64, | ||
pub orphan_status: bool, | ||
pub pow_hash: String, | ||
pub prev_hash: String, | ||
pub reward: u64, | ||
pub timestamp: u64, | ||
pub wide_cumulative_difficulty: String, | ||
pub wide_difficulty: String | ||
} | ||
|
||
pub struct Gen { | ||
pub height: u64, | ||
} | ||
|
||
pub struct Vin { | ||
pub gen: Gen, | ||
} | ||
|
||
pub struct TaggedKey { | ||
pub key: String, | ||
pub view_tag: String, | ||
} | ||
|
||
pub struct Target { | ||
pub tagged_key: TaggedKey, | ||
} | ||
|
||
pub struct Vout { | ||
pub amount: u64, | ||
pub target: Target, | ||
} | ||
|
||
pub struct EcdhInfo { | ||
pub trunc_amount: String, | ||
} | ||
|
||
pub struct RctSignatures { | ||
pub type_int: u64, | ||
pub txn_fee: u64, | ||
pub ecdh_info: Vec<EcdhInfo>, | ||
pub out_pk: Vec<String>, | ||
} | ||
|
||
pub struct MinerTxInfo { | ||
pub version: u64, | ||
pub unlock_time: u64, | ||
pub vin: Vec<Vin>, | ||
pub vout: Vec<Vout>, | ||
pub extra: Vec<u8>, | ||
pub rct_signatures: RctSignatures | ||
} | ||
|
||
pub struct BlockDetailsJSON { | ||
pub major_version: u64, | ||
pub minor_version: u64, | ||
pub timestamp: u64, | ||
pub prev_id: String, | ||
pub nonce: u64, | ||
pub miner_tx: MinerTxInfo, | ||
pub tx_hashes: Vec<String>, | ||
} | ||
|
||
pub struct Block { | ||
pub blob: String, | ||
pub block_header: BlockHeader, | ||
pub credits: u64, | ||
pub json: BlockDetailsJSON, | ||
pub miner_tx_hash: String, | ||
pub status: String, | ||
pub top_hash: String, | ||
pub untrusted: bool | ||
} | ||
|
||
// Tx structs | ||
|
||
pub struct KeyRawTx { | ||
pub amount: u64, | ||
pub key_offsets: Vec<u64>, | ||
pub k_image: String | ||
} | ||
|
||
pub struct VinRawTx { | ||
pub key: KeyRawTx | ||
} | ||
|
||
pub struct BPP { | ||
pub A: String, | ||
pub A1: String, | ||
pub B: String, | ||
pub r1: String, | ||
pub s1: String, | ||
pub d1: String, | ||
pub L: Vec<String>, | ||
pub R: Vec<String>, | ||
} | ||
|
||
pub struct CLSAG { | ||
pub s: Vec<String>, | ||
pub c1: String, | ||
pub D: String, | ||
} | ||
|
||
pub struct RctsigPrunable { | ||
pub nbp: u64, | ||
pub bpp: Vec<BPP>, | ||
pub CLSAGs: Vec<CLSAG>, | ||
pub pseudo_outs: Vec<String> | ||
} | ||
|
||
pub struct RawTx { | ||
pub version: u64, | ||
pub unlock_time: u64, | ||
pub vin: Vec<VinRawTx>, | ||
pub vout: Vec<Vout>, | ||
pub extra: Vec<u8>, | ||
pub rct_signatures: RctSignatures, | ||
pub rctsig_prunable: RctsigPrunable, | ||
} |
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,18 @@ | ||
/* | ||
* This file is part of Monume's library libmonero | ||
* | ||
* Copyright (c) 2023-2024, Monume (monume.xyz) | ||
* All Rights Reserved | ||
* The code is distributed under MIT license, see LICENSE file for details. | ||
* Generated by Monume | ||
* | ||
*/ | ||
|
||
pub(crate) mod rpcs; | ||
pub(crate) mod nodes; | ||
pub(crate) mod transactions; | ||
pub(crate) mod block; | ||
|
||
pub use rpcs::*; | ||
pub use nodes::*; | ||
pub use block::*; |
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,46 @@ | ||
/* | ||
* This file is part of Monume's library libmonero | ||
* | ||
* Copyright (c) 2023-2024, Monume (monume.xyz) | ||
* All Rights Reserved | ||
* The code is distributed under MIT license, see LICENSE file for details. | ||
* Generated by Monume | ||
* | ||
*/ | ||
|
||
/// DaemonNode struct contains all necessary and additional information about a daemon node | ||
pub struct DaemonNode { | ||
pub url: String, | ||
pub port: u16, | ||
pub tls: bool, | ||
} | ||
|
||
/// DaemonNode functions etc. | ||
impl DaemonNode { | ||
/// Returns Cake Wallet's default node | ||
pub fn cake_wallet_default() -> DaemonNode { | ||
DaemonNode { | ||
url: "xmr-node.cakewallet.com".to_string(), | ||
port: 18081, | ||
tls: false | ||
} | ||
} | ||
|
||
/// Returns Stack Wallet's default node | ||
pub fn stack_wallet_default() -> DaemonNode { | ||
DaemonNode { | ||
url: "monero.stackwallet.com".to_string(), | ||
port: 18081, | ||
tls: false | ||
} | ||
} | ||
|
||
/// Creates a new DaemonNode from a given URL, port and tls flag | ||
pub fn new(url: String, port: u16, tls: bool) -> DaemonNode { | ||
DaemonNode { | ||
url, | ||
port, | ||
tls | ||
} | ||
} | ||
} |
Oops, something went wrong.