Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: "list" argument must be an Array of Buffers Function.concat #4

Open
nathansenn opened this issue Jul 30, 2020 · 1 comment

Comments

@nathansenn
Copy link

TypeError: "list" argument must be an Array of Buffers
Function.concat
node_modules/buffer/index.js:399
396 | for (i = 0; i < list.length; ++i) {
397 | var buf = list[i]
398 | if (!Buffer.isBuffer(buf)) {

399 | throw new TypeError('"list" argument must be an Array of Buffers')
| ^ 400 | }
401 | buf.copy(buffer, pos)
402 | pos += buf.length
View compiled
newAddress
src/index.js:59
56 | const protocolByte = new Buffer.alloc(1)
57 | protocolByte[0] = protocol
58 |
59 | return new Address(Buffer.concat([protocolByte, payload]))
60 | }
61 |
62 | decode = address => {
View compiled
createKeyPair
src/operations.ts:52
49 | const pk = typeof publicKey === "string" ? util_1.hexToU8a(publicKey) : publicKey;
50 | const rawAddress = filecoin_address_1.newAddress(1, blakejs_1.default.blake2b(pk, null, 20));
51 | return network ? filecoin_address_1.encode(network, rawAddress) : ${rawAddress.protocol()}${rawAddress.payload()};
52 | }
53 | exports.publicKeyToAddress = publicKeyToAddress;
54 | // transforms elliptic KeyPair to our defined KeyPair class
55 | function createKeyPair(keypair, network) {
View compiled
keyPairFromSeed
src/operations.ts:33
30 | *
31 | * @param seed
32 | * @param network - "f" or "t"
33 | */
34 | function keyPairFromSeed(seed, network) {
35 | const seedHash = blakejs_1.default.blake2bHex(seed, null, 32);
36 | const e = new elliptic_1.ec("secp256k1");
View compiled
privateKeytoAddress
src/services/filecoinapi.js:31
28 |
29 | export function privateKeytoAddress(privKey) {
30 |
31 | const generatedKeypair = keyPairFromSeed("3a47b554c417b75545b5545545545e", "t");
32 |
33 |
34 | }

@MakMuftic
Copy link
Member

I am not able to reproduce this error. Could you share more details, like your package.json file and tsconfig file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants