@@ -6,70 +6,70 @@ import {CrossStore} from "./CrossStore.sol";
66import {Account, TxAuthState} from "../proto/cross/core/auth/Auth.sol " ;
77
88abstract contract TxAuthManager is TxAuthManagerBase , CrossStore {
9- function initAuthState (bytes32 txId , Account.Data[] memory signers ) internal virtual override {
9+ function initAuthState (bytes32 txID , Account.Data[] memory signers ) internal virtual override {
1010 CrossStore.AuthStorage storage s = _getAuthStorage ();
11- if (s.authInitialized[txId ]) revert AuthStateAlreadyInitialized (txId );
12- _setStateFromRemainingList (s, txId , signers);
13- s.authInitialized[txId ] = true ;
11+ if (s.authInitialized[txID ]) revert AuthStateAlreadyInitialized (txID );
12+ _setStateFromRemainingList (s, txID , signers);
13+ s.authInitialized[txID ] = true ;
1414 }
1515
16- function isCompletedAuth (bytes32 txId ) internal view virtual override returns (bool ) {
16+ function isCompletedAuth (bytes32 txID ) internal view virtual override returns (bool ) {
1717 CrossStore.AuthStorage storage s = _getAuthStorage ();
18- if (! s.authInitialized[txId ]) revert IdNotFound (txId );
19- return s.remainingCount[txId ] == 0 ;
18+ if (! s.authInitialized[txID ]) revert IDNotFound (txID );
19+ return s.remainingCount[txID ] == 0 ;
2020 }
2121
22- function sign (bytes32 txId , Account.Data[] memory signers ) internal virtual override returns (bool ) {
22+ function sign (bytes32 txID , Account.Data[] memory signers ) internal virtual override returns (bool ) {
2323 CrossStore.AuthStorage storage s = _getAuthStorage ();
24- if (! s.authInitialized[txId ]) revert IdNotFound (txId );
25- if (s.remainingCount[txId ] == 0 ) revert AuthAlreadyCompleted (txId );
24+ if (! s.authInitialized[txID ]) revert IDNotFound (txID );
25+ if (s.remainingCount[txID ] == 0 ) revert AuthAlreadyCompleted (txID );
2626
2727 for (uint256 i = 0 ; i < signers.length ; ++ i) {
2828 bytes32 key = _accountKey (signers[i]);
29- if (s.remaining[txId ][key]) {
30- s.remaining[txId ][key] = false ;
31- -- s.remainingCount[txId ];
32- if (s.remainingCount[txId ] == 0 ) return true ;
29+ if (s.remaining[txID ][key]) {
30+ s.remaining[txID ][key] = false ;
31+ -- s.remainingCount[txID ];
32+ if (s.remainingCount[txID ] == 0 ) return true ;
3333 }
3434 }
35- return s.remainingCount[txId ] == 0 ;
35+ return s.remainingCount[txID ] == 0 ;
3636 }
3737
38- function getAuthState (bytes32 txId ) internal view virtual override returns (TxAuthState.Data memory ) {
38+ function getAuthState (bytes32 txID ) internal view virtual override returns (TxAuthState.Data memory ) {
3939 CrossStore.AuthStorage storage s = _getAuthStorage ();
40- if (! s.authInitialized[txId ]) revert IdNotFound (txId );
41- Account.Data[] memory remains = _getRemainingSigners (s, txId );
40+ if (! s.authInitialized[txID ]) revert IDNotFound (txID );
41+ Account.Data[] memory remains = _getRemainingSigners (s, txID );
4242 return TxAuthState.Data ({remaining_signers: remains});
4343 }
4444
45- function _getRemainingSigners (CrossStore.AuthStorage storage s , bytes32 txId )
45+ function _getRemainingSigners (CrossStore.AuthStorage storage s , bytes32 txID )
4646 internal
4747 view
4848 returns (Account.Data[] memory out )
4949 {
50- uint256 total = s.requiredAccounts[txId ].length ;
51- uint256 need = s.remainingCount[txId ];
50+ uint256 total = s.requiredAccounts[txID ].length ;
51+ uint256 need = s.remainingCount[txID ];
5252 out = new Account.Data [](need);
5353 uint256 p = 0 ;
5454 for (uint256 i = 0 ; i < total; ++ i) {
55- Account.Data memory acc = s.requiredAccounts[txId ][i];
56- if (s.remaining[txId ][_accountKey (acc)]) {
55+ Account.Data memory acc = s.requiredAccounts[txID ][i];
56+ if (s.remaining[txID ][_accountKey (acc)]) {
5757 out[p] = acc;
5858 ++ p;
5959 if (p == need) break ;
6060 }
6161 }
6262 }
6363
64- function _setStateFromRemainingList (CrossStore.AuthStorage storage s , bytes32 txId , Account.Data[] memory list )
64+ function _setStateFromRemainingList (CrossStore.AuthStorage storage s , bytes32 txID , Account.Data[] memory list )
6565 internal
6666 {
6767 for (uint256 i = 0 ; i < list.length ; ++ i) {
6868 bytes32 key = _accountKey (list[i]);
69- if (! s.remaining[txId ][key]) {
70- s.remaining[txId ][key] = true ;
71- ++ s.remainingCount[txId ];
72- s.requiredAccounts[txId ].push (list[i]);
69+ if (! s.remaining[txID ][key]) {
70+ s.remaining[txID ][key] = true ;
71+ ++ s.remainingCount[txID ];
72+ s.requiredAccounts[txID ].push (list[i]);
7373 }
7474 }
7575 }
0 commit comments