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.6.2204 #85

Merged
merged 52 commits into from
Jan 28, 2022
Merged

Version 1.6.2204 #85

merged 52 commits into from
Jan 28, 2022

Conversation

MrStahlfelge
Copy link
Member

  • ErgoPay implementation
  • Portuguese and Italian translation added
  • Payment request URI scheme changed to ergo:
  • Spanish translation improved
  • Appkit upgraded to 4.0.6
  • Small bug fixes and improvements

MrStahlfelge and others added 30 commits January 12, 2022 17:54
…w things … (#81)

* Fixed a sentence that didnt fit properly + translated the new things added

* Remove untranslatable, run convertIos

Co-authored-by: Benjamin Schulte <[email protected]>
* Android

* Fixed the word "única" + changed "tx" to "transação" since the abbreviation doesn't make sense in PT

* Portuguese activated for and converted to iOS

Co-authored-by: Benjamin Schulte <[email protected]>
…equest differs from signing addresses, received no reducedTx but message #79
MrStahlfelge and others added 19 commits January 21, 2022 16:33
Ergopay reference implementation
* Italian translation

* Fixed Italian translation for Android

* Converted Italian for iOS

Co-authored-by: Benjamin Schulte <[email protected]>
.map { Base64Coder.decode(it.asString) }
} else null
val inputs = jsonTree.get(JSON_FIELD_INPUTS)?.asJsonArray?.toList()
?.map { Base64Coder.decode(it.asString) }
Copy link
Member

Choose a reason for hiding this comment

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

Such code fragments are good candidates for encapsulation into extension methods.

Copy link
Member Author

Choose a reason for hiding this comment

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

What would you suggest to encapsulate here?
Unfortunately Gson is not very Kotlin-friendly anyway. Using kotlinx-serialization would make better code here. But we already have Gson pulled in, and pulling in a second JSON parser is something I want to avoid.

Copy link
Member

Choose a reason for hiding this comment

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

I keep something like this in mind
jsonTree.decodeBase64StringList(JSON_FIELD_INPUTS)

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it, although I am not sure as this is a very specific method


/**
* EIP-0020 ErgoPaySigningRequest
* everything is optional, but it should have either reducedTx or message
Copy link
Member

Choose a reason for hiding this comment

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

this requirement can be checked in the constructor.

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 had the wrong assumption that data classes can't hold any code, turned out it is possible to have such a check. Will add.

val message: String? = null,
val messageSeverity: MessageSeverity = MessageSeverity.NONE,
val replyToUrl: String? = null
)
Copy link
Member

Choose a reason for hiding this comment

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

Please add documentation to all classes, methods and properties in this file.

private const val PARAM_DELIMITER = "&"
private const val RECIPIENT_PARAM_PREFIX = "address="
private const val AMOUNT_PARAM_PREFIX = "amount="
private const val TOKEN_PARAM_PREFIX = "token-"
Copy link
Member

Choose a reason for hiding this comment

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

why - in the prefix?

Copy link
Member Author

Choose a reason for hiding this comment

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

Token prefix is token-<ErgoID>=, the - is the separator between the prefix and the actual id. (https://github.com/ergoplatform/eips/blob/master/eip-0025.md#format)

Copy link
Member

Choose a reason for hiding this comment

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

Please put this answer to the doc comment for TOKEN_PARAM_PREFIX

@MrStahlfelge MrStahlfelge merged commit c0fc2f0 into master Jan 28, 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.

5 participants