Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
* Adjusted toolchain
Browse files Browse the repository at this point in the history
* Adjusted worklfow
  • Loading branch information
DidacSF committed Feb 15, 2024
1 parent c5e2b3f commit 4fd1d0d
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 121 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ jobs:
matrix:
runtime: [bajun]
env:
SUBWASM_VERSION: v0.19.1
SUBWASM_VERSION: v0.20.0
steps:
- uses: actions/checkout@v3
- id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.9.2
with:
image: paritytech/srtool
chain: ${{ matrix.runtime }}
tag: 1.74.0
tag: 1.74.0-0.13.0
- name: Install subwasm {{ env.SUBWASM_VERSION }}
run: |
wget https://github.com/chevdor/subwasm/releases/download/${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_${{ env.SUBWASM_VERSION }}.deb -O subwasm.deb
Expand Down
28 changes: 14 additions & 14 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Builder
FROM docker.io/library/rust:1.59-bullseye as builder
FROM docker.io/library/rust:1.74-bullseye as builder

ARG features
ARG bin

COPY . /ajuna
WORKDIR /ajuna

RUN rustup component add rust-src

RUN apt update && apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler
RUN cargo build --locked --release --no-default-features --features ${features} --bin ${bin}

# Runner
FROM docker.io/library/ubuntu:20.04
FROM docker.io/library/ubuntu:22.04

ARG bin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ impl<T: Config> AvatarCombinator<T> {
hash_provider: &mut HashProvider<T, 32>,
block_number: T::BlockNumber,
) -> Result<(LeaderForgeOutput<T>, Vec<ForgeOutput<T>>), DispatchError> {
if input_sacrifices.len() != 1 ||
input_leader.1.get_rarity() == RarityTier::Mythical ||
input_sacrifices.iter().any(|(_, sac)| sac.get_rarity() == RarityTier::Mythical)
if input_sacrifices.len() != 1
|| input_leader.1.get_rarity() == RarityTier::Mythical
|| input_sacrifices.iter().any(|(_, sac)| sac.get_rarity() == RarityTier::Mythical)
{
return Ok((
LeaderForgeOutput::Forged((input_leader.0, input_leader.1.unwrap()), 0),
input_sacrifices
.into_iter()
.map(|(id, sacrifice)| ForgeOutput::Forged((id, sacrifice.unwrap()), 0))
.collect(),
))
));
}

let (leader_id, mut leader) = input_leader;
Expand All @@ -29,8 +29,8 @@ impl<T: Config> AvatarCombinator<T> {

let filled_slots_leader = leader.spec_byte_split_ten_count();
let filled_slots_partner = partner.spec_byte_split_ten_count();
let partner_pet_type_match = partner.get_class_type_2::<PetType>() ==
PetType::from_byte(
let partner_pet_type_match = partner.get_class_type_2::<PetType>()
== PetType::from_byte(
(DnaUtils::current_period::<T>(
PET_MOON_PHASE_SIZE,
PET_MOON_PHASE_AMOUNT,
Expand All @@ -50,8 +50,8 @@ impl<T: Config> AvatarCombinator<T> {
let leader_pet_variation = leader.get_custom_type_2::<u8>();
let partner_pet_variation = partner.get_custom_type_2::<u8>();

let legendary_egg_flag = ((hash_provider.hash[0] | hash_provider.hash[1]) == 0x7F) &&
((leader_pet_variation + partner_pet_variation) % 42) == 0;
let legendary_egg_flag = ((hash_provider.hash[0] | hash_provider.hash[1]) == 0x7F)
&& ((leader_pet_variation + partner_pet_variation) % 42) == 0;

let random_pet_variation = hash_provider.hash[0] & hash_provider.hash[1] & 0b0111_1111;

Expand Down Expand Up @@ -96,10 +96,10 @@ impl<T: Config> AvatarCombinator<T> {
.then(|| {
let dna = MinterV2::<T>::generate_empty_dna::<32>()?;

let output_avatar = if filled_slots_leader < MAX_EQUIPPED_SLOTS ||
filled_slots_partner < MAX_EQUIPPED_SLOTS ||
progress_match.is_none() ||
!partner_pet_type_match
let output_avatar = if filled_slots_leader < MAX_EQUIPPED_SLOTS
|| filled_slots_partner < MAX_EQUIPPED_SLOTS
|| progress_match.is_none()
|| !partner_pet_type_match
{
AvatarBuilder::with_dna(season_id, dna).into_dust(soul_points).build()
} else {
Expand All @@ -118,7 +118,7 @@ impl<T: Config> AvatarCombinator<T> {
})
.transpose()?;

Ok((leader_output, other_output.into_iter().chain(additional_output.into_iter()).collect()))
Ok((leader_output, other_output.into_iter().chain(additional_output).collect()))
}
}

Expand Down
Loading

0 comments on commit 4fd1d0d

Please sign in to comment.