Bump common (#3155)

* Bump common

* Adjust (some) tests

* Adjust tests
This commit is contained in:
Jaco Greeff
2021-02-07 09:49:48 +01:00
committed by GitHub
parent 0f5b01b856
commit e2230ef454
14 changed files with 135 additions and 135 deletions
@@ -28,8 +28,8 @@ describe('EthereumLookupSource', (): void => {
);
testDecode(
'AccountIndex (mixed prefixes)',
registry.createType('EthereumLookupSource', '2jpAFn'),
// NOTE Expected address here is encoded with prefix 42, input above with 68
registry.createType('EthereumLookupSource', '118r'),
// NOTE Expected address here is encoded with prefix 42, input above with 1
'25GUyv'
);
testDecode(
@@ -98,7 +98,7 @@ describe('EthereumLookupSource', (): void => {
it('equals on AccountIndex', (): void => {
// see the test below - these are equivalent (with different prefix encoding)
expect(registry.createType('EthereumLookupSource', '2jpAFn').eq('25GUyv')).toBe(true);
expect(registry.createType('EthereumLookupSource', '118r').eq('25GUyv')).toBe(true);
});
});
});
+10 -10
View File
@@ -90,7 +90,7 @@ describe('AccountId', (): void => {
]));
it('decodes to a non-empty value', (): void => {
expect(registry.createType('AccountId', '7qT1BvpawNbqb3BZaBTMFMMAKrpJKLPf1LmEHR1JyarWJdMX').isEmpty).toBe(false);
expect(registry.createType('AccountId', 'FVU8T5yaAssHAUwo3PnKso7fqNthEqJZGCZgJZSR9cKjWAf').isEmpty).toBe(false);
});
});
@@ -98,7 +98,7 @@ describe('AccountId', (): void => {
it('has the correct entries', (): void => {
registry.setChainProperties(
registry.createType('ChainProperties', {
ss58Format: 68
ss58Format: 2
})
);
@@ -106,14 +106,14 @@ describe('AccountId', (): void => {
const list = registry.createType('Vec<AccountId>', data).map((accountId) => accountId.toString());
expect(list).toEqual([
'7qVJujLF3EDbZt5WfQXWvueFedMS4Vfk2Hb4GyR8jwksTLup',
'7pHyqeYaJjJPgxQgCXoS2EZMhBhtpm6BLCqQ4jJZTQB2kMhw',
'7pYLWV6PTUmLTMQfHmmuBwBNLkhcKhRAnkM36CSJtjat9ACb',
'7qT1BvpawNbqb3BZaBTMFMMAKrpJKLPf1LmEHR1JyarWJdMX',
'7rADc9JW5EUGFPWLjPMipH4c3bJ2GyAUedmqQHiaGucWVrsT',
'7oK5KRH6jt4p8auipnru9ptqeuRwbLMHA2tgCViZzhmW4Lox',
'7ndAVsHvonnzTg4AvRhpraNCKj9g4CGQXKoLrgkTZ91Na6PE',
'7oL7VfXgLA8L3pJJwi11v3sBYc1b5R3tLrweHwzMNxgEpjxP'
'FXmrFbdg2VdG1NttGTx1S6Czbv2SQ7PaD2PfryGBWWgt52i',
'ELSnAoxwXaRP5i4RPjs6m1K3AGVCfXpt8GjTcrgtxvrAuZv',
'EaoT1Mn6H3N9Ui3WdiLGTdKgjGChbrpLfnNV5zSLJLhZvgj',
'FVU8T5yaAssHAUwo3PnKso7fqNthEqJZGCZgJZSR9cKjWAf',
'GCgYfZti2kHwWoixFJ9toWZPZrcesc8CZDAoBGhiUNKvTQM',
'DMYFwYVNgLqpiD73eoLEMLnzszXyEnvhxL1bPGhSGXKV8kS',
'CfdSPZKSb529oMZ9HeFw6p9fhiGS6i45FEgFaJazhmBzsxZ',
'DNaSBo4xxQMjwbhAZwSzaK8taaBTKVXtnNygqYUpXS4FMwN'
]);
});
});
@@ -44,7 +44,7 @@ describe('AccountIndex', (): void => {
});
it('compares numbers', (): void => {
expect(registry.createType('AccountIndex', '2jpAFn').eq(256 * 1)).toBe(true);
expect(registry.createType('AccountIndex', '118r').eq(256 * 1)).toBe(true);
});
describe('calcLength', (): void => {
@@ -23,7 +23,7 @@ describe('LookupSource', (): void => {
it('equals on AccountIndex', (): void => {
// see the test below - these are equivalent (with different prefix encoding)
expect(registry.createType('IndicesLookupSource', '2jpAFn').eq('25GUyv')).toBe(true);
expect(registry.createType('IndicesLookupSource', '118r').eq('25GUyv')).toBe(true);
});
});
@@ -40,8 +40,8 @@ describe('LookupSource', (): void => {
);
testDecode(
'AccountIndex (mixed prefixes)',
registry.createType('IndicesLookupSource', '2jpAFn'),
// NOTE Expected adress here is encoded with prefix 42, input above with 68
registry.createType('IndicesLookupSource', '118r'),
// NOTE Expected adress here is encoded with prefix 42, input above with 1
'25GUyv'
);
testDecode(
@@ -83,7 +83,7 @@ describe('LookupSource', (): void => {
'Mwz15xP2'
);
// FIXME The specification allows for 8 byte addresses, however since AccountIndex is u32 internally
// (and defined that way in thd efault Substrate),this does not actually work since it is 8 bytes,
// (and defined that way in the default Substrate),this does not actually work since it is 8 bytes,
// instead of 4 bytes max u32 length
// testDecode(
// 'Uint8Array (with prefix 8 bytes)',