Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3502968
XC-288: Add getAccountInfo RPC method
lpahlavi Mar 27, 2025
6b0f223
XC-288: Fix errors
lpahlavi Mar 27, 2025
31969f5
XC-288: Add integration tests and fix response transform
lpahlavi Mar 28, 2025
3457958
XC-288: Remove unused dependencies
lpahlavi Mar 28, 2025
20e588f
XC-288: Fix docs
lpahlavi Mar 28, 2025
d995e97
XC-288: clippy
lpahlavi Mar 28, 2025
b70c22c
XC-288: clippy
lpahlavi Mar 28, 2025
b192a88
XC-288: streamline canonicalization
lpahlavi Mar 28, 2025
8a187e2
XC-288: Rename method and add TODO for tests
lpahlavi Mar 28, 2025
f753c11
XC-288: Allow option to compile canister without zstd dependency
lpahlavi Apr 1, 2025
d55b11f
Merge branch 'main' into lpahlavi/XC-288-get-account-info
lpahlavi Apr 1, 2025
1d551f4
XC-288: Address review feedback
lpahlavi Apr 2, 2025
4aa5eab
XC-288: Fix Candid interface
lpahlavi Apr 4, 2025
0dacc7e
XC-288: Fix doctest
lpahlavi Apr 4, 2025
a6fd508
XC-288: Fix doctest
lpahlavi Apr 4, 2025
2727888
XC-288: Fix trailing space
lpahlavi Apr 4, 2025
966503c
XC-288: Clippy
lpahlavi Apr 4, 2025
d033510
XC-288: Fix end-to-end test Candid encoding
lpahlavi Apr 4, 2025
e80c92d
XC-288: Fix end-to-end test Candid encoding
lpahlavi Apr 4, 2025
5445214
XC-288: Fix end-to-end test Candid encoding
lpahlavi Apr 4, 2025
7878a0e
Merge branch 'main' into lpahlavi/XC-288-get-account-info
lpahlavi Apr 4, 2025
d8fd0cd
XC-288: Fix end-to-end test Candid encoding
lpahlavi Apr 4, 2025
c2a8099
XC-288: Fix end-to-end test Candid encoding
lpahlavi Apr 4, 2025
eac50af
XC-288: Wrap getAccountInfo arguments into single type
lpahlavi Apr 4, 2025
8b8fdd6
XC-288: Streamline conversion
lpahlavi Apr 4, 2025
57283c6
XC-288: Clippy
lpahlavi Apr 4, 2025
175c276
XC-288: Clippy
lpahlavi Apr 4, 2025
bc64d28
XC-288: Candid
lpahlavi Apr 4, 2025
b881a8c
XC-288: Address review feedback
lpahlavi Apr 7, 2025
accc0b4
XC-288: Clippy
lpahlavi Apr 7, 2025
51b5bca
XC-288: Address review feedback
lpahlavi Apr 8, 2025
fff929d
Merge branch 'main' into lpahlavi/XC-288-get-account-info
lpahlavi Apr 8, 2025
b8f1967
XC-288: Fix patch
lpahlavi Apr 8, 2025
56ea371
XC-288: Fix patch
lpahlavi Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 44 additions & 30 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ ic-canister-log = "0.2.0"
ic-cdk = "0.17.1"
ic-ed25519 = "0.1.0"
ic-metrics-encoder = "1.1"
ic-sha3 = "1.0.0"
ic-stable-structures = "0.6.7"
ic-test-utilities-load-wasm = { git = "https://github.com/dfinity/ic", tag = "release-2025-01-23_03-04-base" }
maplit = "1.0.2"
Expand All @@ -58,6 +57,8 @@ regex = "1.11.1"
serde = { version = "1.0.219", features = ["derive"] }
serde_bytes = "0.11.17"
serde_json = "1.0.140"
solana-account = "2.2.0"
solana-account-decoder-client-types = "2.2.0"
solana-clock = "2.2.0"
solana-client = "2.2.0"
solana-hash = "2.2.0"
Expand All @@ -66,13 +67,13 @@ solana-message = "2.2.0"
solana-nonce = "2.2.0"
solana-program = "2.2.0"
solana-pubkey = "2.2.0"
solana-rpc-client-api = "2.2.0"
solana-signature = "2.2.0"
solana-transaction = { version = "2.2.0", features = ["bincode"] }
solana-transaction = "2.2.0"
strum = { version = "0.27.0", features = ["derive"] }
thiserror = "2.0.12"
tokio = "1.44.1"
tower = "0.5.2"
tower-layer = "0.3.3"
tower-http = "0.6.2"
url = "2.5"
zeroize = { version = "1.8", features = ["zeroize_derive"] }
Expand All @@ -82,6 +83,8 @@ zeroize = { version = "1.8", features = ["zeroize_derive"] }
# are using forked version of the relevant repositories.
# see [solana-sdk#117](https://github.com/anza-xyz/solana-sdk/issues/117)
[patch.crates-io]
solana-account = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-account-decoder-client-types = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-client = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-clock = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-hash = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
Expand All @@ -91,5 +94,6 @@ solana-message = { git = "https://github.com/dfinity/agave", tag = "323039e-js-f
solana-nonce = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-program = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-pubkey = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-rpc-client-api = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-signature = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
solana-transaction = { git = "https://github.com/dfinity/agave", tag = "323039e-js-feature-flag" }
11 changes: 10 additions & 1 deletion canister/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ canlog = { path = "../canlog", features = ["derive"] }
ciborium = { workspace = true }
const_format = { workspace = true }
derive_more = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
http = { workspace = true }
ic-cdk = { workspace = true }
Expand All @@ -35,6 +34,9 @@ regex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_bytes = { workspace = true }
solana-account = { workspace = true, features = ["serde"] }
solana-account-decoder-client-types = { workspace = true }
solana-pubkey = { workspace = true }
tower = { workspace = true }
tower-http = { workspace = true, features = ["set-header", "util"] }
url = { workspace = true }
Expand All @@ -44,3 +46,10 @@ thiserror = { workspace = true }
[dev-dependencies]
candid_parser = { workspace = true }
proptest = { workspace = true }

[features]
# WARNING: Disabling this feature will lead to some functionality not working anymore
# such as decoding of Solana account data in base64+zstd format which in turn might
# lead to some runtime errors.
zstd = ["solana-account-decoder-client-types/zstd"]
default = ["zstd"]
Comment thread
lpahlavi marked this conversation as resolved.
21 changes: 21 additions & 0 deletions canister/scripts/examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,24 @@ GET_SLOT_PARAMS="(
opt record { minContextSlot = null; commitment = opt variant { finalized } },
)"
dfx canister call sol_rpc getSlot "$GET_SLOT_PARAMS" $FLAGS --with-cycles "$CYCLES" || exit 1

# Get the System Program account info on Mainnet with a 2-out-of-3 strategy
# TODO XC-321: get cycle cost by query method
CYCLES="2B"
GET_ACCOUNT_INFO_PARAMS="(
variant { Default = variant { Mainnet } },
opt record {
responseConsensus = opt variant {
Threshold = record { min = 2 : nat8; total = opt (3 : nat8) }
};
responseSizeEstimate = null;
},
record {
pubkey = \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\";
commitment = null;
encoding = opt variant{ base64 };
dataSlice = null;
minContextSlot = null;
},
)"
dfx canister call sol_rpc getAccountInfo "$GET_ACCOUNT_INFO_PARAMS" $FLAGS --with-cycles "$CYCLES" || exit 1
Loading