Skip to content

Commit

Permalink
another fix for tonstakers
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tron committed Jan 29, 2024
1 parent 057dc44 commit 92c5983
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions abi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,12 @@ func TestMessageDecoder(t *testing.T) {
MinLoan: 300000000000000,
MaxLoan: 1035000000000000,
MaxInterest: 5033,
ControllerData: TonstakersControllerData{
ControllerId: 1,
Validator: mustAccountIDToMsgAddress("-1:d757dae0502e1e56fc1e0db5fc95c6278d0f6b6642e5834b36db12d1f2a4bd1a"),
Pool: mustToMsgAddress("0:a45b17f28409229b78360e3290420f13e4fe20f90d7e2bf8c4ac6703259e22fa"),
Governor: mustToMsgAddress("0:8926460471725404b334847b35e4dce1fe117ed048be3cc627c57f8afd28c44c"),
},
},
},
{
Expand Down
11 changes: 6 additions & 5 deletions abi/messages_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ type TonstakeControllerSendRequestLoanMsgBody struct {
QueryId uint64
MinLoan tlb.Grams
MaxLoan tlb.Grams
MaxInterst uint16
MaxInterst tlb.Uint24
}

type WalletPluginDestructMsgBody struct{}
Expand Down Expand Up @@ -1491,10 +1491,11 @@ type DeployStorageContractMsgBody struct {
}

type TonstakePoolRequestLoanMsgBody struct {
QueryId uint64
MinLoan tlb.Grams
MaxLoan tlb.Grams
MaxInterest tlb.Uint24
QueryId uint64
MinLoan tlb.Grams
MaxLoan tlb.Grams
MaxInterest tlb.Uint24
ControllerData TonstakersControllerData `tlb:"^"`
}

type TonstakeControllerDisapproveMsgBody struct {
Expand Down
8 changes: 6 additions & 2 deletions abi/schemas/liquid_stacking.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<abi>
<types>
<!-- should be also ^[approver:MsgAddress halter:MsgAddress] in the end but generator doesn't make it ref -->
data#_ controller_id:uint32 validator:MsgAddress pool:MsgAddress governor:MsgAddress = TonstakersControllerData;
</types>
<!-- Pool todo: attach all internals to interfaces -->
<interface name="tonstake_pool">
<get_method name="get_pool_full_data"/>
Expand Down Expand Up @@ -110,7 +114,7 @@
adnl_addr:uint256 signature:^(bits512) = InternalMsgBody;
</internal>
<internal name="tonstake_controller_send_request_loan">
send_request_loan#6335b11a query_id:uint64 min_loan:Coins max_loan:Coins max_interst:uint16 = InternalMsgBody;
send_request_loan#6335b11a query_id:uint64 min_loan:Coins max_loan:Coins max_interst:uint24 = InternalMsgBody;
</internal>
<internal name="tonstake_controller_return_unused_loan">
return_unused_loan#ed7378a6 query_id:uint64 = InternalMsgBody;
Expand All @@ -121,7 +125,7 @@

<!-- TonStake messages to pool -->
<internal name="tonstake_pool_request_loan">
request_loan#e642c965 query_id:uint64 min_loan:Coins max_loan:Coins max_interest:uint24 = InternalMsgBody;
request_loan#e642c965 query_id:uint64 min_loan:Coins max_loan:Coins max_interest:uint24 controller_data:^TonstakersControllerData= InternalMsgBody;
</internal>
<internal name="tonstake_pool_loan_repayment">
loan_repayment#dfdca27b query_id:uint64 = InternalMsgBody;
Expand Down
8 changes: 8 additions & 0 deletions abi/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package abi
import (
"encoding/json"
"fmt"

"github.com/tonkeeper/tongo/tlb"
)

Expand Down Expand Up @@ -64,6 +65,13 @@ type DedustSwapStepParams struct {
Next *DedustSwapStep `tlb:"maybe^"`
}

type TonstakersControllerData struct {
ControllerId uint32
Validator tlb.MsgAddress
Pool tlb.MsgAddress
Governor tlb.MsgAddress
}

type ClosingConfig struct {
QuarantinDuration uint32
MisbehaviorFine tlb.Grams
Expand Down

0 comments on commit 92c5983

Please sign in to comment.