Skip to content

Commit

Permalink
Merge pull request #308 from tonkeeper/pool-fix
Browse files Browse the repository at this point in the history
null fix
  • Loading branch information
mr-tron authored Oct 9, 2024
2 parents 1eecac6 + b7da5a0 commit ebf73ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions abi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func TestGetMethods(t *testing.T) {
MaxNominatorsCount: 0x1,
MinValidatorStake: 1001000000000,
MinNominatorStake: 300000000000000,
Nominators: tlb.Any(*boc.NewCell()),
Nominators: pointer(tlb.Any(*boc.NewCell())),
WithdrawRequests: nil,
StakeAt: 0x64104f08,
SavedValidatorSetHash: tlb.Bits256{0xe2, 0x70, 0x3, 0xa2, 0xcb, 0x1a, 0xa9, 0xad, 0xd7, 0xe4, 0xc, 0xe, 0x5, 0x2e, 0x37, 0xb6, 0x61, 0xb, 0x18, 0xfc, 0xf5, 0x77, 0x8b, 0x87, 0x26, 0x28, 0x45, 0x28, 0x54, 0xbb, 0x34, 0x6c},
Expand Down Expand Up @@ -644,7 +644,7 @@ func TestGetMethods(t *testing.T) {
case GetPoolData_TfResult:
// comparing two cells don't work well with reflect.DeepEqual()
// because of the internal fields like refCursor
x.Nominators = tlb.Any(*boc.NewCell())
x.Nominators = pointer(tlb.Any(*boc.NewCell()))
got = x
case GetAssets_DedustResult:
addr := ton.AccountID{
Expand Down
4 changes: 2 additions & 2 deletions abi/get_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -2361,7 +2361,7 @@ type GetPoolData_TfResult struct {
MaxNominatorsCount uint32
MinValidatorStake int64
MinNominatorStake int64
Nominators tlb.Any
Nominators *tlb.Any
WithdrawRequests *AccountLists
StakeAt uint32
SavedValidatorSetHash tlb.Bits256
Expand Down Expand Up @@ -2411,7 +2411,7 @@ func DecodeGetPoolData_StonfiV2Result(stack tlb.VmStack) (resultType string, res
}

func DecodeGetPoolData_TfResult(stack tlb.VmStack) (resultType string, resultAny any, err error) {
if len(stack) < 17 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkCell") || (stack[10].SumType != "VmStkCell" && stack[10].SumType != "VmStkNull") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTuple" && stack[16].SumType != "VmStkNull") {
if len(stack) < 17 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkCell" && stack[9].SumType != "VmStkNull") || (stack[10].SumType != "VmStkCell" && stack[10].SumType != "VmStkNull") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTuple" && stack[16].SumType != "VmStkNull") {
return "", nil, fmt.Errorf("invalid stack format")
}
var result GetPoolData_TfResult
Expand Down
2 changes: 1 addition & 1 deletion abi/schemas/tonvalidators.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<int name="max_nominators_count">uint32</int>
<int name="min_validator_stake">int64</int>
<int name="min_nominator_stake">int64</int>
<cell name="nominators">any</cell>
<cell name="nominators" nullable="true">any</cell>
<cell name="withdraw_requests" nullable="true">AccountLists</cell>
<int name="stake_at">uint32</int>
<int name="saved_validator_set_hash">bits256</int>
Expand Down

0 comments on commit ebf73ad

Please sign in to comment.