-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1068 from novasamatech/rc/6.7.3
Rc/6.7.3
- Loading branch information
Showing
80 changed files
with
1,268 additions
and
317 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,18 +10,19 @@ on: | |
gradlew-command: | ||
required: false | ||
type: string | ||
default: false | ||
default: "false" | ||
run-tests: | ||
required: false | ||
type: boolean | ||
default: true | ||
keystore-file-name: | ||
required: false | ||
type: string | ||
default: false | ||
default: "false" | ||
keystore-file-base64: | ||
required: false | ||
type: string | ||
default: "false" | ||
secrets: | ||
ACALA_PROD_AUTH_TOKEN: | ||
required: true | ||
|
@@ -94,6 +95,8 @@ env: | |
CI_GITHUB_KEYSTORE_PASS: ${{ secrets.CI_GITHUB_KEYSTORE_PASS }} | ||
CI_GITHUB_KEYSTORE_KEY_ALIAS: ${{ secrets.CI_GITHUB_KEYSTORE_KEY_ALIAS }} | ||
CI_GITHUB_KEYSTORE_KEY_PASS: ${{ secrets.CI_GITHUB_KEYSTORE_KEY_PASS }} | ||
CI_GITHUB_KEYSTORE_KEY_FILE: ${{ secrets.BASE64_GITHUB_KEYSTORE_FILE }} | ||
|
||
|
||
jobs: | ||
build-app: | ||
|
@@ -113,14 +116,21 @@ jobs: | |
if: ${{ inputs.run-tests }} == "true" | ||
run: ./gradlew runTest | ||
|
||
- name: 🔐 Getting sign key | ||
if: ${{ !startsWith(inputs.keystore-file-name, 'false') }} | ||
id: write_file | ||
- name: 🔐 Getting github sign key | ||
if: ${{ startsWith(inputs.keystore-file-name, 'github_key.jks') }} | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: ${{ inputs.keystore-file-name }} | ||
fileDir: './app/' | ||
encodedString: ${{ env.CI_GITHUB_KEYSTORE_KEY_FILE }} | ||
|
||
- name: 🔐 Getting market sign key | ||
if: ${{ startsWith(inputs.keystore-file-name, 'market_key.jks') }} | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: ${{ inputs.keystore-file-name }} | ||
fileDir: './app/' | ||
encodedString: ${{ inputs.keystore-file-base64 }} | ||
encodedString: ${{ env.CI_MARKET_KEY_FILE }} | ||
|
||
- name: 🏗 Build app | ||
if: ${{ !startsWith(inputs.gradlew-command, 'false') }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Publish GitHub release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
uses: novasamatech/nova-wallet-android/.github/workflows/android_build.yml@develop | ||
with: | ||
branch: master | ||
gradlew-command: assembleReleaseGithub | ||
keystore-file-name: github_key.jks | ||
secrets: inherit | ||
|
||
create-release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Download built artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: apk | ||
path: app | ||
|
||
- name: Rename artifacts | ||
run: mv app/releaseGithub/app-releaseGithub.apk app/releaseGithub/nova-wallet-android-${{ github.ref_name }}-github.apk | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Release ${{ github.ref_name }} | ||
tag_name: ${{ github.ref_name }} | ||
generate_release_notes: true | ||
draft: true | ||
files: app/releaseGithub/nova-wallet-android-${{ github.ref_name }}-github.apk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Bump app version | ||
|
||
on: | ||
push: | ||
branches: | ||
['master'] | ||
|
||
jobs: | ||
update-tag: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Version in build.gradle | ||
run: | | ||
versionName=$(grep "versionName" build.gradle | grep -o "'.*'") | ||
versionName=${versionName//\'/} | ||
echo Version in gradle file: $versionName | ||
echo "GRADLE_APP_VERSION=$versionName" >> "$GITHUB_ENV" | ||
- name: Was version changed? | ||
id: version | ||
run: | | ||
if [[ ${{ env.GRADLE_APP_VERSION }} == ${{ secrets.ANDROID_APP_VERSION }} ]]; then | ||
echo "changed=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
fi | ||
- uses: rickstaa/action-create-tag@v1 | ||
if: steps.version.outputs.changed == 'true' | ||
with: | ||
tag: 'v${{ env.GRADLE_APP_VERSION }}' | ||
message: Release v${{ env.GRADLE_APP_VERSION }} | ||
|
||
- name: Write app version to secrets | ||
if: steps.version.outputs.changed == 'true' | ||
uses: hmanzur/[email protected] | ||
with: | ||
name: 'ANDROID_APP_VERSION' | ||
value: ${{ env.GRADLE_APP_VERSION }} | ||
repository: novasamatech/nova-wallet-android | ||
token: ${{ secrets.WRITE_SECRET_PAT }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
Nova - Polkadot, Kusama wallet | ||
|
||
Copyright 2022 Novasama Technologies PTE. LTD. | ||
Copyright 2022-2023 Novasama Technologies PTE. LTD. | ||
This product includes software developed at Novasama Technologies PTE. LTD. | ||
|
||
Some parts of this product are derived from https://github.com/soramitsu/fearless-Android, which belongs to Soramitsu K.K. and was mostly developed by our team of developers from May 1, 2020, to October 5, 2021. | ||
Copyright 2021, Soramitsu Helvetia AG, all rights reserved. | ||
|
||
License Rights transferred from Novasama Technologies PTE. LTD to Novasama Technologies GmbH starting from 1st of April 2023 |
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
52 changes: 52 additions & 0 deletions
52
app/src/androidTest/java/io/novafoundation/nova/GasPriceProviderIntegrationTest.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package io.novafoundation.nova | ||
|
||
import android.util.Log | ||
import io.novafoundation.nova.common.utils.average | ||
import io.novafoundation.nova.common.utils.divideToDecimal | ||
import io.novafoundation.nova.runtime.ethereum.gas.LegacyGasPriceProvider | ||
import io.novafoundation.nova.runtime.ethereum.gas.MaxPriorityFeeGasProvider | ||
import io.novafoundation.nova.runtime.ext.Ids | ||
import io.novafoundation.nova.runtime.multiNetwork.awaitCallEthereumApiOrThrow | ||
import io.novafoundation.nova.runtime.multiNetwork.chain.model.Chain | ||
import kotlinx.coroutines.flow.collect | ||
import kotlinx.coroutines.flow.map | ||
import kotlinx.coroutines.flow.take | ||
import org.junit.Test | ||
import java.math.BigInteger | ||
|
||
class GasPriceProviderIntegrationTest : BaseIntegrationTest() { | ||
|
||
@Test | ||
fun compareLegacyAndImprovedGasPriceEstimations() = runTest { | ||
val api = chainRegistry.awaitCallEthereumApiOrThrow(Chain.Ids.MOONBEAM) | ||
|
||
val legacy = LegacyGasPriceProvider(api) | ||
val improved = MaxPriorityFeeGasProvider(api) | ||
|
||
val legacyStats = mutableSetOf<BigInteger>() | ||
val improvedStats = mutableSetOf<BigInteger>() | ||
|
||
api.newHeadsFlow().map { | ||
legacyStats.add(legacy.getGasPrice()) | ||
improvedStats.add(improved.getGasPrice()) | ||
} | ||
.take(1000) | ||
.collect() | ||
|
||
legacyStats.printStats("Legacy") | ||
improvedStats.printStats("Improved") | ||
} | ||
|
||
private fun Set<BigInteger>.printStats(name: String) { | ||
val min = min() | ||
val max = max() | ||
|
||
Log.d("GasPriceProviderIntegrationTest", """ | ||
Stats for $name source | ||
Min: $min | ||
Max: $max | ||
Avg: ${average()} | ||
Max/Min ratio: ${max.divideToDecimal(min)} | ||
""") | ||
} | ||
} |
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
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
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
18 changes: 18 additions & 0 deletions
18
common/src/main/java/io/novafoundation/nova/common/utils/SemiUnboundedRange.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.novafoundation.nova.common.utils | ||
|
||
interface SemiUnboundedRange<T : Comparable<T>> { | ||
|
||
val start: T | ||
|
||
val endInclusive: T? | ||
} | ||
|
||
infix operator fun <T : Comparable<T>> T.rangeTo(another: T?): SemiUnboundedRange<T> { | ||
return ComparableSemiUnboundedRange(this, another) | ||
} | ||
|
||
inline fun <T : Comparable<T>, R : Comparable<R>> SemiUnboundedRange<T>.map(mapper: (T) -> R): SemiUnboundedRange<R> { | ||
return mapper(start)..endInclusive?.let(mapper) | ||
} | ||
|
||
class ComparableSemiUnboundedRange<T : Comparable<T>>(override val start: T, override val endInclusive: T?) : SemiUnboundedRange<T> |
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
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
Oops, something went wrong.