Skip to content

Commit

Permalink
Merge branch 'BCFR-1071-Generic-MultiNodeClient' into BCFR-213-delete…
Browse files Browse the repository at this point in the history
…-subs-on-unsubscribe
  • Loading branch information
DylanTinianov authored Jan 6, 2025
2 parents d2acb74 + a804a3d commit 1ca3897
Show file tree
Hide file tree
Showing 88 changed files with 7,776 additions and 1,920 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ run:
linters:
enable:
- exhaustive
- exportloopref
- copyloopvar
- revive
- goimports
- gosec
Expand Down
1 change: 1 addition & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ packages:
config:
filename: simple_keystore.go
case: underscore
TxManager:
github.com/smartcontractkit/chainlink-solana/pkg/solana/logpoller:
interfaces:
RPCClient:
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ test_relay_unit:

test_smoke:
cd ./integration-tests &&\
SELECTED_NETWORKS=SIMULATED go test -timeout 24h -count=1 -json $(args) -run TestSolanaOCRV2Smoke ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color
SELECTED_NETWORKS=SIMULATED go test -timeout 1h -count=1 -json $(args) -run TestSolanaOCRV2Smoke ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color

test_relay_integration:
cd ./integration-tests &&\
Expand Down
6 changes: 3 additions & 3 deletions contracts/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 contracts/crates/arrayvec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "arrayvec"
version = "1.0.0"
version = "1.0.1"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
43 changes: 43 additions & 0 deletions contracts/crates/arrayvec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ macro_rules! arrayvec {
self.xs[offset..offset + len].copy_from_slice(&data);
self.len += len as $capacity_ty;
}

/// Removes the last element from the array and returns it.
/// Returns `None` if the array is empty.
pub fn pop(&mut self) -> Option<$ty> {
if self.len > 0 {
self.len -= 1;
Some(self.xs[self.len as usize])
} else {
None
}
}
}

impl std::ops::Deref for $name {
Expand Down Expand Up @@ -126,6 +137,38 @@ mod tests {
}
arrayvec!(ArrayVec, u8, u32);

#[test]
fn push_pop() {
let mut vec = ArrayVec::new();
assert!(vec.is_empty());
assert_eq!(vec.pop(), None);

vec.push(10);
assert_eq!(vec.len(), 1);
assert_eq!(vec.as_slice(), &[10]);

vec.push(20);
vec.push(30);
assert_eq!(vec.len(), 3);
assert_eq!(vec.as_slice(), &[10, 20, 30]);

// Popping elements
assert_eq!(vec.pop(), Some(30));
assert_eq!(vec.len(), 2);
assert_eq!(vec.as_slice(), &[10, 20]);

assert_eq!(vec.pop(), Some(20));
assert_eq!(vec.len(), 1);
assert_eq!(vec.as_slice(), &[10]);

assert_eq!(vec.pop(), Some(10));
assert_eq!(vec.len(), 0);
assert!(vec.is_empty());

// Popping from empty vec
assert_eq!(vec.pop(), None);
}

#[test]
fn remove() {
let mut vec = ArrayVec::new();
Expand Down
174 changes: 174 additions & 0 deletions contracts/generated/contract_reader_interface/InitializeLookupTable.go

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

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

Loading

0 comments on commit 1ca3897

Please sign in to comment.