Re-add testing tools to the build path (#55)

* Re-add the testing tools to build path

* Correct the default RPC URL.

The URLs for the RPC nodes were updated to use the api prefix. The older URLs no longer work.

* Harmless misspelling

* Use Key enum for Vault contract

* Re-order imports so rustfmt passes
This commit is contained in:
praskoson 2021-06-19 20:22:28 +02:00 committed by GitHub
parent d52335b31d
commit 9f65bcf325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 9 deletions

View File

@ -4,6 +4,10 @@ members = [
"metaplex/program",
"token-vault/program",
"token-metadata/program",
"auction/cli",
"metaplex/test",
"token-vault/test",
"token-metadata/test",
]
exclude = [
]

View File

@ -563,7 +563,7 @@ fn main() {
.takes_value(true)
.global(true)
.validator(is_url)
.help("JSON RPC URL for the cluster [default: devnet]"),
.help("JSON RPC URL for the cluster [default: testnet]"),
)
.subcommand(
SubCommand::with_name("create")
@ -1085,7 +1085,7 @@ fn main() {
let client = RpcClient::new(
app_matches
.value_of("json_rpc_url")
.unwrap_or(&"https://testnet.solana.com".to_owned())
.unwrap_or(&"https://api.testnet.solana.com".to_owned())
.to_owned(),
);

View File

@ -267,7 +267,7 @@ fn main() {
let client = RpcClient::new(
app_matches
.value_of("json_rpc_url")
.unwrap_or(&"https://devnet.solana.com".to_owned())
.unwrap_or(&"https://api.devnet.solana.com".to_owned())
.to_owned(),
);

View File

@ -29,7 +29,7 @@ use {
state::Account,
},
spl_token_metadata::state::{MasterEdition, EDITION},
spl_token_vault::state::{SafetyDepositBox, Vault, SAFETY_DEPOSIT_KEY},
spl_token_vault::state::{Key, SafetyDepositBox, Vault},
std::{collections::HashMap, str::FromStr},
};
@ -400,7 +400,7 @@ pub fn redeem_bid_wrapper(app_matches: &ArgMatches, payer: Keypair, client: RpcC
let obj_key = &acc.0;
let type_of_obj = obj.data[0];
if type_of_obj == SAFETY_DEPOSIT_KEY {
if type_of_obj == Key::SafetyDepositBoxV1 as u8 {
let pubkey_arr = array_ref![obj.data, 1, 32];
let pubkey = Pubkey::new_from_array(*pubkey_arr);
if pubkey == manager.vault {

View File

@ -15,7 +15,7 @@ use {
state::{AuctionManager, WinningConfig},
},
spl_token_metadata::state::{Key, MasterEdition, EDITION},
spl_token_vault::state::{SafetyDepositBox, SAFETY_DEPOSIT_KEY},
spl_token_vault::state::{Key as VaultKey, SafetyDepositBox},
std::{collections::HashMap, str::FromStr},
};
@ -64,7 +64,7 @@ pub fn validate_safety_deposits(app_matches: &ArgMatches, payer: Keypair, client
let obj_key = &acc.0;
let type_of_obj = obj.data[0];
if type_of_obj == SAFETY_DEPOSIT_KEY {
if type_of_obj == VaultKey::SafetyDepositBoxV1 as u8 {
let pubkey_arr = array_ref![obj.data, 1, 32];
let pubkey = Pubkey::new_from_array(*pubkey_arr);
if pubkey == manager.vault {

View File

@ -803,7 +803,7 @@ fn main() {
let client = RpcClient::new(
app_matches
.value_of("json_rpc_url")
.unwrap_or(&"https://devnet.solana.com".to_owned())
.unwrap_or(&"https://api.devnet.solana.com".to_owned())
.to_owned(),
);

View File

@ -1263,7 +1263,7 @@ fn main() {
let client = RpcClient::new(
app_matches
.value_of("json_rpc_url")
.unwrap_or(&"https://devnet.solana.com".to_owned())
.unwrap_or(&"https://api.devnet.solana.com".to_owned())
.to_owned(),
);