Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add GetWalletStateInitAndSalt to abi" #298

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions abi/get_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error)
"get_wallet_address": {DecodeGetWalletAddressResult},
"get_wallet_data": {DecodeGetWalletDataResult},
"get_wallet_params": {DecodeGetWalletParamsResult},
"get_wallet_state_init_and_salt": {DecodeGetWalletStateInitAndSaltResult},
"is_active": {DecodeIsActiveResult},
"is_claimed": {DecodeIsClaimedResult},
"is_plugin_installed": {DecodeIsPluginInstalledResult},
Expand Down Expand Up @@ -293,7 +292,6 @@ var resultTypes = []interface{}{
&GetWalletAddressResult{},
&GetWalletDataResult{},
&GetWalletParamsResult{},
&GetWalletStateInitAndSaltResult{},
&IsActiveResult{},
&IsClaimedResult{},
&IsPluginInstalledResult{},
Expand Down Expand Up @@ -3791,49 +3789,6 @@ func DecodeGetWalletParamsResult(stack tlb.VmStack) (resultType string, resultAn
return "GetWalletParamsResult", result, err
}

type GetWalletStateInitAndSaltResult struct {
StateInit tlb.Any
Salt int64
}

func GetWalletStateInitAndSalt(ctx context.Context, executor Executor, reqAccountID ton.AccountID, ownerAddress tlb.MsgAddress) (string, any, error) {
stack := tlb.VmStack{}
var (
val tlb.VmStackValue
err error
)
val, err = tlb.TlbStructToVmCellSlice(ownerAddress)
if err != nil {
return "", nil, err
}
stack.Put(val)

// MethodID = 69258 for "get_wallet_state_init_and_salt" method
errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 69258, stack)
if err != nil {
return "", nil, err
}
if errCode != 0 && errCode != 1 {
return "", nil, fmt.Errorf("method execution failed with code: %v", errCode)
}
for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetWalletStateInitAndSaltResult} {
s, r, err := f(stack)
if err == nil {
return s, r, nil
}
}
return "", nil, fmt.Errorf("can not decode outputs")
}

func DecodeGetWalletStateInitAndSaltResult(stack tlb.VmStack) (resultType string, resultAny any, err error) {
if len(stack) != 2 || (stack[0].SumType != "VmStkCell") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") {
return "", nil, fmt.Errorf("invalid stack format")
}
var result GetWalletStateInitAndSaltResult
err = stack.Unmarshal(&result)
return "GetWalletStateInitAndSaltResult", result, err
}

type IsActiveResult struct {
IsActive bool
}
Expand Down
10 changes: 0 additions & 10 deletions abi/schemas/jettons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@
</output>
</get_method>

<get_method name="get_wallet_state_init_and_salt">
<input>
<slice name="owner_address">msgaddress</slice>
</input>
<output name="mintless" fixed_length="true">
<cell name="state_init">any</cell>
<int name="salt">int64</int>
</output>
</get_method>

<!-- Jettons -->
<internal name="jetton_transfer" >
transfer#0f8a7ea5 query_id:uint64 amount:(VarUInteger 16) destination:MsgAddress
Expand Down
Loading