Skip to content

Commit

Permalink
fix: fixed unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <[email protected]>
  • Loading branch information
quiet-node committed Dec 12, 2023
1 parent 06e7970 commit 827d7a6
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,41 @@
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "InvalidInitialization",
"type": "error"
},
{
"inputs": [],
"name": "NotInitializing",
"type": "error"
},
{
"inputs": [],
"name": "Voter_Has_Already_Voted",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint64",
"name": "version",
"type": "uint64"
}
],
"name": "Initialized",
"type": "event"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
Expand Down Expand Up @@ -66,8 +96,8 @@
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506001600055610273806100256000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063350580ea1461005157806354fd4d501461006f578063632a9a5214610080578063aec2ccae1461008a575b600080fd5b6100596100c6565b60405161006691906101c0565b60405180910390f35b600054604051908152602001610066565b610088610128565b005b6100b661009836600461020d565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610066565b6060600180548060200260200160405190810160405280929190818152602001828054801561011e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610100575b5050505050905090565b3360008181526002602052604090205460ff161561015957604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916339081179091556000908152600260205260409020805460ff19169091179055565b6020808252825182820181905260009190848201906040850190845b818110156102015783516001600160a01b0316835292840192918401916001016101dc565b50909695505050505050565b60006020828403121561021f57600080fd5b81356001600160a01b038116811461023657600080fd5b939250505056fea2646970667358221220f6556c6dad22db499a7dba3e6368615ec9614b8fe420a0af27407d67738a632c64736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063350580ea1461005157806354fd4d501461006f578063632a9a5214610080578063aec2ccae1461008a575b600080fd5b6100596100c6565b60405161006691906101c0565b60405180910390f35b600054604051908152602001610066565b610088610128565b005b6100b661009836600461020d565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610066565b6060600180548060200260200160405190810160405280929190818152602001828054801561011e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610100575b5050505050905090565b3360008181526002602052604090205460ff161561015957604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916339081179091556000908152600260205260409020805460ff19169091179055565b6020808252825182820181905260009190848201906040850190845b818110156102015783516001600160a01b0316835292840192918401916001016101dc565b50909695505050505050565b60006020828403121561021f57600080fd5b81356001600160a01b038116811461023657600080fd5b939250505056fea2646970667358221220f6556c6dad22db499a7dba3e6368615ec9614b8fe420a0af27407d67738a632c64736f6c63430008140033",
"bytecode": "0x608060405234801561001057600080fd5b5060016000556103a5806100256000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063350580ea1461005c57806354fd4d501461007a578063632a9a521461008b5780638129fc1c14610095578063aec2ccae1461009d575b600080fd5b6100646100d9565b60405161007191906102f2565b60405180910390f35b600054604051908152602001610071565b61009361013b565b005b6100936101d3565b6100c96100ab36600461033f565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610071565b6060600180548060200260200160405190810160405280929190818152602001828054801561013157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610113575b5050505050905090565b3360008181526002602052604090205460ff161561016c57604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916339081179091556000908152600260205260409020805460ff19169091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801561021e5750825b905060008267ffffffffffffffff16600114801561023b5750303b155b905081158015610249575080155b156102675760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561029b57845468ff00000000000000001916680100000000000000001785555b600160005583156102eb57845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6020808252825182820181905260009190848201906040850190845b818110156103335783516001600160a01b03168352928401929184019160010161030e565b50909695505050505050565b60006020828403121561035157600080fd5b81356001600160a01b038116811461036857600080fd5b939250505056fea26469706673582212205146ed303b9ede0c0d8554ecaa9f3f408bf1f0ec621c8c59edc7f2847f9bbc6364736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063350580ea1461005c57806354fd4d501461007a578063632a9a521461008b5780638129fc1c14610095578063aec2ccae1461009d575b600080fd5b6100646100d9565b60405161007191906102f2565b60405180910390f35b600054604051908152602001610071565b61009361013b565b005b6100936101d3565b6100c96100ab36600461033f565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610071565b6060600180548060200260200160405190810160405280929190818152602001828054801561013157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610113575b5050505050905090565b3360008181526002602052604090205460ff161561016c57604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916339081179091556000908152600260205260409020805460ff19169091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801561021e5750825b905060008267ffffffffffffffff16600114801561023b5750303b155b905081158015610249575080155b156102675760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561029b57845468ff00000000000000001916680100000000000000001785555b600160005583156102eb57845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b6020808252825182820181905260009190848201906040850190845b818110156103335783516001600160a01b03168352928401929184019160010161030e565b50909695505050505050565b60006020828403121561035157600080fd5b81356001600160a01b038116811461036857600080fd5b939250505056fea26469706673582212205146ed303b9ede0c0d8554ecaa9f3f408bf1f0ec621c8c59edc7f2847f9bbc6364736f6c63430008140033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "InvalidInitialization",
"type": "error"
},
{
"inputs": [],
"name": "NotInitializing",
"type": "error"
},
{
"inputs": [],
"name": "Voter_Has_Already_Voted",
Expand All @@ -18,6 +28,33 @@
"name": "Voter_Has_Not_Voted",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint64",
"name": "version",
"type": "uint64"
}
],
"name": "Initialized",
"type": "event"
},
{
"inputs": [],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "initializeV2",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
Expand Down Expand Up @@ -78,8 +115,8 @@
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506002600055610474806100256000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063350580ea1461005c57806354fd4d501461007a578063632a9a521461008b578063aec2ccae14610095578063d83eb231146100d1575b600080fd5b6100646100d9565b604051610071919061033a565b60405180910390f35b600054604051908152602001610071565b61009361013b565b005b6100c16100a3366004610387565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610071565b6100936101c6565b6060600180548060200260200160405190810160405280929190818152602001828054801561013157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610113575b5050505050905090565b3360008181526002602052604090205460ff161561016c57604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b031916339081179091556000908152600260205260409020805460ff19169091179055565b3360008181526002602052604090205460ff166101f657604051630919808b60e01b815260040160405180910390fd5b60005b6001548110156102ec57336001600160a01b031660018281548110610220576102206103b7565b6000918252602090912001546001600160a01b0316036102da57805b6001805461024a91906103e3565b8110156102d457600161025d82826103fc565b8154811061026d5761026d6103b7565b600091825260209091200154600180546001600160a01b039092169183908110610299576102996103b7565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055806102cc8161040f565b91505061023c565b506102ec565b806102e48161040f565b9150506101f9565b50336000908152600260205260409020805460ff19169055600180548061031557610315610428565b600082815260209020810160001990810180546001600160a01b031916905501905550565b6020808252825182820181905260009190848201906040850190845b8181101561037b5783516001600160a01b031683529284019291840191600101610356565b50909695505050505050565b60006020828403121561039957600080fd5b81356001600160a01b03811681146103b057600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156103f6576103f66103cd565b92915050565b808201808211156103f6576103f66103cd565b600060018201610421576104216103cd565b5060010190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220d03626254e31edb4a34bdd3043f89c264e2515a2bf73b44a18be8a42725f7e1d64736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063350580ea1461005c57806354fd4d501461007a578063632a9a521461008b578063aec2ccae14610095578063d83eb231146100d1575b600080fd5b6100646100d9565b604051610071919061033a565b60405180910390f35b600054604051908152602001610071565b61009361013b565b005b6100c16100a3366004610387565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610071565b6100936101c6565b6060600180548060200260200160405190810160405280929190818152602001828054801561013157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610113575b5050505050905090565b3360008181526002602052604090205460ff161561016c57604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b031916339081179091556000908152600260205260409020805460ff19169091179055565b3360008181526002602052604090205460ff166101f657604051630919808b60e01b815260040160405180910390fd5b60005b6001548110156102ec57336001600160a01b031660018281548110610220576102206103b7565b6000918252602090912001546001600160a01b0316036102da57805b6001805461024a91906103e3565b8110156102d457600161025d82826103fc565b8154811061026d5761026d6103b7565b600091825260209091200154600180546001600160a01b039092169183908110610299576102996103b7565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055806102cc8161040f565b91505061023c565b506102ec565b806102e48161040f565b9150506101f9565b50336000908152600260205260409020805460ff19169055600180548061031557610315610428565b600082815260209020810160001990810180546001600160a01b031916905501905550565b6020808252825182820181905260009190848201906040850190845b8181101561037b5783516001600160a01b031683529284019291840191600101610356565b50909695505050505050565b60006020828403121561039957600080fd5b81356001600160a01b03811681146103b057600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156103f6576103f66103cd565b92915050565b808201808211156103f6576103f66103cd565b600060018201610421576104216103cd565b5060010190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220d03626254e31edb4a34bdd3043f89c264e2515a2bf73b44a18be8a42725f7e1d64736f6c63430008140033",
"bytecode": "0x608060405234801561001057600080fd5b506002600055610697806100256000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063632a9a521161005b578063632a9a52146100bb5780638129fc1c146100c3578063aec2ccae146100cb578063d83eb2311461010757600080fd5b8063350580ea1461008257806354fd4d50146100a05780635cd8a76b146100b1575b600080fd5b61008a61010f565b604051610097919061055d565b60405180910390f35b600054604051908152602001610097565b6100b9610171565b005b6100b9610249565b6100b96102d4565b6100f76100d93660046105aa565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610097565b6100b96103e9565b6060600180548060200260200160405190810160405280929190818152602001828054801561016757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610149575b5050505050905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460029190600160401b900460ff16806101bb5750805467ffffffffffffffff808416911610155b156101d95760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b1782556002600055815468ff0000000000000000191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050565b3360008181526002602052604090205460ff161561027a57604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b031916339081179091556000908152600260205260409020805460ff19169091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff1660008115801561031a5750825b905060008267ffffffffffffffff1660011480156103375750303b155b905081158015610345575080155b156103635760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561039257845468ff00000000000000001916600160401b1785555b600160005583156103e257845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b3360008181526002602052604090205460ff1661041957604051630919808b60e01b815260040160405180910390fd5b60005b60015481101561050f57336001600160a01b031660018281548110610443576104436105da565b6000918252602090912001546001600160a01b0316036104fd57805b6001805461046d9190610606565b8110156104f7576001610480828261061f565b81548110610490576104906105da565b600091825260209091200154600180546001600160a01b0390921691839081106104bc576104bc6105da565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055806104ef81610632565b91505061045f565b5061050f565b8061050781610632565b91505061041c565b50336000908152600260205260409020805460ff1916905560018054806105385761053861064b565b600082815260209020810160001990810180546001600160a01b031916905501905550565b6020808252825182820181905260009190848201906040850190845b8181101561059e5783516001600160a01b031683529284019291840191600101610579565b50909695505050505050565b6000602082840312156105bc57600080fd5b81356001600160a01b03811681146105d357600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610619576106196105f0565b92915050565b80820180821115610619576106196105f0565b600060018201610644576106446105f0565b5060010190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220630d3e90f82dfc720dfcd547ec09d18171bd728b0d65ce0d415f17af7aee6ebf64736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063632a9a521161005b578063632a9a52146100bb5780638129fc1c146100c3578063aec2ccae146100cb578063d83eb2311461010757600080fd5b8063350580ea1461008257806354fd4d50146100a05780635cd8a76b146100b1575b600080fd5b61008a61010f565b604051610097919061055d565b60405180910390f35b600054604051908152602001610097565b6100b9610171565b005b6100b9610249565b6100b96102d4565b6100f76100d93660046105aa565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610097565b6100b96103e9565b6060600180548060200260200160405190810160405280929190818152602001828054801561016757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610149575b5050505050905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460029190600160401b900460ff16806101bb5750805467ffffffffffffffff808416911610155b156101d95760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b1782556002600055815468ff0000000000000000191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050565b3360008181526002602052604090205460ff161561027a57604051633b1dbd5760e11b815260040160405180910390fd5b506001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b031916339081179091556000908152600260205260409020805460ff19169091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff1660008115801561031a5750825b905060008267ffffffffffffffff1660011480156103375750303b155b905081158015610345575080155b156103635760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561039257845468ff00000000000000001916600160401b1785555b600160005583156103e257845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b3360008181526002602052604090205460ff1661041957604051630919808b60e01b815260040160405180910390fd5b60005b60015481101561050f57336001600160a01b031660018281548110610443576104436105da565b6000918252602090912001546001600160a01b0316036104fd57805b6001805461046d9190610606565b8110156104f7576001610480828261061f565b81548110610490576104906105da565b600091825260209091200154600180546001600160a01b0390921691839081106104bc576104bc6105da565b600091825260209091200180546001600160a01b0319166001600160a01b0392909216919091179055806104ef81610632565b91505061045f565b5061050f565b8061050781610632565b91505061041c565b50336000908152600260205260409020805460ff1916905560018054806105385761053861064b565b600082815260209020810160001990810180546001600160a01b031916905501905550565b6020808252825182820181905260009190848201906040850190845b8181101561059e5783516001600160a01b031683529284019291840191600101610579565b50909695505050505050565b6000602082840312156105bc57600080fd5b81356001600160a01b03811681146105d357600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610619576106196105f0565b92915050565b80820180821115610619576106196105f0565b600060018201610644576106446105f0565b5060010190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220630d3e90f82dfc720dfcd547ec09d18171bd728b0d65ce0d415f17af7aee6ebf64736f6c63430008140033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Loading

0 comments on commit 827d7a6

Please sign in to comment.