Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.7.2206 #97

Merged
merged 53 commits into from
Mar 8, 2022
Merged

Version 1.7.2206 #97

merged 53 commits into from
Mar 8, 2022

Conversation

MrStahlfelge
Copy link
Member

MrStahlfelge and others added 30 commits February 15, 2022 11:43
Support read-only wallets with extended public key and exporting extended public key
…n when minted on ErgoPay and ColdWallet Signing Screens
MrStahlfelge and others added 22 commits February 28, 2022 20:17
* Create strings.xml

Turkish translations of the application were made.

* Changes based on comments from @root7z and @furkan-gnu

* Activated tr for iOS

Co-authored-by: Benjamin Schulte <[email protected]>
private val MIGRATION_5_6 = object : Migration(5, 6) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("CREATE TABLE IF NOT EXISTS `token_price` (`tokenId` TEXT NOT NULL, `display_name` TEXT, `source` TEXT NOT NULL, `erg_value` TEXT NOT NULL, PRIMARY KEY(`tokenId`))")
database.execSQL("CREATE TABLE IF NOT EXISTS `token_info` (`tokenId` TEXT NOT NULL, `issuing_box` TEXT NOT NULL, `minting_tx` TEXT NOT NULL, `display_name` TEXT NOT NULL, `description` TEXT NOT NULL, `decimals` INTEGER NOT NULL, `full_supply` INTEGER NOT NULL, `reg7` TEXT, `reg8` TEXT, `reg9` TEXT, `genuine_flag` INTEGER NOT NULL, `issuer_link` TEXT, `thumbnail_bytes` BLOB, `thunbnail_type` INTEGER NOT NULL, `updated_ms` INTEGER NOT NULL, PRIMARY KEY(`tokenId`))")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make this SQL statements multi-line strings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is, but the statements are a 1:1 copy of the generated code from Room and I'd rather leave it this way. I'll make the explaining comment more eye-catching

@PrimaryKey val tokenId: String,
@ColumnInfo(name = "display_name") val displayName: String?,
@ColumnInfo(name = "source") val priceSource: String,
@ColumnInfo(name = "erg_value") val ergValue: String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why not Long type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token erg value can be fractional even compared to nanoergs, and actually is for most tokens. I have experimented with long value/decimals but had problems in deciding how many decimals should actually be used. Since JS developers settled to handle all of these types of values as strings and these are usually our sources, I decided to follow this practice for this application.

@PrimaryKey val tokenId: String,
@ColumnInfo(name = "display_name") val displayName: String?,
@ColumnInfo(name = "source") val priceSource: String,
@ColumnInfo(name = "erg_value") val ergValue: String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why not a numeric type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doublicate of former comment?


}

override fun showNftHashValidation(hashValid: Boolean?) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the hashValid is nullable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there was no comparison between the stored hash and the content hash made (yet), for example when there is no stored hash or content not yet downloaded

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a comment

null
}

fun getSerializedXpubKeyFromMnemonic(mnemonic: String) =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use SecretString in all new code. And do the necessary refactoring along the way to finally use SecretString for mnemonic everywhere (where possible).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - already done in PR #94 :-)
Unfortunately this has to wait for the upstream libraries to get merged.

@MrStahlfelge MrStahlfelge merged commit 5b76c5f into master Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants