[go: up one dir, main page]

Tezlink/Kernel: Implement deposit for Tezlink in chain.rs

Linear issue

Closes L2-592

What

Execute in the kernel a Tezlink deposit

Why

Because we want people to be able to deposit assets on Tezlink

How

The goal is to reuse already existing function for Etherlink but for Tezlink, so we creates a struct TezlinkOperation similar to Transaction in transaction.rs.

The new struct TezlinkOperation holds a content that can be a classic tezos operation or a deposit. If it's a deposit we updates the balance of the targetted address.

We mustn't forget that the deposit amount is in wei so we must use the mutez_from_wei function to have a mutez precision.

Manually testing the MR

A tezt test was added to test the deposit for Tezlink.

Here is the command to test the tezt that does a deposit of 1000 tz on bootstrap1:

dune exec etherlink/tezt/tests/main.exe -- --verbose tezlink deposit

It checks that before the deposit bootstrap1 has no balance.

Otherwise test this manually is pretty hard as you can't use the sandbox mode of the sequencer (because you need a rollup to do the deposit).

After the deposit, the account should have 1000 tz

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Arnaud Bihan

Merge request reports

Loading