Provide genesisHash & version to signer (#941)
* Provide genesisHash & version to signer * Remove runtimeVersion (until needed, supplied anyway)
This commit is contained in:
@@ -197,10 +197,10 @@ export default function createSubmittableExtrinsic<CodecResult, SubscriptionResu
|
||||
} else {
|
||||
assert(api.signer, 'no signer exists');
|
||||
|
||||
updateId = await (api.signer as Signer).sign(_extrinsic, address, expandOptions({
|
||||
...options,
|
||||
nonce
|
||||
}));
|
||||
updateId = await (api.signer as Signer).sign(_extrinsic, address, {
|
||||
...expandOptions({ ...options, nonce }),
|
||||
genesisHash: api.genesisHash
|
||||
});
|
||||
}
|
||||
}),
|
||||
switchMap(() => {
|
||||
|
||||
@@ -189,11 +189,15 @@ export interface ApiBaseInterface<CodecResult, SubscriptionResult> extends Reado
|
||||
once: (type: ApiInterface$Events, handler: (...args: Array<any>) => any) => this;
|
||||
}
|
||||
|
||||
export type SignerOptions = SignatureOptions & {
|
||||
genesisHash: Hash
|
||||
};
|
||||
|
||||
export interface Signer {
|
||||
/**
|
||||
* @description Signs an extrinsic, returning an id (>0) that can be used to retrieve updates
|
||||
*/
|
||||
sign (extrinsic: IExtrinsic, address: string, options: SignatureOptions): Promise<number>;
|
||||
sign (extrinsic: IExtrinsic, address: string, options: SignerOptions): Promise<number>;
|
||||
|
||||
/**
|
||||
* @description Receives an update for the extrinsic signed by a `signer.sign`
|
||||
|
||||
Reference in New Issue
Block a user