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

Support latest connex #13

Open
molekilla opened this issue Jun 27, 2019 · 1 comment
Open

Support latest connex #13

molekilla opened this issue Jun 27, 2019 · 1 comment

Comments

@molekilla
Copy link

Hi
I'm getting this with Typescript

Argument of type 'Connex.Thor.Clause[]' is not assignable to parameter of type 'import("/home/some/Code/connex-ts/node_modules/thor-devkit/dist/transaction").Transaction.Clause[]'.
  Type 'Connex.Thor.Clause' is not assignable to type 'import("/home/some/Code/connex-ts/node_modules/thor-devkit/dist/transaction").Transaction.Clause'.
    Property 'data' is optional in type 'Clause' but required in type 'Clause'

data needs to be optional in thor-devkit

Thanks
Rogelio

@qianbin
Copy link
Member

qianbin commented Jun 27, 2019

@molekilla You must be using latest connex release v1.3.1. In practical, type string? is more suitable for Clause.data, and i think it's the rare case to encode a tx in connex environment.

The workaround:

// assume type of `clauses` is Connex.Thor.Clause[]
const converted = clauses.map(c => ({to: c.to, value: c.value, data: c.data || '0x'}))

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