Skip to content

Commit 4dd8c3e

Browse files
committed
ci tests
1 parent 9fe5ed6 commit 4dd8c3e

File tree

15 files changed

+361
-264
lines changed

15 files changed

+361
-264
lines changed

svm/modules/executor-requests/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,15 @@ impl RelayInstructionsBuilder {
129129

130130
/// Add a GasInstruction to the relay instructions.
131131
pub fn with_gas(mut self, gas_limit: u128, msg_value: u128) -> Self {
132-
self.data.extend(make_relay_instruction_gas(gas_limit, msg_value));
132+
self.data
133+
.extend(make_relay_instruction_gas(gas_limit, msg_value));
133134
self
134135
}
135136

136137
/// Add a GasDropOffInstruction to the relay instructions.
137138
pub fn with_gas_drop_off(mut self, drop_off: u128, recipient: &[u8; 32]) -> Self {
138-
self.data.extend(make_relay_instruction_gas_drop_off(drop_off, recipient));
139+
self.data
140+
.extend(make_relay_instruction_gas_drop_off(drop_off, recipient));
139141
self
140142
}
141143

svm/pinocchio/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ These programs use the [Pinocchio](https://github.com/febo/pinocchio) framework,
1111

1212
## Devnet Deployments
1313

14-
| Program | Address |
15-
| ---------------------- | ---------------------------------------------- |
16-
| executor-quoter | `qtrxiqVAfVS61utwZLUi7UKugjCgFaNxBGyskmGingz` |
14+
| Program | Address |
15+
| ---------------------- | --------------------------------------------- |
16+
| executor-quoter | `qtrxiqVAfVS61utwZLUi7UKugjCgFaNxBGyskmGingz` |
1717
| executor-quoter-router | `qtrrrV7W3E1jnX1145wXR6ZpthG19ur5xHC1n6PPhDV` |
1818

1919
## Directory Structure

svm/pinocchio/programs/executor-quoter-router/src/instructions/executor_cpi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use alloc::vec::Vec;
99

1010
/// Anchor discriminator for executor::request_for_execution
1111
/// Generated from: sha256("global:request_for_execution")[0..8]
12-
const EXECUTOR_REQUEST_FOR_EXECUTION_DISCRIMINATOR: [u8; 8] = [0x6d, 0x6b, 0x57, 0x25, 0x97, 0xc0, 0x77, 0x73];
12+
const EXECUTOR_REQUEST_FOR_EXECUTION_DISCRIMINATOR: [u8; 8] =
13+
[0x6d, 0x6b, 0x57, 0x25, 0x97, 0xc0, 0x77, 0x73];
1314

1415
/// Builds instruction data for Anchor executor::request_for_execution CPI.
1516
///

svm/pinocchio/programs/executor-quoter-router/src/instructions/quote_execution.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,14 @@ pub fn process(program_id: &Pubkey, accounts: &[AccountInfo], data: &[u8]) -> Pr
146146
data: cpi_data,
147147
};
148148

149-
pinocchio::cpi::invoke(&cpi_instruction, &[quoter_config, quoter_chain_info, quoter_quote_body])?;
149+
pinocchio::cpi::invoke(
150+
&cpi_instruction,
151+
&[quoter_config, quoter_chain_info, quoter_quote_body],
152+
)?;
150153

151154
// Get return data from quoter and forward it
152-
let return_data = pinocchio::cpi::get_return_data()
153-
.ok_or(ExecutorQuoterRouterError::InvalidReturnData)?;
155+
let return_data =
156+
pinocchio::cpi::get_return_data().ok_or(ExecutorQuoterRouterError::InvalidReturnData)?;
154157
set_return_data(return_data.as_slice());
155158

156159
Ok(())

svm/pinocchio/programs/executor-quoter-router/src/instructions/request_execution.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,18 @@ pub fn process(program_id: &Pubkey, accounts: &[AccountInfo], data: &[u8]) -> Pr
199199

200200
pinocchio::cpi::invoke(
201201
&quoter_cpi_instruction,
202-
&[quoter_config, quoter_chain_info, quoter_quote_body, event_cpi],
202+
&[
203+
quoter_config,
204+
quoter_chain_info,
205+
quoter_quote_body,
206+
event_cpi,
207+
],
203208
)?;
204209

205210
// Get return data from quoter: (required_payment, payee_address, quote_body)
206211
// Layout: 8 bytes payment + 32 bytes payee + 32 bytes quote_body = 72 bytes
207-
let return_data = pinocchio::cpi::get_return_data()
208-
.ok_or(ExecutorQuoterRouterError::InvalidReturnData)?;
212+
let return_data =
213+
pinocchio::cpi::get_return_data().ok_or(ExecutorQuoterRouterError::InvalidReturnData)?;
209214

210215
if return_data.len() < 72 {
211216
return Err(ExecutorQuoterRouterError::InvalidReturnData.into());
@@ -270,10 +275,7 @@ pub fn process(program_id: &Pubkey, accounts: &[AccountInfo], data: &[u8]) -> Pr
270275
data: &executor_ix_data,
271276
};
272277

273-
pinocchio::cpi::invoke(
274-
&executor_cpi_instruction,
275-
&[payer, payee, system_program],
276-
)?;
278+
pinocchio::cpi::invoke(&executor_cpi_instruction, &[payer, payee, system_program])?;
277279

278280
Ok(())
279281
}

svm/pinocchio/programs/executor-quoter-router/src/instructions/serialization.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,4 @@ impl GovernanceMessage {
119119
pub fn signed_message<'a>(&self, original_data: &'a [u8]) -> &'a [u8] {
120120
&original_data[0..98]
121121
}
122-
123122
}

svm/pinocchio/programs/executor-quoter-router/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ pub const OUR_CHAIN: u16 = 1;
3131

3232
/// Executor program ID: execXUrAsMnqMmTHj5m7N1YQgsDz3cwGLYCYyuDRciV
3333
pub const EXECUTOR_PROGRAM_ID: Pubkey = [
34-
0x09, 0xb9, 0x69, 0x71, 0x58, 0x3b, 0x59, 0x03,
35-
0xe0, 0x28, 0x1d, 0xa9, 0x65, 0x48, 0xd5, 0xd2,
36-
0x3c, 0x65, 0x1f, 0x7a, 0x9c, 0xcd, 0xe3, 0xea,
37-
0xd5, 0x2b, 0x42, 0xf6, 0xb7, 0xda, 0xc2, 0xd2,
34+
0x09, 0xb9, 0x69, 0x71, 0x58, 0x3b, 0x59, 0x03, 0xe0, 0x28, 0x1d, 0xa9, 0x65, 0x48, 0xd5, 0xd2,
35+
0x3c, 0x65, 0x1f, 0x7a, 0x9c, 0xcd, 0xe3, 0xea, 0xd5, 0x2b, 0x42, 0xf6, 0xb7, 0xda, 0xc2, 0xd2,
3836
];
3937

4038
/// Instruction discriminators

svm/pinocchio/programs/executor-quoter-router/src/state.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ pub fn load_account<T: Pod + Copy + Discriminator>(
6666
.map_err(|_| ProgramError::InvalidAccountData)?;
6767
Ok(*account)
6868
}
69-

svm/pinocchio/programs/executor-quoter/build.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ fn main() {
88

99
// Parse QUOTER_UPDATER_PUBKEY env var (base58 pubkey string)
1010
// Falls back to a default test pubkey if not set
11-
let updater_pubkey = env::var("QUOTER_UPDATER_PUBKEY").expect("Updater pubkey must be set at build time");
11+
let updater_pubkey =
12+
env::var("QUOTER_UPDATER_PUBKEY").expect("Updater pubkey must be set at build time");
1213

1314
// Parse QUOTER_PAYEE_PUBKEY env var (base58 pubkey string)
1415
// Falls back to same as updater if not set
@@ -17,10 +18,18 @@ fn main() {
1718
// Decode base58 to bytes
1819
let updater_bytes = bs58::decode(&updater_pubkey)
1920
.into_vec()
20-
.unwrap_or_else(|e| panic!("QUOTER_UPDATER_PUBKEY '{}' is not valid base58: {}", updater_pubkey, e));
21-
let payee_bytes = bs58::decode(&payee_pubkey)
22-
.into_vec()
23-
.unwrap_or_else(|e| panic!("QUOTER_PAYEE_PUBKEY '{}' is not valid base58: {}", payee_pubkey, e));
21+
.unwrap_or_else(|e| {
22+
panic!(
23+
"QUOTER_UPDATER_PUBKEY '{}' is not valid base58: {}",
24+
updater_pubkey, e
25+
)
26+
});
27+
let payee_bytes = bs58::decode(&payee_pubkey).into_vec().unwrap_or_else(|e| {
28+
panic!(
29+
"QUOTER_PAYEE_PUBKEY '{}' is not valid base58: {}",
30+
payee_pubkey, e
31+
)
32+
});
2433

2534
assert_eq!(
2635
updater_bytes.len(),

svm/pinocchio/programs/executor-quoter/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ use instructions::*;
2020

2121
/// Program ID - replace with actual deployed address
2222
pub static ID: Pubkey = [
23-
0x0d, 0xf8, 0xc4, 0xd6, 0x7b, 0x42, 0x89, 0xd6,
24-
0x3e, 0xf0, 0x63, 0x1b, 0x5d, 0x0c, 0x39, 0x18,
25-
0x2e, 0x8c, 0x9a, 0x4f, 0x7f, 0x9d, 0x8a, 0x3b,
26-
0x6c, 0x5e, 0x4d, 0x3c, 0x2b, 0x1a, 0x09, 0xf8,
23+
0x0d, 0xf8, 0xc4, 0xd6, 0x7b, 0x42, 0x89, 0xd6, 0x3e, 0xf0, 0x63, 0x1b, 0x5d, 0x0c, 0x39, 0x18,
24+
0x2e, 0x8c, 0x9a, 0x4f, 0x7f, 0x9d, 0x8a, 0x3b, 0x6c, 0x5e, 0x4d, 0x3c, 0x2b, 0x1a, 0x09, 0xf8,
2725
];
2826

2927
// =============================================================================

0 commit comments

Comments
 (0)