-
Notifications
You must be signed in to change notification settings - Fork 11
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
Task/psgs 55 cardano api units #17
Merged
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b086bdf
WIP
maciejbak85 7b2e135
network info units
maciejbak85 d91dded
-> estimate fee
maciejbak85 fdf90e0
get transactions
maciejbak85 8bad121
coin-selections/random
maciejbak85 d9701e8
api units done
maciejbak85 61195a9
use dummy model
maciejbak85 58de0da
Use model from json files
maciejbak85 a7c4beb
Move common code
maciejbak85 0f0aa12
Merge branch 'develop' into task/psgs-55-cardano-api-units
maciejbak85 0e11d7e
Needed to run unit tests locally.
mcsherrylabs 74c2180
Example of Unit test using json file and exercising mapper.
mcsherrylabs aee2177
Finished in memory cardano api
maciejbak85 cf2e216
rename unwrap, responseF
maciejbak85 7c942c4
println removed, one rename
maciejbak85 99450b3
enum comp fix
maciejbak85 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
cardano.wallet.baseUrl=${BASE_URL} | ||
cardano.wallet.baseUrl=${?BASE_URL} | ||
|
||
cardano.wallet1.passphrase=${CARDANO_API_WALLET_1_PASSPHRASE} | ||
cardano.wallet1.passphrase=${?CARDANO_API_WALLET_1_PASSPHRASE} | ||
cardano.wallet1.name="cardano_api_wallet_1" | ||
cardano.wallet1.amount=2000000 | ||
cardano.wallet1.mnemonic=${CARDANO_API_WALLET_1_MNEMONIC} | ||
cardano.wallet1.mnemonic=${?CARDANO_API_WALLET_1_MNEMONIC} | ||
cardano.wallet1.id="6cd6d11a489b7ea82a4624d18b93bdf9b77f0620" | ||
cardano.wallet1.metadata="0:0123456789012345678901234567890123456789012345678901234567890123:2:TESTINGCARDANOAPI" | ||
|
||
cardano.wallet2.mnemonic=${CARDANO_API_WALLET_2_MNEMONIC} | ||
cardano.wallet2.mnemonic=${?CARDANO_API_WALLET_2_MNEMONIC} | ||
cardano.wallet2.id="bfa9530c4ecfee6e5561e950bd7a7a332e4e7497" | ||
cardano.wallet2.name="somethrowawayname" | ||
cardano.wallet2.passphrase="somethrowawayname" | ||
|
||
cardano.wallet3.mnemonic=${CARDANO_API_WALLET_3_MNEMONIC} | ||
cardano.wallet3.mnemonicsecondary=${CARDANO_API_WALLET_3_MNEMONIC_SECONDARY} | ||
cardano.wallet3.mnemonic=${?CARDANO_API_WALLET_3_MNEMONIC} | ||
cardano.wallet3.mnemonicsecondary=${?CARDANO_API_WALLET_3_MNEMONIC_SECONDARY} | ||
cardano.wallet3.id="4a583f9487bac2059caf50d753da1c91ede74345" | ||
cardano.wallet3.name="cardano_api_wallet_3" | ||
cardano.wallet3.passphrase=${CARDANO_API_WALLET_3_PASSPHRASE} | ||
cardano.wallet3.passphrase=${?CARDANO_API_WALLET_3_PASSPHRASE} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,14 @@ object HelpExecute { | |
case (k, v) => k.toLong -> MetadataValueStr (v) | ||
} | ||
}.toMap | ||
|
||
def failOnLeft[T](future: Future[CardanoApiResponse[T]])(implicit ec: ExecutionContext): Future[T] = for { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. failOnLeft should be unwrap and since we're in the area future should probably be responseF |
||
either <- future | ||
response <- either match { | ||
case Left(error) => Future.failed(new CardanoApiException(error.message, error.code)) | ||
case Right(value) => Future.successful(value) | ||
} | ||
} yield response | ||
} | ||
|
||
class HelpExecute(implicit ec: ExecutionContext, as: ActorSystem) extends JApiRequestExecutor { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
cardano.wallet.baseUrl=${BASE_URL} | ||
cardano.wallet.passphrase=${CARDANO_API_WALLET_1_PASSPHRASE} | ||
cardano.wallet.baseUrl=${?BASE_URL} | ||
cardano.wallet.passphrase=${?CARDANO_API_WALLET_1_PASSPHRASE} | ||
cardano.wallet.name="cardano_api_wallet_1" | ||
cardano.wallet.amount=2000000 | ||
cardano.wallet.mnemonic=${CARDANO_API_WALLET_1_MNEMONIC} | ||
cardano.wallet.mnemonic=${?CARDANO_API_WALLET_1_MNEMONIC} | ||
cardano.wallet.id="6cd6d11a489b7ea82a4624d18b93bdf9b77f0620" | ||
cardano.wallet.metadata="0:0123456789012345678901234567890123456789012345678901234567890123:2:TESTINGCARDANOAPI" | ||
|
||
cardano.wallet2.mnemonic=${CARDANO_API_WALLET_2_MNEMONIC} | ||
cardano.wallet2.mnemonic=${?CARDANO_API_WALLET_2_MNEMONIC} | ||
cardano.wallet2.id="bfa9530c4ecfee6e5561e950bd7a7a332e4e7497" | ||
cardano.wallet2.name="somethrowawayname" | ||
cardano.wallet2.passphrase="somethrowawayname" |
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,14 @@ | ||
[ | ||
{ | ||
"id": "addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g", | ||
"state": "unused" | ||
}, | ||
{ | ||
"id": "addr2sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g", | ||
"state": "used" | ||
}, | ||
{ | ||
"id": "addr3sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g", | ||
"state": "unused" | ||
} | ||
] |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"unit": "lovelace" | ||
}, | ||
"estimated_max": { | ||
"quantity": 42000000, | ||
"quantity": 126000000, | ||
"unit": "lovelace" | ||
} | ||
} |
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,10 @@ | ||
[ | ||
{ | ||
"id": "addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g", | ||
"state": "unused" | ||
}, | ||
{ | ||
"id": "addr3sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g", | ||
"state": "unused" | ||
} | ||
] |
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,6 @@ | ||
[ | ||
{ | ||
"id": "addr2sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g", | ||
"state": "used" | ||
} | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CardanoJpiSpec has a println on line 60