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

Bug: Wallet Authorization Fails on First Use in Test Environment on Dev Network #98

Open
humanagent opened this issue Nov 30, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@humanagent
Copy link
Contributor

humanagent commented Nov 30, 2023

Describe the bug

When running this test script for the first time, the wallet authorization fails and the wallet cannot be used again in the test environment. This issue only occurs on the dev network (dev.xmtp.network).

import 'package:flutter_test/flutter_test.dart';
import 'package:web3dart/web3dart.dart';
import 'package:example/session/foreground_session.dart';
import 'package:xmtp/xmtp.dart' as xmtp;

void main() {
  test('Test wallet authorization', () async {
    var wallet = EthPrivateKey.fromHex('key').asSigner();
    print('Wallet address: ${await wallet.address}');
    var api = xmtp.Api.create(host: 'dev.xmtp.network', isSecure: true);
    var client =  await xmtp.Client.createFromWallet(api, wallet);
  });
}

Interestingly, if the wallet is first used in another application, then it works fine in the test script and continues to work without any issues. Also interestingly, only happens in the dev network.

Steps to reproduce:

  1. Create a wallet in metamask and export key
  2. Run the test script on the dev network for the first time.
  3. Observe that the script runs well.
  4. Try to use the wallet now indev.xmtp.chat
CleanShot 2023-11-30 at 18 17 03@2x

Additional notes

The same flow was tested in the Javascript SDK and it worked normally.

@humanagent humanagent added the bug Something isn't working label Nov 30, 2023
@humanagent humanagent removed their assignment Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant