Skip to content

Commit

Permalink
Expect hex-string instead of int in test
Browse files Browse the repository at this point in the history
  • Loading branch information
notlesh committed May 9, 2022
1 parent f58d564 commit ac3e6af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/tests/test-crowdloan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ describeDevMoonbeam("Crowdloan", (context) => {
)
);
expect(events[1].toHuman().method).to.eq("ProxyExecuted");
expect(events[1].data[0].toString()).to.be.eq(`{"err":{"module":{"index":0,"error":5}}}`);
expect(events[1].data[0].toString()).to.be.eq(`{"err":{"module":{"index":0,"error":"0x05000000"}}}`);

This comment has been minimized.

Copy link
@crystalin

crystalin May 9, 2022

Collaborator

That seems to be breaking the API

This comment has been minimized.

Copy link
@crystalin

crystalin May 9, 2022

Collaborator

It is only polkadotjs being changed or is it the API response ?
(polkadotJs toString() is not considered "consistent" to use in tests for objects)

This comment has been minimized.

Copy link
@notlesh

notlesh May 9, 2022

Author Contributor

I believe it's related to this, we had to adjust some similar errors in rust:

paritytech/substrate#10242

This comment has been minimized.

Copy link
@notlesh

notlesh May 9, 2022

Author Contributor

e.g. we changed:

-	error: 2,
+	error: [2, 0, 0, 0],

in b5ce527

This comment has been minimized.

Copy link
@crystalin

crystalin May 9, 2022

Collaborator

Ok so we should reference that in breaking change in the description and put the breaking api label


// Genesis account still has the money
rewardInfo = await getAccountPayable(context, GENESIS_ACCOUNT);
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-proxy/test-proxy-balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describeDevMoonbeam("Proxy: Balances - shouldn't accept other proxy types", (con
);

expect(events2[1].method).to.be.eq("ProxyExecuted");
expect(events2[1].data[0].toString()).to.be.eq(`{"err":{"module":{"index":0,"error":5}}}`);
expect(events2[1].data[0].toString()).to.be.eq(`{"err":{"module":{"index":0,"error":"0x05000000"}}}`);
expect(events2[4].method).to.be.eq("ExtrinsicSuccess");

// // check association failed
Expand Down

0 comments on commit ac3e6af

Please sign in to comment.