@@ -63,7 +63,7 @@ export const isHashChainValidWith = ({ hashChain }) => async (prev, scheduled) =
6363 return expected === actual
6464}
6565
66- export const mapNode = pipe (
66+ export const mapNode = ( type ) => pipe (
6767 juxt ( [
6868 // derived from assignment
6969 pipe (
@@ -149,10 +149,15 @@ export const mapNode = pipe(
149149 * So checking for any other field, like 'Owner' should tell us
150150 * whether this is an assignment of data on-chain or not.
151151 */
152- isAssignment : pipe (
153- path ( [ 'message' , 'Target' ] ) ,
154- ( m ) => isNil ( m ) || isEmpty ( m )
155- )
152+ isAssignment : type === 'message'
153+ ? pipe (
154+ path ( [ 'message' , 'Owner' ] ) ,
155+ isNil
156+ )
157+ : pipe (
158+ path ( [ 'message' , 'Target' ] ) ,
159+ ( m ) => isNil ( m ) || isEmpty ( m )
160+ )
156161 } ) ,
157162 // static
158163 always ( { Cron : false } )
@@ -213,7 +218,7 @@ export const loadProcessWith = ({ fetch, logger }) => {
213218 } )
214219 . then ( resToJson )
215220 . then ( nodeAt ( 0 ) )
216- . then ( mapNode )
221+ . then ( mapNode ( 'process' ) )
217222 . then ( applySpec ( {
218223 owner : applySpec ( {
219224 address : path ( [ 'message' , 'Owner' ] ) ,
@@ -450,7 +455,7 @@ export const loadMessagesWith = ({ hashChain, fetch, logger: _logger, pageSize }
450455 /**
451456 * Map to the expected shape
452457 */
453- mapNode ,
458+ mapNode ( 'message' ) ,
454459 ( scheduled ) => {
455460 scheduled . AoGlobal = AoGlobal
456461 return scheduled
@@ -537,7 +542,7 @@ export const loadMessageMetaWith = ({ fetch, logger }) => {
537542 } )
538543 . then ( resToJson )
539544 . then ( nodeAt ( 0 ) )
540- . then ( mapNode )
545+ . then ( mapNode ( 'message' ) )
541546 . then ( applySpec ( {
542547 timestamp : path ( [ 'message' , 'Timestamp' ] ) ,
543548 nonce : path ( [ 'message' , 'Nonce' ] ) ,
0 commit comments