Skip to content

Commit

Permalink
fix: db exist check
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 18, 2024
1 parent 9edf8bd commit c923767
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
22 changes: 2 additions & 20 deletions contracts/script/SetUpEigenDA.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,10 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils {

uint256 clientPrivateKey = 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcded;

_allocate(
IERC20(address(0)),
// Inline array creation for clients
toArray(vm.addr(clientPrivateKey)),
// Inline array creation for amounts
toArray(5 ether)
);


vm.startBroadcast();
_allocate(
IERC20(address(0)),
// Inline array creation for clients
toArray(vm.addr(clientPrivateKey)),
// Inline array creation for amounts
toArray(5 ether)
);

Expand Down Expand Up @@ -192,28 +181,21 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils {
}


// Register Reservations for client 0 and 1 as the eigenDACommunityMultisig
// Register Reservations for client as the eigenDACommunityMultisig
IPaymentVault.Reservation memory reservation = IPaymentVault.Reservation({
symbolsPerSecond: 452198,
startTimestamp: uint64(block.timestamp),
endTimestamp: uint64(block.timestamp + 1000000000),
quorumNumbers: hex"0001",
quorumSplits: hex"3232"
});
// address reservedClient = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKey)))));
address reservedClient = address(0x641691973c98dFe68b07Ee3613E270406285DFE8);
// vm.prank(msg.sender);
vm.broadcast(msg.sender);
paymentVault.setReservation(reservedClient, reservation);

// vm.broadcast(clientPrivateKey);
// address reservedClient1 = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKey)))));
// paymentVault.setReservation(reservedClient1, reservation);

// Deposit OnDemand for client 0 and 2
// Deposit OnDemand
vm.broadcast(clientPrivateKey);
address ondemandClient = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKey)))));
// vm.prank(ondemandClient);
paymentVault.depositOnDemand{value: 0.1 ether}(ondemandClient);

// Deposit stakers into EigenLayer and delegate to operators
Expand Down
4 changes: 2 additions & 2 deletions core/meterer/offchain_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ func NewOffchainStore(
if err != nil {
return OffchainStore{}, err
}
err = CreateOnDemandTable(cfg, onDemandTableName)
err = dynamoClient.TableExists(context.Background(), onDemandTableName)
if err != nil {
return OffchainStore{}, err
}
err = CreateGlobalReservationTable(cfg, globalBinTableName)
err = dynamoClient.TableExists(context.Background(), globalBinTableName)
if err != nil {
return OffchainStore{}, err
}
Expand Down

0 comments on commit c923767

Please sign in to comment.