Giter VIP home page Giter VIP logo

evaluator-integration-checks's Introduction

'Ello! I'm Lyudmil.

developer

evaluator-integration-checks's People

Contributors

flmel avatar gagdiez avatar

Watchers

 avatar

evaluator-integration-checks's Issues

[docs] Documentation

Add documentation
each of the integration check - expectations, input/output and how to run
add main readme.md

[Test] Handling NEAR in XCC

A total classic error is that people will receive money, make a XCC, the XCC will fail, and they will forget to return the funds to the user.

I honestly saw this happening a bunch of times, specially in the NFT context, were people will receive money, ask to mint an NFT, the mint will fail, and now the user does not have neither the money nor the NFT.

We need to test this:

  • The contract receives money
  • They call a method that fails
  • The money needs to be returned to the user
  • But!! I want something on the state to change... so they need to handle the call, and not just panic.

We ask the user to create a contract that takes attachedDeposit and bridges it to another fixed contract (e.g. validator.test) while keeping track of the total user's deposits.

In code:

deposit(number){
  xcc to stake the money in "validator.test"
  callback(deposit_attached)
}

callback_handler(deposit_attached){
  if error
    return money
  }else{
    this.deposit[user] += amount_staked
  }
}

deposit_for(account){
  this.deposit[user]
}

We need to make sure using batch calls that the user is NOT making this:

deposit(number){
  this.deposit[user] += amount_staked
  xcc to stake the money in "validator.test"
  callback(deposit_attached)
}

callback_handler(deposit_attached){
  if error
    this.deposit[user] -= amount_staked
    return money
  }
}

deposit_for(account){
  this.deposit[user]
}

[Test] Handle NEAR

Test that the people understand how to:

  • Handle deposits
  • Transfer NEAR out of the contract

[Test] Nested Collections

Evaluating nested collections is also a great way to remember people that:

They need to use different sufixes for their collections
They can combine native collections with SDK collections

[Test] Add test for storing complex structure

We can take the test from complex_input, and simply ask the user now to also store it in the contract.

So they need to both:

  • Take the input and return the transformation of it (i.e. exactly the complex_input test.
  • They also need to store it, so we can call another method after, and retrieve the same result as complex_input.

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.