Fix formatting
Change-Id: I4aaa4ab6bb72d7645a12f0a28a99db71a183ad87
This commit is contained in:
parent
18134cce96
commit
b97a32df37
|
@ -91,7 +91,9 @@ pub fn upgrade_contract(
|
|||
accs.spill.key,
|
||||
);
|
||||
|
||||
let seeds = accs.upgrade_authority.self_bumped_seeds(None, ctx.program_id);
|
||||
let seeds = accs
|
||||
.upgrade_authority
|
||||
.self_bumped_seeds(None, ctx.program_id);
|
||||
let seeds: Vec<&[u8]> = seeds.iter().map(|item| item.as_slice()).collect();
|
||||
let seeds = seeds.as_slice();
|
||||
invoke_signed(&upgrade_ix, ctx.accounts, &[seeds])?;
|
||||
|
|
|
@ -67,13 +67,16 @@ pub fn initialize(
|
|||
AccountMeta::new_readonly(sysvar::rent::id(), false),
|
||||
AccountMeta::new_readonly(solana_program::system_program::id(), false),
|
||||
],
|
||||
data: (crate::instruction::Instruction::Initialize, InitializeData {
|
||||
initial_guardians: initial_guardians.to_vec(),
|
||||
fee,
|
||||
fee_persistent,
|
||||
guardian_set_expiration_time,
|
||||
})
|
||||
.try_to_vec()?,
|
||||
data: (
|
||||
crate::instruction::Instruction::Initialize,
|
||||
InitializeData {
|
||||
initial_guardians: initial_guardians.to_vec(),
|
||||
fee,
|
||||
fee_persistent,
|
||||
guardian_set_expiration_time,
|
||||
},
|
||||
)
|
||||
.try_to_vec()?,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -122,13 +125,16 @@ pub fn post_message(
|
|||
AccountMeta::new_readonly(solana_program::system_program::id(), false),
|
||||
],
|
||||
|
||||
data: (crate::instruction::Instruction::PostMessage, PostMessageData {
|
||||
nonce,
|
||||
payload: payload.clone(),
|
||||
persist,
|
||||
consistency_level: commitment,
|
||||
})
|
||||
.try_to_vec()?,
|
||||
data: (
|
||||
crate::instruction::Instruction::PostMessage,
|
||||
PostMessageData {
|
||||
nonce,
|
||||
payload: payload.clone(),
|
||||
persist,
|
||||
consistency_level: commitment,
|
||||
},
|
||||
)
|
||||
.try_to_vec()?,
|
||||
},
|
||||
))
|
||||
}
|
||||
|
@ -247,7 +253,10 @@ pub fn upgrade_contract(
|
|||
AccountMeta::new_readonly(spill, false),
|
||||
],
|
||||
|
||||
data: (crate::instruction::Instruction::UpgradeContract, UpgradeContractData {})
|
||||
data: (
|
||||
crate::instruction::Instruction::UpgradeContract,
|
||||
UpgradeContractData {},
|
||||
)
|
||||
.try_to_vec()
|
||||
.unwrap(),
|
||||
}
|
||||
|
@ -295,7 +304,10 @@ pub fn upgrade_guardian_set(
|
|||
AccountMeta::new_readonly(solana_program::system_program::id(), false),
|
||||
],
|
||||
|
||||
data: (crate::instruction::Instruction::UpgradeGuardianSet, UpgradeGuardianSetData {})
|
||||
data: (
|
||||
crate::instruction::Instruction::UpgradeGuardianSet,
|
||||
UpgradeGuardianSetData {},
|
||||
)
|
||||
.try_to_vec()
|
||||
.unwrap(),
|
||||
}
|
||||
|
@ -369,7 +381,10 @@ pub fn transfer_fees(
|
|||
AccountMeta::new_readonly(solana_program::system_program::id(), false),
|
||||
],
|
||||
|
||||
data: (crate::instruction::Instruction::TransferFees, TransferFeesData {})
|
||||
data: (
|
||||
crate::instruction::Instruction::TransferFees,
|
||||
TransferFeesData {},
|
||||
)
|
||||
.try_to_vec()
|
||||
.unwrap(),
|
||||
}
|
||||
|
|
|
@ -345,9 +345,7 @@ mod helpers {
|
|||
payer.pubkey(),
|
||||
guardian_set_version,
|
||||
body,
|
||||
VerifySignaturesData {
|
||||
signers,
|
||||
},
|
||||
VerifySignaturesData { signers },
|
||||
)
|
||||
.unwrap(),
|
||||
],
|
||||
|
|
|
@ -223,7 +223,7 @@ fn test_bridge_messages(context: &mut Context) {
|
|||
|
||||
// Derive where we expect created accounts to be.
|
||||
let signature_set = SignatureSet::<'_, { AccountState::Uninitialized }>::key(
|
||||
&SignatureSetDerivationData { hash: body},
|
||||
&SignatureSetDerivationData { hash: body },
|
||||
&program,
|
||||
);
|
||||
|
||||
|
@ -856,7 +856,7 @@ fn test_set_fees_fails(context: &mut Context) {
|
|||
.unwrap();
|
||||
|
||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||
common::post_vaa(client, program, payer, vaa).unwrap();
|
||||
assert!(common::set_fees(
|
||||
client,
|
||||
|
@ -1235,7 +1235,7 @@ fn test_transfer_total_fails(context: &mut Context) {
|
|||
.unwrap();
|
||||
|
||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||
common::post_vaa(client, program, payer, vaa).unwrap();
|
||||
|
||||
// Transferring total fees should fail, to prevent the account being de-allocated.
|
||||
|
|
|
@ -1189,12 +1189,6 @@ version = "0.4.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||
|
||||
[[package]]
|
||||
name = "hex-literal"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "76505e26b6ca3bbdbbb360b68472abbb80998c5fa5dc43672eca34f28258e138"
|
||||
|
||||
[[package]]
|
||||
name = "hidapi"
|
||||
version = "1.2.6"
|
||||
|
@ -3448,16 +3442,10 @@ dependencies = [
|
|||
"borsh",
|
||||
"bridge",
|
||||
"byteorder",
|
||||
"hex",
|
||||
"hex-literal",
|
||||
"libsecp256k1",
|
||||
"primitive-types",
|
||||
"rand 0.7.3",
|
||||
"rocksalt",
|
||||
"sha3",
|
||||
"solana-client",
|
||||
"solana-program",
|
||||
"solana-sdk",
|
||||
"solitaire",
|
||||
"solitaire-client",
|
||||
"spl-token",
|
||||
|
|
Loading…
Reference in New Issue