-
Notifications
You must be signed in to change notification settings - Fork 36
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
CreateObligation fails with constructor #21
Comments
Thanks for the heads up. It's because I changed the constructor signature (added a type parameter) and the node shell can't deserialise a string to the type. I'll add a helper flow so this will work. Cheers |
Actually I've had a look into this and there's no way to fix it in the short term, it requires some Corda changes or changes to the tokens SDK to provide jackson annotations for sub-classes. In the meantime, I'm going to include a node driver integration test which demonstrates the whole end to end workflow. Cheers |
I got a similar error for NovateObligation.
Is it the same cause? |
Yes its the same problem. The shell cannot deserialise the types. There is one way around it which is to create a wrapper flow which just takes strings as input and then constructs the objects you need and then invokes the create obligation flow. It's not difficult to do but will get messy, e.g. you'll need to deal with whether the currency code is a fiat or digital currency, for example. |
@roger3cev, I was just wondering if there is a node driver integration test for an end to end flow for ripple settlement since we are not able to test it using the shell? |
There's not a node driver test at the moment - it's on our TODO To add one though. Cheers |
Hi guys, UPDATE: I was able to use Roger's workaround (i.e. instead of passing an
class Initiator<T : TokenType>(
private val longAmount: Long,
private val currencyCode: String,
private val role: InitiatorRole,
private val counterparty: Party,
private val dueBy: Instant? = null,
private val anonymous: Boolean = true
) : FlowLogic<WireTransaction>() {
private val token = FiatCurrency(Currency.getInstance(currencyCode))
private val amount = Amount(longAmount, token)
class Initiator(
val linearId: UniqueIdentifier,
private val fiatIdentifier: String,
private val digitalIdentifier: String,
private val oracle: Party
) : FlowLogic<WireTransaction>() {
private val fiatToken = FiatCurrency(Currency.getInstance(fiatIdentifier))
private val digitalToken = DigitalCurrency(digitalIdentifier)
private val novationCommand = ObligationCommands.Novate.
UpdateFaceAmountToken(fiatToken, digitalToken, oracle)
class Initiator(
val linearId: UniqueIdentifier,
val accountToPay: String,
val settlementOracle: Party
) : FlowLogic<WireTransaction>() {
private val settlementMethod = XrpSettlement(accountToPay, settlementOracle)
class Initiator<T : TokenType>(
private val longAmount: Long,
private val digitalIdentifier: String,
private val linearId: UniqueIdentifier
) : FlowLogic<WireTransaction>() {
private val token = DigitalCurrency(digitalIdentifier)
private val amount = Amount(longAmount, token)
|
Thanks for the fix. I was able to test the end to end flow on the Corda shell. |
@koshikraj Thanx for your merge request, I also updated the comment here to remove the repeated instruction. |
Calling the CreateObligation flow as described in the example leads to an error.
Command:
start CreateObligation amount: { quantity: 1000, token: { currencyCode: USD, type: fiat } }, role: OBLIGOR, counterparty: PartyB, dueBy: 1543922400, anonymous: false
Error:
Cheers,
TAC
The text was updated successfully, but these errors were encountered: