GithubHelp home page GithubHelp logo

stellar / stellar-anchor-tests Goto Github PK

View Code? Open in Web Editor NEW
11.0 28.0 10.0 812 KB

A library and CLI tool for testing Stellar anchors.

License: Apache License 2.0

JavaScript 0.79% TypeScript 98.08% Shell 0.02% HTML 0.32% Dockerfile 0.47% Makefile 0.27% Nix 0.03% CSS 0.02%

stellar-anchor-tests's Introduction

Stellar Anchor Tests Monorepo

Live at anchor-tests.stellar.org

This repository is a container for three applications.

  • @stellar/anchor-tests
    • A library and CLI for testing stellar anchors. Will be published to npm.
  • ui
    • A react-redux web interface for running anchor tests. Connects to the server via websockets.
  • server
    • A socket.io server. Depends on @stellar/anchor-tests.

See each project for more information. To install and run all applications:

git clone [email protected]:stellar/stellar-anchor-tests.git
cd stellar-anchor-tests
yarn install
yarn build:all
yarn start:all

stellar-anchor-tests's People

Contributors

cassiomg avatar erika-sdf avatar ifropc avatar jakeurban avatar lijamie98 avatar marcelosalloum avatar philipliu avatar piyalbasu avatar quietbits avatar stfung77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stellar-anchor-tests's Issues

Render `FormData` content in console

FormData objects do not provide a method for retrieving key-value pairs previously appended to them. .toString() does not work if binary data was appended, which is the only time FormData is used.

Its not immediately clear how we can render a string representation of the data encoded in the console when a test fails and the network calls are printed to the console.

https://github.com/form-data/form-data

sep31 "can create a transaction" test wait for newly created customer to pass compliance

What problem does your feature solve?

When creating customers through sep12 it can take some time before said customers pass compliance checks that allow them to participate in sep31 transactions.
Currently the sep31 "can create a transaction" test creates the two customers and uses them immediately to create the sep31 transactions which leads to failure because the customers haven't passed the required compliance checks.

What would you like to see?

A fields in the configuration where you can specify a wait period between the creation of the customers and their use in a transaction.

What alternatives are there?

It might be a possibility to poll for the created customers status before creating the transaction but leaves the problem that the status (since it's a simple processing/passed/rejected value) to not give enough information related to the action to be done next. Ex. it could be possible that there are separate compliance requirements for sep31 and sep24 transactions, so a customer may pass compliance for a sep 31 transaction but fial it for sep24.

Home domain field should validate content

What problem does your feature solve?

When pasting a URL with a trailing slash, the UI will fetch and allow tests to be run but then immediately fail because of the trailing slash

What would you like to see?

Automatic trimming of invalid URL chars

Improve UX for customer file uploads

The document upload interface is a separate modal from the main form. When the modal is hidden the state is also hidden. I propose moving the file upload to be a new section in the main form.

Specifically, I think that a dynamic table can get the job done. something like:
Screenshot_2021-08-04_10-47-48

SEP1 tests failed on Firefox

What version are you using?

Latest master branch. Git cloned and build.

What did you do?

Developed a SEP1 server with Java.
Use http://localhost:8080 as the home domain.
Run sep-1 test.

What did you expect to see?

SEP-1 tests succeed.

What did you see instead?

After clicking Run Tests, FireFox returns to restart the tests.

Chromium works fine.

Inconsistent status checks for "requires a SEP-10 JWT" tests

What version are you using?

stellar anchor tests version 0.1.0

What did you do?

run the sep31 tests

What did you expect to see?

expected the "requires a SEP-10 JWT" test to pass since the implementation returned status code 401

What did you see instead?

test failed since it accepts only status code 403 as viable. status code 401 is accepted for the "requires a SEP-10 JWT" tests from the sep 12 tests so it inconsistent that it's accepted for some tests an not for others.

Loose schema check for sep 31 tests

What problem does your feature solve?

Allows additional fields on the create and get sep31 transactions endpoints.
Our implementation offers and additional monitoring transaction id, which can be used for compliance checks on the transaction, besides the fields of the schema.

What would you like to see?

Would like the test (using the schmas postTransactionsSchema and getTransactionSchema from @stellar\anchor-tests\src\schemas\sep31.ts) to allow additional properties.

What alternatives are there?

sep12 "can retrieve customer using SEP-10 token" doesn't take in account the "account" field from the config

What version are you using?

stellar anchor tests version 0.1.0

What did you do?

run the sep 12 tests through the cli using the following config:

{
    "12": {
        "customers": {
            "toBeCreated": {
                "account": "GDZJYGQJFAA6WGTAR43XT3U4STY3CPRTEMPUFD74HAQYUAQ62SLEQ2UH",
                "first_name": "John",
                "last_name": "Doe",
                "email_address": "[email protected]",
                "address_country_code": "DEU",
                "city": "munchen",
                "state_or_province": "bavaria",
                "address": "street address nr. 2",
                "postal_code": "56709",
                "type": "sep-12-person"
            },
            "sendingClient": {
                "account": "GBYTY7SB6BVG2EGS3GYFHAY4RURGB6ARSKAFQXUPTKQ7DJN5XEXIONQE",
                "first_name": "Tomer",
                "last_name": "Weller",
                "email_address": "[email protected]",
                "type": "sep-12-person",
                "address_country_code": "DEU",
                "city": "munchen",
                "state_or_province": "bavaria",
                "address": "street address nr. 2",
                "postal_code": "56709"
            },
            "receivingClient": {
                "account": "GBYTY7SB6BVG2EGS3GYFHAY4RURGB6ARSKAFQXUPTKQ7DJN5XEXIONQE",
                "first_name": "Lydia",
                "last_name": "Wagner",
                "email_address": "[email protected]",
                "type": "sep-12-person",
                "address_country_code": "DEU",
                "city": "munchen",
                "state_or_province": "bavaria",
                "address": "street address nr. 2",
                "postal_code": "56709"
            },
            "toBeDeleted": {
                "first_name": "Jane",
                "last_name": "Doe",
                "email_address": "[email protected]",
                "type": "sep-12-person"
            }
        },
        "createCustomer": "toBeCreated",
        "deleteCustomer": "toBeDeleted",
        "sameAccountDifferentMemos": [
            "sendingClient",
            "receivingClient"
        ]
    },
    "31": {
        "sendingAnchorClientSecret": "SCIWS2OQIHUY5H3ICQX57IONHONK2WDJS64JDZ7WHT6JO7LQP2IWZ2EE",
        "sendingClientName": "sendingClient",
        "receivingClientName": "receivingClient",
        "transactionFields": {
            "accountID": "b0a7138d-2a13-4cdb-b8d1-0b5643153858",
            "account_name": "alensky alen virtual",
            "bank_routing_number": "1264598421",
            "account_number": "2859268459",
            "bank_account_type": "Savings"
        }
    }
}

What did you expect to see?

Expected the "can retrieve customer using SEP-10 token" test to pass and the token used to contain the the account associated with the "toBeCreated" customer.

What did you see instead?

Test failed. After debugging saw that the token used for the get call contains the wallet associated with the "sendingAnchorClientSecret" instead. Put a breakpoint before the 'getCustomerCall' creation in '@stellar\anchor-tests\src\tests\sep12\getCustomer.ts' in the 'canFetchExistingCustomerBySep10Token' test.
image

SEP-10: use configured SEP-31 public key if specified

What problem does your feature solve?

SEP-31 has a configuration option to specify the public use, but the SEP-12 tests don't use this key. For anchors that require the SEP-12 account to match a list of known public keys, these tests will fail.

What would you like to see?

Update the SEP-12 tests to use the configured public key if it is specified.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.