Skip to content

Commit

Permalink
Create index to speed up querying account ID by public key (#95)
Browse files Browse the repository at this point in the history
* Create index to speed up querying account ID by public key

* Fix formatting

* Fix Rust version for CI

* Specify toolchain date on fmt

* Try stable toolchain with nightly fmt

* Add nightly toolchain manually

* All nightly

* Inspect versions

* Explicitly stable clippy

* Remove artifacts
  • Loading branch information
tifrel authored Feb 21, 2024
1 parent 44c037c commit dab5b87
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- name: shftmt setup
uses: mfinelli/setup-shfmt@v1

- name: shellcheck setup
uses: mfinelli/setup-shfmt@v1

- name: taplo setup
# TODO: use precompiled if available (https://github.com/tamasfe/taplo/issues/326)
# --debug to speed up the install
Expand All @@ -56,7 +53,7 @@ jobs:
- name: Linting
# TODO: shellcheck (https://github.com/marketplace/actions/shellcheck)
run: |
cargo clippy -- -D warnings
cargo +stable clippy -- -D warnings
- name: Diesel setup
# TODO: use precompiled once feasible (https://github.com/diesel-rs/diesel/issues/2379)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
drop index access_keys_pubkey_removed_at_idx;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create index access_keys_pubkey_removed_at_idx on access_keys (public_key, removed_at);
8 changes: 6 additions & 2 deletions src/rpc_payloads.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use serde::{Deserialize, Serialize};
use serde::{
Deserialize,
Serialize,
};

#[derive(Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(test, derive(PartialEq))]
Expand Down Expand Up @@ -91,7 +94,8 @@ impl RpcMessage {
mod tests {
use super::*;
use crate::rpc_payloads::RpcMessage::{
HandleContractPayload, HandleTokenPayload,
HandleContractPayload,
HandleTokenPayload,
};
const CONTRACT_PAYLOAD_STR: &str = r#"{"kind":"contract","payload":{"contract_id":"foo.near","refresh":null}}"#;
const TOKEN_PAYLOAD_STR: &str = r#"{"kind":"token","payload":{"contract_id":"foo.near","token_ids":["bar"],"refresh":null,"minter":"foo.near"}}"#;
Expand Down

0 comments on commit dab5b87

Please sign in to comment.