testscripts

command
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

Test the conversion service

Create accounts

go run createAccounts.go

Fund the tfchain address

  • Using the tfchain address from the previous step:
    • ensure this address has some balance in TFT
    • create some locked token transfers using the desktop wallet

with the commandline client:

send some unlocked tokens:

tfchainc wallet send coins <address> 10

send some locked tokens:

with a lock until November 1 2020:

tfchainc wallet send coins '{"type": 3,"data": {"locktime": 1604188800,"condition": {"type":1,"data":{ "unlockhash":"<address>"}}}}' 11

with a lock until November 1 2021:

tfchainc wallet send coins '{"type": 3,"data": {"locktime": 1635724800,"condition": {"type":1,"data":{ "unlockhash":"<address>"}}}}' 12

Deauthorize the account:

tfchainc wallet send transaction "$(tfchainc wallet sign "$(tfchainc wallet authcoin authaddresses --deauth <address>)")"

Account activation

curl -H "Content-Type: application/json" -d '{ "args": { "address": "","tfchain_address":""   }}' "http://localhost:7000/threefoldfoundation/conversion_service/activate_account"

Token migration

  • Import the converter wallet in JSX
  • Create a stellar account with secret from the first step in JSX to add the trustlines to TFT and TFTA:
a= j.clients.stellar.new('migrating',network='TEST',secret='')
a.add_known_trustline('TFT')
a.add_known_trustline('TFTA')

from jsx:

p.threefoldfoundation.conversion_service.actors.conversion_service.migrate_tokens(stellar_address=stellarclient.address, tfchain_address="<tfchainaddress>")

through curl:

curl -H "Content-Type: application/json" -d '{ "args": { "tfchain_address": "", "stellar_address": "" }}' "http://localhost:7000/threefoldfoundation/conversion_service/migrate_tokens"

This result is an array of unlock transactionenvelopes in xdr format.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL