Skip to content

Commit

Permalink
feat: added staking denom
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrobot committed Oct 2, 2024
1 parent 2d58148 commit ed94278
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 6 additions & 0 deletions packages/injective-testing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.1] - 2024-10-02

### Added

- Added a staking denom to the mocks

## [1.1.0] - 2024-08-23

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/injective-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
license = "Apache-2.0"
name = "injective-testing"
repository = "https://github.com/InjectiveLabs/cw-injective/tree/dev/packages/injective-testing"
version = "1.1.0"
version = "1.1.1"

[dependencies]
anyhow = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions packages/injective-testing/src/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ pub const MOCKED_FEE_RECIPIENT: &str = "0x01edfab47f124748dc89998eb33144af734484

pub const MOCK_EXCHANGE_DECIMALS: i32 = 18i32;
pub const MOCK_BASE_DECIMALS: i32 = 18i32;
pub const MOCK_STAKE_DECIMALS: i32 = 18i32;
pub const MOCK_ATOM_DECIMALS: i32 = 8i32;
pub const MOCK_QUOTE_DECIMALS: i32 = 6i32;

pub const MOCK_ATOM_DENOM: &str = "atom";
pub const MOCK_BASE_DENOM: &str = "inj";
pub const MOCK_STAKE_DENOM: &str = "hinj";
pub const MOCK_QUOTE_DENOM: &str = "usdt";
pub const MOCK_USDC_DENOM: &str = "usdc";

Expand Down
7 changes: 6 additions & 1 deletion packages/injective-testing/src/test_tube/exchange.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::{
mocks::{MOCK_ATOM_DECIMALS, MOCK_ATOM_DENOM, MOCK_BASE_DECIMALS, MOCK_BASE_DENOM, MOCK_QUOTE_DECIMALS, MOCK_QUOTE_DENOM, MOCK_USDC_DENOM},
mocks::{
MOCK_ATOM_DECIMALS, MOCK_ATOM_DENOM, MOCK_BASE_DECIMALS, MOCK_BASE_DENOM, MOCK_QUOTE_DECIMALS, MOCK_QUOTE_DENOM, MOCK_STAKE_DECIMALS,
MOCK_STAKE_DENOM, MOCK_USDC_DENOM,
},
utils::{dec_to_proto, scale_price_quantity_perp_market, scale_price_quantity_spot_market, str_coin},
};

Expand Down Expand Up @@ -551,6 +554,7 @@ pub fn execute_spot_limit_order(app: &InjectiveTestApp, market_id: String, price
.init_account(&[
str_coin("1000000", MOCK_ATOM_DENOM, MOCK_ATOM_DECIMALS),
str_coin("1000000", MOCK_BASE_DENOM, MOCK_BASE_DECIMALS),
str_coin("1000000", MOCK_STAKE_DENOM, MOCK_STAKE_DECIMALS),
str_coin("1000000", MOCK_QUOTE_DENOM, MOCK_QUOTE_DECIMALS),
str_coin("1000000", MOCK_USDC_DENOM, MOCK_QUOTE_DECIMALS),
])
Expand Down Expand Up @@ -634,6 +638,7 @@ pub fn execute_derivative_limit_order(
.init_account(&[
str_coin("1000000", MOCK_ATOM_DENOM, MOCK_ATOM_DECIMALS),
str_coin("1000000", MOCK_BASE_DENOM, MOCK_BASE_DECIMALS),
str_coin("1000000", MOCK_STAKE_DENOM, MOCK_STAKE_DECIMALS),
str_coin("1000000", MOCK_QUOTE_DENOM, MOCK_QUOTE_DECIMALS),
])
.unwrap();
Expand Down

0 comments on commit ed94278

Please sign in to comment.