Skip to content

Commit 7710bc6

Browse files
committed
Rename getAllTransitions to getSigners
1 parent f438d7b commit 7710bc6

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

consensus/system_contract/system_contract.go

+8-11
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,15 @@ func New(ctx context.Context, config *params.SystemContractConfig, client sync_s
5555
return systemContract
5656
}
5757

58-
// Hardcoded ABI snippet for getAllTransitions():
58+
// Hardcoded ABI snippet for getSigners():
5959
//
60-
// function getAllTransitions() external view returns (uint64[] memory, address[] memory);
61-
//
62-
// We only need what's necessary to encode/decode "getAllTransitions".
63-
const getAllTransitionsABI = `[
60+
// function getSigners() external view returns (uint64[] memory, address[] memory);
61+
const getSignersABI = `[
6462
{
6563
"inputs": [],
66-
"name": "getAllTransitions",
64+
"name": "getSigners",
6765
"outputs": [
68-
{"internalType": "uint64[]", "type": "uint64[]"},
69-
{"internalType": "address[]","type": "address[]"}
66+
{ "internalType": "address[]", "type": "address[]" }
7067
],
7168
"stateMutability": "view",
7269
"type": "function"
@@ -77,13 +74,13 @@ const getAllTransitionsABI = `[
7774
// and returns them as a slice of [StartBlock, Signer].
7875
func (s *SystemContract) fetchAllSigners(blockNum *big.Int) ([]SignerAddressL1, error) {
7976
// Parse the ABI so we can encode and decode calls
80-
parsedABI, err := abi.JSON(strings.NewReader(getAllTransitionsABI))
77+
parsedABI, err := abi.JSON(strings.NewReader(getSignersABI))
8178
if err != nil {
8279
return nil, fmt.Errorf("parse ABI error: %w", err)
8380
}
8481

8582
// Pack the function call data
86-
packed, err := parsedABI.Pack("getAllTransitions")
83+
packed, err := parsedABI.Pack("getSigners")
8784
if err != nil {
8885
return nil, fmt.Errorf("ABI pack error: %w", err)
8986
}
@@ -104,7 +101,7 @@ func (s *SystemContract) fetchAllSigners(blockNum *big.Int) ([]SignerAddressL1,
104101
Blocks []*big.Int
105102
Signers []common.Address
106103
}
107-
err = parsedABI.UnpackIntoInterface(&ret, "getAllTransitions", output)
104+
err = parsedABI.UnpackIntoInterface(&ret, "getSigners", output)
108105
if err != nil {
109106
return nil, fmt.Errorf("unpack error: %w", err)
110107
}

0 commit comments

Comments
 (0)