Skip to content

Commit

Permalink
Support change to ERC-681
Browse files Browse the repository at this point in the history
I disagree with this change though - so only make it so we *can* parse it - but not really exposing it. I really hope this change gets taken back.
Context: ethereum/EIPs#681 (comment)
  • Loading branch information
ligi committed May 13, 2019
1 parent e429716 commit f86d420
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun CommonEthereumURIData.toERC681() = let { commonURI ->
val queryAsMap = commonURI.query.toMap() // should be improved https://github.com/walleth/kethereum/issues/25

gas = queryAsMap["gas"].toBigInteger()
value = queryAsMap["value"].toBigInteger()
value = queryAsMap["value"]?.split("-")?.first()?.toBigInteger()

functionParams = commonURI.query.filter { it.first != "gas" && it.first != "value" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,9 @@ class TheERC681Parsing {
fun weDoNotStumbleUponIllegal681() {
Assertions.assertThat(parseERC681("ethereum:pay-0x00AB42@23?value=42.42").valid).isEqualTo(false)
}

@Test
fun testSupportsValueSuffix() {
Assertions.assertThat(parseERC681("ethereum:pay-0x00AB42@23?value=42-ETH").valid).isEqualTo(true)
}
}

0 comments on commit f86d420

Please sign in to comment.