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

create executor by tvm #126

Merged
merged 2 commits into from
Jul 3, 2023
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
2 changes: 2 additions & 0 deletions pkg/api/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ type storage interface {
GetWalletPubKey(ctx context.Context, address tongo.AccountID) (ed25519.PublicKey, error)
GetSubscriptions(ctx context.Context, address tongo.AccountID) ([]core.Subscription, error)
GetJettonMasters(ctx context.Context, limit, offset int) ([]core.JettonMaster, error)

GetLastConfig() ([]byte, error)
}

// chainState provides current blockchain state which change very rarely or slow like staking APY income
Expand Down
24 changes: 24 additions & 0 deletions pkg/litestorage/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package litestorage

import (
"context"

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

func (c *LiteStorage) GetLastConfig() ([]byte, error) {
conf, err := c.client.GetConfigAll(context.Background(), 0)
if err != nil {
return nil, err
}
cell := boc.NewCell()
if err := tlb.Marshal(cell, conf.Config); err != nil {
return nil, err
}
bocBytes, err := cell.ToBoc()
if err != nil {
return nil, err
}
return bocBytes, nil
}