Skip to content

packages.valory.skills.abstract_round_abci.models

This module contains the shared state for the price estimation ABCI application.

BaseParams Objects

class BaseParams(Model)

Parameters.

__init__

def __init__(*args: Any, **kwargs: Any) -> None

Initialize the parameters object.

The genesis configuration should be a dictionary with the following format: genesis_time: str chain_id: str consensus_params: block: max_bytes: str max_gas: str time_iota_ms: str evidence: max_age_num_blocks: str max_age_duration: str max_bytes: str validator: pub_key_types: List[str] version: dict voting_power: str

Arguments:

  • args: positional arguments
  • kwargs: keyword arguments

SharedState Objects

class SharedState(Model)

Keep the current shared state of the skill.

__init__

def __init__(*args: Any, *, abci_app_cls: Type[AbciApp], skill_context: SkillContext, **kwargs: Any, ,) -> None

Initialize the state.

setup

def setup() -> None

Set up the model.

round_sequence

@property
def round_sequence() -> RoundSequence

Get the round_sequence.

synchronized_data

@property
def synchronized_data() -> BaseSynchronizedData

Get the latest synchronized_data if available.

Requests Objects

class Requests(Model)

Keep the current pending requests.

__init__

def __init__(*args: Any, **kwargs: Any) -> None

Initialize the state.

ApiSpecs Objects

class ApiSpecs(Model)

A model that wraps APIs to get cryptocurrency prices.

__init__

def __init__(*args: Any, **kwargs: Any) -> None

Initialize ApiSpecsModel.

ensure

def ensure(keyword: str, kwargs: Dict) -> Any

Ensure a keyword argument.

get_spec

def get_spec() -> Dict

Returns dictionary containing api specifications.

process_response

def process_response(response: HttpMessage) -> Any

Process response from api.

increment_retries

def increment_retries() -> None

Increment the retries counter.

reset_retries

def reset_retries() -> None

Reset the retries counter.

is_retries_exceeded

def is_retries_exceeded() -> bool

Check if the retries amount has been exceeded.

BenchmarkBlockTypes Objects

class BenchmarkBlockTypes()

Benchmark block types.

BenchmarkBlock Objects

class BenchmarkBlock()

Benchmark

This class represents logic to measure the code block using a context manager.

__init__

def __init__(block_type: str) -> None

Benchmark for single round.

__enter__

def __enter__() -> None

Enter context.

__exit__

def __exit__(*args: List, **kwargs: Dict) -> None

Exit context

BenchmarkBehaviour Objects

class BenchmarkBehaviour()

BenchmarkBehaviour

This class represents logic to benchmark a single behaviour.

__init__

def __init__() -> None

Initialize Benchmark behaviour object.

local

def local() -> BenchmarkBlock

Measure local block.

consensus

def consensus() -> BenchmarkBlock

Measure consensus block.

BenchmarkTool Objects

class BenchmarkTool(Model)

BenchmarkTool

Tool to benchmark ABCI apps.

__init__

def __init__(*args: Any, **kwargs: Any) -> None

Benchmark tool for rounds behaviours.

measure

def measure(behaviour: str) -> BenchmarkBehaviour

Measure time to complete round.

data

@property
def data() -> List

Returns formatted data.

save

def save(period: int = 0, reset: bool = True) -> None

Save logs to a file.

reset

def reset() -> None

Reset benchmark data

Back to top