Skip to content

Commit 1e47995

Browse files
committed
chore: fix clippy and try removing symlink
1 parent 812617c commit 1e47995

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

engine/src/witness/sol/lookup_table_witnessing.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::str::FromStr;
1717
// only error if the rpc call fails or returns an unrecognized format respons. That is
1818
// because this address will be provided by the user (user alts) and in case of the address
1919
// not being a valid ALT we still want to reach consensus.
20+
#[allow(dead_code)]
2021
pub async fn get_lookup_table_state<SolRetryRpcClient>(
2122
sol_rpc: &SolRetryRpcClient,
2223
lookup_table_address: SolAddress,
@@ -147,7 +148,7 @@ mod tests {
147148

148149
// Check the first one just to make sure it's working
149150
assert_eq!(
150-
addresses.iter().next().unwrap(),
151+
addresses.first().unwrap(),
151152
&SolAddress::from_str("11111111111111111111111111111111").unwrap()
152153
);
153154

localnet/common.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ build-localnet() {
102102
REPLY=$(check_endpoint_health -H "Content-Type: application/json" -s -d '{"id":1, "jsonrpc":"2.0", "method": "chain_getBlockHash", "params":[0]}' 'http://localhost:9947') || [ -z $(echo $REPLY | grep -o '\"result\":\"0x[^"]*' | grep -o '0x.*') ]
103103
DOT_GENESIS_HASH=$(echo $REPLY | grep -o '\"result\":\"0x[^"]*' | grep -o '0x.*')
104104

105-
if ! solana --version | grep -q Agave; then
106-
# Not needed for newer clients even if the image was generated in the old v1.18.17
107-
echo "🐛 Fix solana symlink issue ..."
108-
ln -sf $SOLANA_BASE_PATH/test-ledger/accounts/snapshot/100 $SOLANA_BASE_PATH/test-ledger/snapshot/100/accounts_hardlinks/account_path_0
109-
fi
105+
# if ! solana --version | grep -q Agave; then
106+
# # Not needed for newer clients even if the image was generated in the old v1.18.17
107+
# echo "🐛 Fix solana symlink issue ..."
108+
# ln -sf $SOLANA_BASE_PATH/test-ledger/accounts/snapshot/100 $SOLANA_BASE_PATH/test-ledger/snapshot/100/accounts_hardlinks/account_path_0
109+
# fi
110110

111111
if which solana-test-validator >>$DEBUG_OUTPUT_DESTINATION 2>&1; then
112112
echo "☀️ Waiting for Solana node to start"

state-chain/cf-integration-tests/src/solana.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use cf_chains::{
1111
api::{SolanaApi, SolanaEnvironment, SolanaTransactionBuildingError},
1212
sol_tx_core::sol_test_values,
1313
transaction_builder::SolanaTransactionBuilder,
14-
SolAddress, SolApiEnvironment, SolCcmAccounts, SolCcmAddress, SolHash, SolPubkey,
15-
SolanaCrypto,
14+
SolAddress, SolAddressLookupTableAccount, SolApiEnvironment, SolCcmAccounts, SolCcmAddress,
15+
SolHash, SolPubkey, SolanaCrypto,
1616
},
1717
CcmChannelMetadata, CcmDepositMetadata, Chain, ChannelRefundParameters,
1818
ExecutexSwapAndCallError, ForeignChainAddress, RequiresSignatureRefresh, SetAggKeyWithAggKey,
@@ -84,6 +84,11 @@ fn setup_sol_environments() {
8484
usdc_token_vault_ata: sol_test_values::USDC_TOKEN_VAULT_ASSOCIATED_TOKEN_ACCOUNT,
8585
swap_endpoint_program: sol_test_values::SWAP_ENDPOINT_PROGRAM,
8686
swap_endpoint_program_data_account: sol_test_values::SWAP_ENDPOINT_PROGRAM_DATA_ACCOUNT,
87+
alt_manager_program: sol_test_values::ALT_MANAGER_PROGRAM,
88+
address_lookup_table_account: SolAddressLookupTableAccount {
89+
key: sol_test_values::ADDRESS_LOOKUP_TABLE_ACCOUNT.into(),
90+
addresses: vec![],
91+
},
8792
});
8893

8994
// Environment::AvailableDurableNonces

state-chain/chains/src/sol/sol_tx_core.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ pub mod sol_test_values {
166166
const_address("35uYgHdfZQT4kHkaaXQ6ZdCkK5LFrsk43btTLbGCRCNT");
167167
pub const SWAP_ENDPOINT_PROGRAM_DATA_ACCOUNT: SolAddress =
168168
const_address("2tmtGLQcBd11BMiE9B1tAkQXwmPNgR79Meki2Eme4Ec9");
169+
pub const ALT_MANAGER_PROGRAM: SolAddress =
170+
const_address("49XegQyykAXwzigc6u7gXbaLjhKfNadWMZwFiovzjwUw");
171+
pub const ADDRESS_LOOKUP_TABLE_ACCOUNT: SolAddress =
172+
const_address("7drVSq2ymJLNnXyCciHbNqHyzuSt1SL4iQSEThiESN2c");
169173
pub const EVENT_AND_SENDER_ACCOUNTS: [VaultSwapAccountAndSender; 11] = [
170174
VaultSwapAccountAndSender {
171175
vault_swap_account: const_address("2cHcSNtikMpjxJfwwoYL3udpy7hedRExyhakk2eZ6cYA"),
@@ -248,6 +252,11 @@ pub mod sol_test_values {
248252
usdc_token_vault_ata: USDC_TOKEN_VAULT_ASSOCIATED_TOKEN_ACCOUNT,
249253
swap_endpoint_program: SWAP_ENDPOINT_PROGRAM,
250254
swap_endpoint_program_data_account: SWAP_ENDPOINT_PROGRAM_DATA_ACCOUNT,
255+
alt_manager_program: ALT_MANAGER_PROGRAM,
256+
address_lookup_table_account: SolAddressLookupTableAccount {
257+
key: ADDRESS_LOOKUP_TABLE_ACCOUNT.into(),
258+
addresses: vec![],
259+
},
251260
}
252261
}
253262

state-chain/chains/src/sol/transaction_builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ pub mod test {
741741
env.vault_program,
742742
env.vault_program_data_account,
743743
agg_key(),
744+
env.alt_manager_program,
744745
durable_nonce(),
745746
compute_price(),
746747
vec![chainflip_alt()],

state-chain/pallets/cf-environment/src/mock.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ impl ChainEnvironment<ApiEnvironment, SolApiEnvironment> for MockSolEnvironment
150150
usdc_token_vault_ata: SolAddress([0x00; 32]),
151151
swap_endpoint_program: SolAddress([0x00; 32]),
152152
swap_endpoint_program_data_account: SolAddress([0x00; 32]),
153+
alt_manager_program: SolAddress([0x00; 32]),
154+
address_lookup_table_account: SolAddressLookupTableAccount {
155+
key: SolAddress([0x00; 32]).into(),
156+
addresses: vec![],
157+
},
153158
})
154159
}
155160
}

0 commit comments

Comments
 (0)