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

SEP-29 as implemented in JS/GO SDK's #78

Merged
merged 6 commits into from
Apr 1, 2020

Conversation

JakeUrban
Copy link
Contributor

@JakeUrban JakeUrban commented Mar 30, 2020

resolves #75

Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

The functionality inside the check_memo_required function looks good, but see below for what I think is missing.

lib/stellar/client.rb Show resolved Hide resolved
lib/stellar/client.rb Outdated Show resolved Hide resolved
@@ -427,4 +427,140 @@
end
end

describe "#submit_transaction" do
Copy link
Contributor

Choose a reason for hiding this comment

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

All the tests for submit_transaction involve operations that require memos. Can we add a test that has a mix of operations, some that require memo and others that don't, and a test that has only operations that don't require a memo and no memo is set to ensure the error is not raised in that case?

JakeUrban and others added 2 commits March 31, 2020 12:01
Co-Authored-By: Leigh McCulloch <leigh@mcchouse.com>
@@ -3,7 +3,7 @@
require 'securerandom'

module Stellar
class InvalidSep10ChallengeError < StandardError; end
class AccountRequiresMemoError < StandardError; end
Copy link
Contributor

Choose a reason for hiding this comment

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

@JakeUrban can you add the accountId and the operationIndex similar to https://github.com/stellar/js-stellar-sdk/blob/master/src/errors.ts#L90?

@JakeUrban
Copy link
Contributor Author

@abuiles @leighmcculloch this PR should be ready for another look when you get a chance

@@ -244,7 +252,7 @@ def check_memo_required(tx_envelope)
end
if info.data["config.memo_required"] == "MQ=="
# MQ== is the base64 encoded string for the string "1"
raise AccountRequiresMemoError.new("account requires memo")
raise AccountRequiresMemoError.new("account requires memo", destination, idx)
Copy link
Contributor

Choose a reason for hiding this comment

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

@JakeUrban nice! can you update the test to assert this and also update the demo code so people know what attrs they can work with?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When you say demo code you're referring to the /examples files right? I don't want to update the examples before the functionality is released. I think doing so would confuse people.

But I'll add that test.

@JakeUrban JakeUrban merged commit 6511885 into astroband:master Apr 1, 2020
@JakeUrban JakeUrban deleted the sep29-check branch April 1, 2020 19:53
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.

Add support for SEP0029
3 participants