Skip to content

Commit

Permalink
Adjust to latest contracts (#94)
Browse files Browse the repository at this point in the history
* Use latest version of Photon

* Fix warnings
  • Loading branch information
pmantica11 authored May 7, 2024
1 parent 2474260 commit a848874
Show file tree
Hide file tree
Showing 31 changed files with 202 additions and 239 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "photon-indexer"
publish = true
readme = "README.md"
repository = "https://github.com/helius-labs/photon"
version = "0.17.0"
version = "0.18.0"

[[bin]]
name = "photon"
Expand Down
2 changes: 0 additions & 2 deletions src/common/typedefs/token_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ use super::{serializable_pubkey::SerializablePubkey, unsigned_integer::UnsignedI
#[repr(u8)]
#[derive(Default)]
pub enum AccountState {
#[allow(non_camel_case_types)]
uninitialized,
#[allow(non_camel_case_types)]
#[default]
initialized,
Expand Down
19 changes: 9 additions & 10 deletions src/ingester/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ pub fn parse_transaction(tx: &TransactionInfo, slot: u64) -> Result<StateUpdate,
// the following noop instruction because it'll contain either irrelevant or malicious data.
if ACCOUNT_COMPRESSION_PROGRAM_ID == instruction.program_id
&& instruction.accounts.contains(&NOOP_PROGRAM_ID)
&& next_instruction.program_id == SYSTEM_PROGRAM
&& next_next_instruction.program_id == NOOP_PROGRAM_ID
&& next_instruction.program_id == NOOP_PROGRAM_ID
&& next_next_instruction.program_id == SYSTEM_PROGRAM
&& next_next_next_instruction.program_id == NOOP_PROGRAM_ID
{
if !logged_transaction {
Expand All @@ -61,14 +61,13 @@ pub fn parse_transaction(tx: &TransactionInfo, slot: u64) -> Result<StateUpdate,
);
logged_transaction = true;
}
let changelogs =
Changelogs::deserialize(&mut next_next_instruction.data.as_slice())
.map_err(|e| {
IngesterError::ParserError(format!(
"Failed to deserialize Changelogs: {}",
e
))
})?;
let changelogs = Changelogs::deserialize(&mut next_instruction.data.as_slice())
.map_err(|e| {
IngesterError::ParserError(format!(
"Failed to deserialize Changelogs: {}",
e
))
})?;

let public_transaction_event = PublicTransactionEvent::deserialize(
&mut next_next_next_instruction.data.as_slice(),
Expand Down
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::fmt;
use std::fs::File;
use std::path::PathBuf;

use clap::{Parser, ValueEnum};
use jsonrpsee::server::ServerHandle;
Expand All @@ -20,7 +19,6 @@ use sqlx::{
sqlite::{SqliteConnectOptions, SqlitePoolOptions},
PgPool, SqlitePool,
};
use sqlx::{Connection, SqliteConnection};
use std::env;
use std::env::temp_dir;
use std::sync::Arc;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"slot":36,"transaction":["Aj7VFODkBo/ZYFntpV3cG4HBZ7Nts1r+jzhGgxSwf4oGo/9Bz3g1iysemkcadfvRoFV6o5rnBbE8p+IbdeqptgiehmEBQzUb8fTYC3Z81a7zO0mStBdysWdc23YulqYkMNXmDQ+KM0jyqDJEj/H7VoApq88Cru+/9oP0aIlVWoYLgAIBCQ3J2lX3bEKT6DH4ni9RzC212IxZeKmU5a+0OtHeQ+TsC1SyPHzBmlMXqcTLV9hmPia8rfSPGjEpzCYrNTA3d2HNRE19IEyAPbQBz0UseXaZEbO3cyKjf2bWAVevsV8xQUUtaxlkRkeJL9L43N8LzM1Z+DDTqAsZ255jL3/4jmvEbgMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAAg9v59t3EIQNyF3nrEuVHmCdXqdCPZSuA9TsWhrbndCEOoil+7YC3WRusixHESytzAqZEyN16rFzotzPEyuSWNlFsMrUASVvF3ddqRQVrkvwl/HuvPsio5m8G2UdsurhTDpNDIZ551u6iXE8btewjsfOdab9iDneAZd45Q3AiMOsLvA/Au0fKL3TEES6UqxPPo8Y05dwX6ssDzRojzX54fNf63JzpM0ZVRDlhl2PkrfF66r2bGEeRkFE9CDGYlEw/QWw9sDR16oXGr0OrDC+PvihVhYv4P+BnMd9AilwZoB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHRK0YbSWJAM3EV8iSKOUC/524/CgKoZHV2clZUQBVWWAgQABQJAQg8ABQ8AAQYHCAkKCwUFBQUMAgO4AqM0yOeMA0W6LAEAAAGG2eX58Lo95mZJPEd7F8tqCfsSgG5UMs+ivTtt7nD2Mia7sexJ8Co8CbvpLz8QuJL+uSjoZXVBIWqpocVATMbNBt2sGgba59IrMeJNo0q+JOLwpQWklc12+TPBerD8euEE1uym1XJEFs+s91eVSwQg+XEyrdJn0Bnq8DJJeqAhwwEAAAABAOB225fdx0rFL0t2v6iw6tjD52Ae6qptc6Yd2wMloVJ6AAEAAADoAwAAAAAAAAAAAAABAAAAAAIAAABUsjx8wZpTF6nEy1fYZj4mvK30jxoxKcwmKzUwN3dhzSwBAAAAAAAAAQAAAAAAAAAA4n6Ory5w6Yw2MMZqemoAjtIU05qGl6Q7PMV3wXOCZRu8AgAAAAAAAAEAAAAAAAAAAAIAAAAAAAAAAAA=","base64"],"meta":{"err":null,"status":{"Ok":null},"fee":10000,"preBalances":[995012370,1000000000,9496725270,1796849280,1,1141440,0,1141440,1169280,1141440,0,1141440,1],"postBalances":[995002041,1000000000,9496725569,1796849310,1,1141440,0,1141440,1169280,1141440,0,1141440,1],"innerInstructions":[{"index":1,"instructions":[{"programIdIndex":7,"accounts":[0,6,8,9,10,11,5,7,7,12,7,2,3],"data":"87ETSqTxDaFJCncDkrNqZc3h8HBkxsmat2BNeWLxxveA1bZVyKhvJtqKhyb6YUsNAA7vta1Y3EpHRZ46CY3hmngXJVPPocktaFLZrZ6Cqu16T3Z6haDmomvabf5rckm6EiG6koibZrsUVgEAVZNTfoKCVCqTWjna2ZVu5wnNNZAG2i7idKBM7uVhj6PXFL8HFNaPV1d4qebWzdHzEcjYyFo3cyCqW7iRpN4ebm8o5xBNsLKaB4agbD4qd7CYTkYdsMfRjUDiuiDUDCKNs1CqjJV1zeMeqopFbX7pKhcah9DaqS6ieCafcE3WGziaaNHmoYHjLFsNX1rL6Lb4CnkjFefDtM2oMALjGZpYmkaCLzWYmNAUiBAGkWGrBVZvE8P9wenGgu5gRf7CFN1KrtMPo258M1wrdxhZ3oTNX2NG8wD87ptFxNF9shhsCrsfo5wPcaVQE4vXqbHQNoj5wjz1HUYxgxpQPVsA5dsD2EdcXAR7gC546KUBGjXSRtKVAht8Ypggrm3LYVNN3HEGynkG79Py6uKoPMzN2666erPJo6GmBvHUEdxnfNXz7b3Lu7QuMqGeyiVxwPKsJQPZYQeVGPqhz7J5vHRsswEz2DgwzEMxmzpLSzFYk9nH3BxU7kKArtAFXR76k63kPKRrM97CtvyGhpgGu7Fetxh7HSnyX6FCcvjgoA8VBz3dkXqTM9WE3yWNVFhoJThF3nWvK6qDiFELgwEbuaM88NeTuJSAAXNfgkqL7Zg7cxXDbGJMvyFfuwfLoKnvgamiXaAviW28gkvjZHw9yAoWzM3m1Qc6ZgV3uSDaPcqXRWWxunmyrZoz4364BeHE5bd8pcg5zDJJVjugS9xQp6hw7GyJhpZ1FqwqPwbdD33YQHVZH4NkFG2Cp7odiY19bVBh1UgSbo1aUq2iDPPd5kK1DjEWkwjnzew3gM267e2TQKGPyLs5kxefS7VnPEo","stackHeight":2},{"programIdIndex":11,"accounts":[0,10,8,12,3,2],"data":"WiZw2hSp2LSxinAV6CN79aFir8vZ6EBHcDgXyBks5UJJvLsTNNb9xjibhXh6","stackHeight":3},{"programIdIndex":12,"accounts":[0,3],"data":"3Bxs45shRtnA2ds5","stackHeight":4},{"programIdIndex":11,"accounts":[0,10,8,9,12,2],"data":"7UWNMdwFJEWBQPSoUMJsYhDYzUC3zwGviGJNH1sDTGUe2rnkn5jxETwE5LmU8fEyksrtLb8hoBMCettPTyHyBA6P2jceKfCa4MDpdTy4EBT","stackHeight":3},{"programId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dgQU5qUMwaqmHqYyiPqnn5RgzFHcuH5qi2x8jkaToCAAtFiUdohLD3h9GNEdd4kV2MsKErDTvEuGzSQy6vnnU14nmicy5Zy1d6qFw8PFzsAPJEWYQtWEc1pXnyChBSShysKDsCAtr72d9eB5wE9QWzBzawFCDeuotQswgFgAkWFirQo9J5JYi3Za4W1DgAmBR61Aygz9jbuiUtrpkaDRBzKmmq1QT5LPh9DZhhB4uX8TUqKTDHNN1ZjMMcK6BKoiB7LpewiD1zt3f8mmTzLCAN8M4wWaezYcyhMsJTaXPPQwaHQwRVoZbmXrdGhGWnFTrUtPEfZmCuxBihdriBCTP8ttJidaQB7GgUMEDJ6gsRVTXiYSUMaiTaZ26a2RPqUtxg9iNnMwTnTdkDe1ddderrvq7h6gH91Ahd2Dm7SXgLNNi49buvRcBw1jMQCqZy7NxYLHVQri9vb5QbZDaHnPxzfJfdfhg59rtKks","stackHeight":4},{"programIdIndex":12,"accounts":[0,2],"data":"3Bxs483rNZ9HGTVh","stackHeight":4},{"programIdIndex":9,"accounts":[],"data":"DmF5USmKGAaPzaeFrom3WGyWtHrA6imyVdJamhXmdZLrGQmuitpkbsWYYqUEzw5T5UCrMzsF9seJhyjTirT7UGZKXoQapBLBfBqv8qAvZBEeJZ7SYjDcfUGQ2vbWJC4iHTyrBdGB7JEVEnm9yvoHpxL7ruvh7gyRJHcnT6HTVy8ccwG9hcJeS27KLSE7TySq2SeETquiyyef5SvV28zyJj4HYwDYJDfKwdcPTCr3tgMnBCcTGvQTMscmgvLcQgDjwJWh6Js36C4k5frjhyNrX7N98iWkGu222H6EKBSpjLCz35eZHNN3BEwy3GqCtaAJTixHDFsD91hSV7HJpLyJTyJ16RZi3eRHt3YSeQZgwc9ga3WUgZBwSANUweAMkeVtcLqbRgc9r5PaTGYYfcx8M1fSEUM97rxsk9iCZPjjxgSb2tfukgoSW7wUq6iFztJuteQUZbLpKRDTsAsEeXL5Ho6hFhPB13YZLEKPReNA8DwqJTQi7nABXCNR4SMRo3VG5nj3bbmuTmQZsjRbTRSEzSvd3ckF5ppzdo6YV73onXYUnNtfML6DkjY9FVchwe9RkCte9ws6Uhxx6dTrU2VgHZSHYpARzYkBhTwDHbpuQxTj4NqqdsuTvDb3uSfw8thN3Y56Vh8z3axic5TwXNzqrgSUW1H7dBbwKytsv1H76knawopFx7KskEwm2UnsPADEvvtV9Lb9N4yr4cpGUM4zzAqFcLw","stackHeight":3}]}],"logMessages":["Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program 9sixVEthz2kMSKfeApZXHwuboT6DZuT6crAYJTciUCqE invoke [1]","Program log: Instruction: Transfer","Program 6UqiSPd2mRCTTwkzhcs1M6DGYsqHWd5jiPueX3LwDMXQ invoke [2]","Program log: Instruction: InvokeCpi","Program 5QPEJ5zDsVou9FQS3KCauKswM3VwBEBu4dpL9xTqkWwN invoke [3]","Program log: Instruction: InsertIntoNullifierQueues","Program log: Inserting element 18206522509580455582933442800479004857308794290876182590860915761954180643917 into nullifier queue","Program 11111111111111111111111111111111 invoke [4]","Program 11111111111111111111111111111111 success","Program 5QPEJ5zDsVou9FQS3KCauKswM3VwBEBu4dpL9xTqkWwN consumed 18053 of 825238 compute units","Program 5QPEJ5zDsVou9FQS3KCauKswM3VwBEBu4dpL9xTqkWwN success","Program 5QPEJ5zDsVou9FQS3KCauKswM3VwBEBu4dpL9xTqkWwN invoke [3]","Program log: Instruction: AppendLeavesToMerkleTrees","Program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV invoke [4]","Program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV consumed 38 of 734334 compute units","Program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV success","Program 11111111111111111111111111111111 invoke [4]","Program 11111111111111111111111111111111 success","Program 5QPEJ5zDsVou9FQS3KCauKswM3VwBEBu4dpL9xTqkWwN consumed 66268 of 792809 compute units","Program 5QPEJ5zDsVou9FQS3KCauKswM3VwBEBu4dpL9xTqkWwN success","Program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV invoke [3]","Program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV consumed 38 of 723205 compute units","Program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV success","Program 6UqiSPd2mRCTTwkzhcs1M6DGYsqHWd5jiPueX3LwDMXQ consumed 238468 of 961005 compute units","Program 6UqiSPd2mRCTTwkzhcs1M6DGYsqHWd5jiPueX3LwDMXQ success","Program 9sixVEthz2kMSKfeApZXHwuboT6DZuT6crAYJTciUCqE consumed 278303 of 999850 compute units","Program 9sixVEthz2kMSKfeApZXHwuboT6DZuT6crAYJTciUCqE success"],"preTokenBalances":[],"postTokenBalances":[],"rewards":[],"loadedAddresses":{"writable":[],"readonly":[]},"computeUnitsConsumed":278453},"version":0,"blockTime":1715117976}
Loading

0 comments on commit a848874

Please sign in to comment.