This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run: | |
timeout: 5m | |
linters: | |
disable-all: true | |
enable: | |
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases | |
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string | |
- ineffassign # detects when assignments to existing variables are not used | |
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use core::panic; | |
trait Animal { | |
fn name(&self) -> &'static str; | |
fn talk(&self) { | |
println!("{} cannot talk", self.name()); | |
} | |
} | |
struct Dog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::{HashSet, VecDeque}; | |
#[derive(Debug, Clone, Hash, Eq, PartialEq)] | |
struct State { | |
containers: Vec<i64>, | |
} | |
#[derive(Debug, Clone, Eq, PartialEq)] | |
enum Operation { | |
Fill(usize), // Fill container i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::Result; | |
enum Numbers { | |
One, | |
Two, | |
Three, | |
} | |
enum Names { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait DataAccessLayr { | |
fn init() -> Self; | |
fn write(&self, status: &eigenlayer::OperatorAVSRegistrationStatus) -> eyre::Result<()>; | |
fn read(&self, status: &mut eigenlayer::OperatorAVSRegistrationStatus) -> eyre::Result<()>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use eyre::Result; | |
use tracing::debug; | |
use serde::{Serialize, Deserialize}; | |
use alloy::{ | |
primitives::{Address, U256, B256}, | |
sol, | |
}; | |
use IRewardsCoordinator::RewardsClaimed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub async fn run_server(host: String, port: u16) -> eyre::Result<SocketAddr> { | |
// Add a CORS middleware for handling HTTP requests. | |
// This middleware does affect the response, including appropriate | |
// headers to satisfy CORS. Because any origins are allowed, the | |
// "Access-Control-Allow-Origin: *" header is appended to the response. | |
let cors = CorsLayer::new() | |
// Allow `POST` when accessing the resource | |
.allow_methods([Method::POST]) | |
// Allow requests from any origin | |
.allow_origin(Any) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use serde::Deserialize; | |
#[derive(Debug, Clone, Deserialize)] | |
pub struct Config { | |
#[serde(rename = "serverHost", default = "default_host")] | |
pub server_host: String, | |
#[serde(rename = "serverPort", default = "default_port")] | |
pub server_port: u16, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stable-slim | |
RUN export DEBIAN_FRONTEND=noninteractive && \ | |
apt update && \ | |
apt install -y -q --no-install-recommends \ | |
ca-certificates apt-transport-https \ | |
curl sudo \ | |
python3-pip python3-venv python3 \ | |
default-jre && \ | |
apt clean && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:24.04 | |
ARG HTTP_PORT=8545 | |
ARG ETH_VERSION=1.14.7 | |
RUN apt-get update \ | |
&& apt-get install -y software-properties-common \ | |
&& add-apt-repository -y ppa:ethereum/ethereum \ | |
&& apt-get update \ | |
&& apt-get install -y ethereum sudo \ |
NewerOlder