Skip to content
This repository was archived by the owner on May 1, 2023. It is now read-only.

Comments

Remove redundant and erroneous function call from FA1.2 Doc Tutorial#52

Open
GradeyCullins wants to merge 1 commit intotqtezos:masterfrom
GradeyCullins:memory-signer-bug-docs
Open

Remove redundant and erroneous function call from FA1.2 Doc Tutorial#52
GradeyCullins wants to merge 1 commit intotqtezos:masterfrom
GradeyCullins:memory-signer-bug-docs

Conversation

@GradeyCullins
Copy link

Problem

While learning about the Tezos developer ecosystem, I've discovered what I believe to be an error in the documentation page found here:

https://assets.tqtezos.com/docs/token-contracts/fa12/2-fa12-ligo/

The code to highlight is:

const { InMemorySigner, importKey } = require("@taquito/signer")
const fs = require("fs")
const { email, password, mnemonic, secret } = JSON.parse(
  fs.readFileSync("./faucet.json").toString()
)

const Tezos = new TezosToolkit("https://api.tez.ie/rpc/edonet")
Tezos.setProvider({ signer: new InMemorySigner() })

importKey(Tezos, email, password, mnemonic.join(" "), secret)

I believe the call to Tezos.setProvider(...) is unnecessary for two reasons:

  1. The documentation for importKey states that the function has a "side-effect" of setting the Tezos instance's signer to the InMemorySigner making the Tezos.setProvider(... call redundant.
  2. Per the most current docs, it is incorrect to call the InMemorySigner constructor with no arguments.

Solution

My pull request removes the redundant call and the InMemorySigner import.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant