File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ function check(data) {
2727}
2828exports . check = check ;
2929function canAdd ( currentData , newData ) {
30- return ! ! currentData && ! ! newData && currentData . sighashType === undefined ;
30+ return (
31+ ! ! currentData &&
32+ newData !== undefined &&
33+ currentData . sighashType === undefined
34+ ) ;
3135}
3236exports . canAdd = canAdd ;
Original file line number Diff line number Diff line change @@ -205,6 +205,14 @@ exports.fixtures = {
205205 'cHNidP8BAFMBAAAAAdSnb/ld4fTAFho+U+qHapHtlTMa6NAS2B+XE4SYzl2GAwAAAAD/' +
206206 '////AdIClkkAAAAAF6kU4Yhw8sKX+/ylTFxvZFx3RaW2btqHAAAAAAABAwQBAAAAAAA=' ,
207207 } ,
208+ {
209+ method : 'updateInput' ,
210+ addInputOutput : true ,
211+ args : [ 0 , { sighashType : 0 } ] ,
212+ expected :
213+ 'cHNidP8BAFMBAAAAAdSnb/ld4fTAFho+U+qHapHtlTMa6NAS2B+XE4SYzl2GAwAAAAD/' +
214+ '////AdIClkkAAAAAF6kU4Yhw8sKX+/ylTFxvZFx3RaW2btqHAAAAAAABAwQAAAAAAAA=' ,
215+ } ,
208216 {
209217 method : 'updateInput' ,
210218 addInputOutput : true ,
Original file line number Diff line number Diff line change @@ -27,5 +27,9 @@ export function check(data: any): data is SighashType {
2727}
2828
2929export function canAdd ( currentData : any , newData : any ) : boolean {
30- return ! ! currentData && ! ! newData && currentData . sighashType === undefined ;
30+ return (
31+ ! ! currentData &&
32+ newData !== undefined &&
33+ currentData . sighashType === undefined
34+ ) ;
3135}
Original file line number Diff line number Diff line change @@ -204,6 +204,14 @@ export const fixtures = {
204204 'cHNidP8BAFMBAAAAAdSnb/ld4fTAFho+U+qHapHtlTMa6NAS2B+XE4SYzl2GAwAAAAD/' +
205205 '////AdIClkkAAAAAF6kU4Yhw8sKX+/ylTFxvZFx3RaW2btqHAAAAAAABAwQBAAAAAAA=' ,
206206 } ,
207+ {
208+ method : 'updateInput' ,
209+ addInputOutput : true ,
210+ args : [ 0 , { sighashType : 0 } ] ,
211+ expected :
212+ 'cHNidP8BAFMBAAAAAdSnb/ld4fTAFho+U+qHapHtlTMa6NAS2B+XE4SYzl2GAwAAAAD/' +
213+ '////AdIClkkAAAAAF6kU4Yhw8sKX+/ylTFxvZFx3RaW2btqHAAAAAAABAwQAAAAAAAA=' ,
214+ } ,
207215 {
208216 method : 'updateInput' ,
209217 addInputOutput : true ,
You can’t perform that action at this time.
0 commit comments