fix: return correct number of signatures needed to load programs (#12729)

This commit is contained in:
Justin Starry
2020-10-09 08:58:03 +08:00
committed by GitHub
parent 2c5f83c264
commit 6972e63f51
2 changed files with 23 additions and 10 deletions

View File

@ -34,7 +34,12 @@ export class Loader {
* Can be used to calculate transaction fees
*/
static getMinNumSignatures(dataLength: number): number {
return Math.ceil(dataLength / Loader.chunkSize);
return (
2 * // Every transaction requires two signatures (payer + program)
(Math.ceil(dataLength / Loader.chunkSize) +
1 + // Add one for Create transaction
1) // Add one for Finalize transaction
);
}
/**