-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…309) * fix!: removes controller arg from bond and setController methods * fix: updates the Kusama version in the metadata file
- Loading branch information
Showing
13 changed files
with
88 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './kusama'; | ||
export * from './mockCreateMetadata'; | ||
export * from './polkadot'; | ||
export * from './westend'; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './metadataHex'; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './kusamaRegistry'; | ||
export * from './polkadotRegistry'; | ||
export * from './statemineRegistry'; | ||
export * from './westendRegistry'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { TypeRegistry } from '@polkadot/types'; | ||
import { getSpecTypes } from '@polkadot/types-known'; | ||
import memoizee from 'memoizee'; | ||
|
||
import { mockGetRegistryBase } from './mockGetRegistry'; | ||
|
||
/** | ||
* Get the Westend type registry for a given spec version for testing purposes | ||
* | ||
* @param specVersion | ||
* @param metadataRpc | ||
*/ | ||
export function getRegistryWestend( | ||
specVersion: number, | ||
metadataRpc: `0x${string}` | ||
): TypeRegistry { | ||
return mockGetRegistryBase({ | ||
chainProperties: { | ||
ss58Format: 0, | ||
tokenDecimals: 10, | ||
tokenSymbol: 'WND', | ||
}, | ||
specTypes: getSpecTypes( | ||
new TypeRegistry(), | ||
'Westend', | ||
'westend', | ||
specVersion | ||
), | ||
metadataRpc, | ||
}); | ||
} | ||
|
||
export const memoizedWestendGetRegistry = memoizee(getRegistryWestend); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 6 additions & 9 deletions
15
packages/txwrapper-substrate/src/methods/staking/setController.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
import { | ||
itHasCorrectBaseTxInfo, | ||
KUSAMA_TEST_OPTIONS, | ||
TEST_BASE_TX_INFO, | ||
WESTEND_TEST_BASE_TX_INFO, | ||
WESTEND_TEST_OPTIONS, | ||
} from '@substrate/txwrapper-dev'; | ||
|
||
import { TEST_METHOD_ARGS } from '../../test-helpers'; | ||
import { setController } from './setController'; | ||
|
||
describe('staking::setController', () => { | ||
it('should work', () => { | ||
const unsigned = setController( | ||
TEST_METHOD_ARGS.staking.setController, | ||
TEST_BASE_TX_INFO, | ||
KUSAMA_TEST_OPTIONS | ||
{}, | ||
WESTEND_TEST_BASE_TX_INFO, | ||
WESTEND_TEST_OPTIONS | ||
); | ||
|
||
itHasCorrectBaseTxInfo(unsigned); | ||
expect(unsigned.method).toBe( | ||
'0x0608008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48' | ||
); | ||
expect(unsigned.method).toBe('0x0608'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters