From 43071cfa8742628acc8e8b035704cc1a90ca4293 Mon Sep 17 00:00:00 2001 From: Zshan0 Date: Fri, 8 Apr 2022 02:13:37 +0530 Subject: [PATCH] Changed `ManagerStakeholder` to `StakeholderManager`. --- src/commands/utils.rs | 6 +++--- src/communication.rs | 2 +- src/database/actions.rs | 14 +++++++------- src/database/interface.rs | 2 +- src/jsonrpc/server.rs | 2 +- src/revaultd.rs | 2 +- src/utils.rs | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/commands/utils.rs b/src/commands/utils.rs index 6bc56473..5ab3bc4f 100644 --- a/src/commands/utils.rs +++ b/src/commands/utils.rs @@ -886,7 +886,7 @@ mod tests { #[test] fn test_listvaults_from_db() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); setup_db(&mut revaultd).unwrap(); let vaults = create_vaults(&revaultd); @@ -976,7 +976,7 @@ mod tests { #[test] fn test_vaults_from_deposits() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_file = revaultd.db_file(); setup_db(&mut revaultd).unwrap(); let vaults = create_vaults(&revaultd); @@ -1388,7 +1388,7 @@ mod tests { #[test] fn test_gethistory() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); setup_db(&mut revaultd).unwrap(); let db_file = revaultd.db_file(); diff --git a/src/communication.rs b/src/communication.rs index ca9b4558..38ddb4a6 100644 --- a/src/communication.rs +++ b/src/communication.rs @@ -1206,7 +1206,7 @@ mod tests { #[test] fn test_check_spend_transaction_size() { let datadir = test_datadir(); - let revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); // 3 inputs, 4 outputs, 3 stakeholders and 3 manager psbt. No problem. let tx = SpendTransaction::from_psbt_str("cHNidP8BAP0ZAQIAAAADSe9QbkOAlLapVzhNT2J2sCWXMqe2x7g7klEr3N6+p8AAAAAAAAYAAABwwCBKiamcBn5fj0oQ3WcAU+twE4XemcK4G2nlprqBKAAAAAAABgAAAAwCYIUh0y2bkIH8BVZ/evuFulOCxOyGr/rvZnR2k/9aAAAAAAAGAAAABFCoAAAAAAAAIgAgvXwvxBU2X03+pufsytFJ2dS4BKVXIKMQmyxUXTbPJPmA8PoCAAAAABYAFCMDXGnefAb487YxeNjnpbUzH+pEQEtMAAAAAAAWABT+rq2LTo+bnAo3ZQoeUg0F6xVZbIx3EwIAAAAAIgAgfAYV/vqzwEWHS6kVMjA1yQRbIQqq//o7m4ik0eSSlasAAAAAAAEBKzb0VQMAAAAAIgAgEyIAQqFnv+D0rMmVvusK3TC6fPyFk7aU1PZ8+Ttm23IBAwQBAAAAAQXBUiEDNWoO4CCloCul5eCLd1+XLPxP4LMIsUy+XM01wlm59wIhAqQ3tGeAeMBPPR26fn0kuL0CS0AybrDlu8NwIzFOOukzIQJoBBIwDWTXwjMse2MiB8/kIcFOZACiADcmZltiEl85N1OuZHapFIe9/DRONZOp5OAQ6RCrIDclCDEjiKxrdqkUJs2E27SQYhbh4yxNkO+lDnFqCCaIrGyTa3apFBtcD9uL3TRJt1uCIj2J8Ub4YjvgiKxsk1OHZ1ayaCIGAmgEEjANZNfCMyx7YyIHz+QhwU5kAKIANyZmW2ISXzk3CO9FHBcBAAAAIgYCpDe0Z4B4wE89Hbp+fSS4vQJLQDJusOW7w3AjMU466TMIW+FtfgEAAAAiBgM1ag7gIKWgK6Xl4It3X5cs/E/gswixTL5czTXCWbn3AgjDFaC/AQAAAAABASs2rG0BAAAAACIAIICUwlAfLlUkhU44Hpkj/LEDNAdwME4fm3jtWfXwMwL7AQMEAQAAAAEFwVIhAgSNQIWSNnYSrfEl8ju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PGMiu2SYfOACFQhTR/BbAQAAAAAAACICAr+BTfGuO1VRPxE1DJoFIsH1Vu5Dk5lSullVQjCXjVlICEPuDksBAAAAIgIC+G7/TA9DNgnMf4Nup2Py3XAF8UCLmziV3Vw4Z2KsJcwIpbzhFQEAAAAiAgOpos5KhVRQaTPJTi3mk12g5sApoQNVGdOpMcMmn7C7gwieIH0+AQAAAAA=").unwrap(); assert!(check_spend_transaction_size(&revaultd, tx)); diff --git a/src/database/actions.rs b/src/database/actions.rs index 28507162..5d28c9d8 100644 --- a/src/database/actions.rs +++ b/src/database/actions.rs @@ -1101,7 +1101,7 @@ mod test { #[test] fn test_db_creation() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); create_db(&mut revaultd).unwrap(); // There must be a wallet entry now, and there is only one so its id must @@ -1130,7 +1130,7 @@ mod test { #[test] fn test_db_fetch_deposits() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_path = revaultd.db_file(); setup_db(&mut revaultd).unwrap(); @@ -1236,7 +1236,7 @@ mod test { #[test] fn test_db_store_presigned_txs() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_path = revaultd.db_file(); let secp_ctx = secp256k1::Secp256k1::new(); @@ -1536,7 +1536,7 @@ mod test { #[test] fn test_db_confirm_unvault() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_path = revaultd.db_file(); setup_db(&mut revaultd).unwrap(); @@ -1611,7 +1611,7 @@ mod test { #[test] fn test_db_concurrent_write() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_path = revaultd.db_file(); let secp_ctx = secp256k1::Secp256k1::new(); @@ -1689,7 +1689,7 @@ mod test { #[test] fn test_db_spend_storage() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_path = revaultd.db_file(); let fresh_cancel_tx = CancelTransaction::from_psbt_str("cHNidP8BAF4CAAAAARoHs0elD2sCfWV4+b7PH3aRA+BkRVNf3m/P+Epjx2fNAAAAAAD9////AdLKAgAAAAAAIgAgB6abzQJ4vo5CO9XW3r3JnNumTwlpQbZm9FVICsLHPYQAAAAAAAEBK0ANAwAAAAAAIgAglEs6phQpv+twnAQSdjDvAEic65OtUIijeePBzAAqr50BAwSBAAAAAQWrIQO4lrAuffeRLuEEuwp2hAMZIPmqaHMTUySM3OwdA2hIW6xRh2R2qRTflccImFIy5NdTqwPuPZFB7g1pvYisa3apFOQxXoLeQv/aDFfav/l6YnYRKt+1iKxsk1KHZ1IhA32Q1DEqQ/kUP2MvQYFW46RCexZ5aYk17Arhp01th+37IQNrXQtfIXQdrv+RyyHLilJsb4ujlUMddG9X2jYkeXiWoFKvA3nxALJoIgYCEnb0lxeNI9466wDX+tqlq23zYNacTlLVLLLxtcVobG0INaO2mQoAAAAAAQFHUiED35umh5GhiToV6GS7lTokWfq/Rvy+rRI9XMQuf+foOoEhA9GtXpHhUvxcj9DJWbaRvz59CNsMwH2NEvmRa8gc2WRkUq4iAgISdvSXF40j3jrrANf62qWrbfNg1pxOUtUssvG1xWhsbQg1o7aZCgAAAAA=").unwrap(); let fresh_unvault_tx = UnvaultTransaction::from_psbt_str("cHNidP8BAIkCAAAAAfF2iPeJqz13zFlW6eLAM+uDu5IhUqcQxtMWQx7z5Y8lAAAAAAD9////AkANAwAAAAAAIgAgKb0SdnuqeHAJpRuZTbk3r81qbXpuHrMEmxT9Kph47HQwdQAAAAAAACIAIIMbpoIz4DI+aB1p/EJLyqjyDdDeZ7gG8kPhRIDiWaY8AAAAAAABASuIlAMAAAAAACIAIA9CgZ1cg/hn3iy3buDZvU5zUnQ9NzutToR/r42YZyu3AQMEAQAAAAEFR1IhA9P6hV8yf6HkNofzleom06eqkUxZayWHJnOMNlMtqvD3IQJo5Mj6Wf3ktrwEB3IQXFmgApibojplpNykg0hA8XV6SFKuIgYCEnb0lxeNI9466wDX+tqlq23zYNacTlLVLLLxtcVobG0INaO2mQoAAAAAAQGqIQMfu47eLiYeHN6Y3C1Vk0ckgmWifMy5IUhaPHbNELV93axRh2R2qRTtiGxBD5KrMQQU6UGx2zsKMMf6nIisa3apFCDKte9IuDeF0D4GA/JRUNX4xgt+iKxsk1KHZ1IhAzTPPnjrvzPFmi+raNR6sY8WTt1KNusVwp82uWebzWDwIQKl21mZX7WAQhRvdhhwqUAuQfIemg9zkTCCyMQ+Q8CVFVKvAqUBsmgiAgISdvSXF40j3jrrANf62qWrbfNg1pxOUtUssvG1xWhsbQg1o7aZCgAAAAABASUhAx+7jt4uJh4c3pjcLVWTRySCZaJ8zLkhSFo8ds0QtX3drFGHIgICEnb0lxeNI9466wDX+tqlq23zYNacTlLVLLLxtcVobG0INaO2mQoAAAAA").unwrap(); @@ -1957,7 +1957,7 @@ mod test { #[test] fn test_db_update_vault_status() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_path = revaultd.db_file(); setup_db(&mut revaultd).unwrap(); diff --git a/src/database/interface.rs b/src/database/interface.rs index 20901d3b..31751031 100644 --- a/src/database/interface.rs +++ b/src/database/interface.rs @@ -968,7 +968,7 @@ mod test { #[test] fn test_db_vaults_with_txids_in_period() { let datadir = test_datadir(); - let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::ManagerStakeholder); + let mut revaultd = dummy_revaultd(datadir.clone(), UserRole::StakeholderManager); let db_path = revaultd.db_file(); setup_db(&mut revaultd).unwrap(); let genesis_timestamp: u32 = 1231006505; diff --git a/src/jsonrpc/server.rs b/src/jsonrpc/server.rs index 05ebf3eb..a99b7078 100644 --- a/src/jsonrpc/server.rs +++ b/src/jsonrpc/server.rs @@ -432,7 +432,7 @@ mod tests { #[test] fn simple_write_recv() { let datadir = test_datadir(); - let rpcutils = dummy_rpcutil(datadir.clone(), UserRole::ManagerStakeholder); + let rpcutils = dummy_rpcutil(datadir.clone(), UserRole::StakeholderManager); let revaultd_datadir = rpcutils.revaultd.read().unwrap().data_dir.clone(); let mut rpc_socket_path = revaultd_datadir.clone(); rpc_socket_path.push("revaultd_rpc"); diff --git a/src/revaultd.rs b/src/revaultd.rs index ad0e5a3b..8d746101 100644 --- a/src/revaultd.rs +++ b/src/revaultd.rs @@ -280,7 +280,7 @@ pub struct BlockchainTip { pub enum UserRole { Stakeholder, Manager, - ManagerStakeholder, + StakeholderManager, } /// Our global state diff --git a/src/utils.rs b/src/utils.rs index 25e092be..7a52c2b2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -69,7 +69,7 @@ addr = "127.0.0.1:8332" match role { UserRole::Stakeholder => config += stake_config, UserRole::Manager => config += man_config, - UserRole::ManagerStakeholder => { + UserRole::StakeholderManager => { config += stake_config; config += man_config; }