Skip to content

Commit

Permalink
Cleanup free storage update allocation (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayashsatolia403 authored Dec 13, 2023
1 parent 6319ab3 commit fa71ad5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 60 deletions.
7 changes: 0 additions & 7 deletions internal/api/model/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,6 @@ func NewUnlockMinerStackPoolTransactionData(createStakePoolRequest CreateStakePo
}
}

func NewFreeAllocationTransactionData(freeAllocationRequest *FreeAllocationRequest) TransactionData {
return TransactionData{
Name: "free_update_allocation",
Input: freeAllocationRequest,
}
}

func NewFreeStorageAssignerTransactionData(freeStorageAssignerRequest *FreeStorageAssignerRequest) TransactionData {
return TransactionData{
Name: "add_free_storage_assigner",
Expand Down
52 changes: 0 additions & 52 deletions internal/api/util/client/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1275,58 +1275,6 @@ func (c *APIClient) AddFreeStorageAssigner(
wallet.IncNonce()
}

func (c *APIClient) MakeAllocationFree(
t *test.SystemTest,
wallet *model.Wallet,
allocationID, marker string,
requiredTransactionStatus int) {
t.Log("Update allocation...")
freeAllocationTransactionPutResponse, resp, err := c.V1TransactionPut(
t,
model.InternalTransactionPutRequest{
Wallet: wallet,
ToClientID: StorageSmartContractAddress,
TransactionData: model.NewFreeAllocationTransactionData(&model.FreeAllocationRequest{

AllocationID: allocationID,
Marker: marker,
}),
Value: tokenomics.IntToZCN(0.1),
TxnType: SCTxType,
},
HttpOkStatus)
require.Nil(t, err)
require.NotNil(t, resp)
require.NotNil(t, freeAllocationTransactionPutResponse)
txnHash := freeAllocationTransactionPutResponse.Request.Hash

var freeAllocationTransactionGetConfirmationResponse *model.TransactionGetConfirmationResponse

wait.PoolImmediately(t, time.Minute*2, func() bool {
freeAllocationTransactionGetConfirmationResponse, resp, err = c.V1TransactionGetConfirmation(
t,
model.TransactionGetConfirmationRequest{
Hash: txnHash,
},
HttpOkStatus)
if err != nil {
return false
}

if resp == nil {
return false
}

if freeAllocationTransactionGetConfirmationResponse == nil {
return false
}

return freeAllocationTransactionGetConfirmationResponse.Status == requiredTransactionStatus
})

wallet.IncNonce()
}

func (c *APIClient) UpdateAllocationBlobbers(t *test.SystemTest, wallet *model.Wallet, newBlobberID, oldBlobberID, allocationID string, requiredTransactionStatus int) {
t.Log("Update allocation...")

Expand Down
1 change: 0 additions & 1 deletion internal/cli/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,6 @@ var StorageIntSettings = []string{
"cost.cancel_allocation",
"cost.add_free_storage_assigner",
"cost.free_allocation_request",
"cost.free_update_allocation",
"cost.blobber_health_check",
"cost.update_blobber_settings",
"cost.pay_blobber_block_rewards",
Expand Down

0 comments on commit fa71ad5

Please sign in to comment.