-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support v1.8.0 * remove not needed function * add tests for v1.8.0 * test to validate v1.7.0 lock * add tests for deposit_amounts * deposit amounts validation * clean the code * fix lint errors * use v1.7.0 for creation * add v1.6.0 data * fix lint errors * format cleaning
- Loading branch information
1 parent
0f1252f
commit 9905321
Showing
20 changed files
with
1,916 additions
and
1,104 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 was deleted.
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
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,7 +1,56 @@ | ||
import { DefinitionFlow } from './constants' | ||
import { type ClusterDefintion } from './types' | ||
|
||
export const hexWithout0x = (hex: string): string => { | ||
return hex.slice(2, hex.length) | ||
} | ||
|
||
export const strToUint8Array = (str: string): Uint8Array => { | ||
return new TextEncoder().encode(str) | ||
} | ||
|
||
export const definitionFlow = ( | ||
clusterDefinition: ClusterDefintion, | ||
): DefinitionFlow | null => { | ||
if ( | ||
clusterDefinition.creator.address && | ||
clusterDefinition.creator.config_signature && | ||
clusterDefinition.operators.every((operator) => { | ||
return ( | ||
operator.address && | ||
operator.config_signature && | ||
operator.enr && | ||
operator.enr_signature | ||
) | ||
}) | ||
) { | ||
return DefinitionFlow.Group | ||
} else if ( | ||
clusterDefinition.creator.address && | ||
clusterDefinition.creator.config_signature && | ||
clusterDefinition.operators.every((operator) => { | ||
return ( | ||
!operator.address && | ||
!operator.config_signature && | ||
operator.enr && | ||
!operator.enr_signature | ||
) | ||
}) | ||
) { | ||
return DefinitionFlow.Solo | ||
} else if ( | ||
!clusterDefinition.creator.address && | ||
!clusterDefinition.creator.config_signature && | ||
clusterDefinition.operators.every((operator) => { | ||
return ( | ||
!operator.address && | ||
!operator.config_signature && | ||
operator.enr && | ||
!operator.enr_signature | ||
) | ||
}) | ||
) { | ||
return DefinitionFlow.Charon | ||
} | ||
return null | ||
} |
Oops, something went wrong.