Skip to content

Commit

Permalink
update to version SDK 1.42.0 and style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
markgenuine committed Apr 8, 2023
1 parent 4895203 commit 7778ae1
Show file tree
Hide file tree
Showing 36 changed files with 2,283 additions and 2,566 deletions.
102 changes: 18 additions & 84 deletions domain/abi.go

Large diffs are not rendered by default.

44 changes: 2 additions & 42 deletions domain/boc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ import (
"fmt"
)

// BocErrorCode ...
var BocErrorCode map[string]int

type (

// BocCacheType ...
BocCacheType struct {
ValueEnumType interface{}
}

// BocCacheTypePinned ...
BocCacheTypePinned struct {
Pin string `json:"pin"`
}
Expand All @@ -24,85 +20,69 @@ type (
// limited size regulated by LRU (least recently used) cache lifecycle.
BocCacheTypeUnpinned struct{}

// ParamsOfParse ...
ParamsOfParse struct {
Boc string `json:"boc"`
}

// ResultOfParse ...
ResultOfParse struct {
Parsed json.RawMessage `json:"parsed"`
}

// ParamsOfParseShardstate ...
ParamsOfParseShardstate struct {
Boc string `json:"boc"`
ID string `json:"id"`
WorkchainID int `json:"workchain_id"`
}

// ParamsOfGetBlockchainConfig ...
ParamsOfGetBlockchainConfig struct {
BlockBoc string `json:"block_boc"`
}

// ResultOfGetBlockchainConfig ...
ResultOfGetBlockchainConfig struct {
ConfigBoc string `json:"config_boc"`
}

// ParamsOfGetBocHash ...
ParamsOfGetBocHash struct {
Boc string `json:"boc"`
}

// ResultOfGetBocHash ...
ResultOfGetBocHash struct {
Hash string `json:"hash"`
}

// ParamsOfGetBocDepth ...
ParamsOfGetBocDepth struct {
Boc string `json:"boc"`
}

// ResultOfGetBocDepth ...
ResultOfGetBocDepth struct {
Depth int `json:"depth"`
}

//ParamsOfGetCodeFromTvc ...
ParamsOfGetCodeFromTvc struct {
Tvc string `json:"tvc"`
}

//ResultOfGetCodeFromTvc ...
ResultOfGetCodeFromTvc struct {
Code string `json:"code"`
}

// ParamsOfBocCacheGet ...
ParamsOfBocCacheGet struct {
BocRef string `json:"boc_ref"`
}

// ResultOfBocCacheGet ...
ResultOfBocCacheGet struct {
Boc string `json:"boc,omitempty"`
}

// ParamsOfBocCacheSet ...
ParamsOfBocCacheSet struct {
Boc string `json:"boc"`
CacheType *BocCacheType `json:"cache_type"`
}

// ResultOfBocCacheSet ...
ResultOfBocCacheSet struct {
BocRef string `json:"boc_ref"`
}

// ParamsOfBocCacheUnpin ...
ParamsOfBocCacheUnpin struct {
Pin string `json:"pin"`
BocRef string `json:"boc_ref,omitempty"`
Expand All @@ -113,73 +93,60 @@ type (
ValueEnumType interface{}
}

// BuilderOpInteger ...
BuilderOpInteger struct {
Size int `json:"size"`
Value interface{} `json:"value"`
}

// BuilderOpBitString ...
BuilderOpBitString struct {
Value string `json:"value"`
}

// BuilderOpCell ...
BuilderOpCell struct {
Builder []*BuilderOp `json:"builder"`
}

// BuilderOpCellBoc ...
BuilderOpCellBoc struct {
Boc string `json:"boc"`
}

// BuilderOpAddress ..
BuilderOpAddress struct {
Address string `json:"address"`
}

// ParamsOfEncodeBoc ...
ParamsOfEncodeBoc struct {
Builder []*BuilderOp `json:"builder"`
BocCache *BocCacheType `json:"boc_cache,omitempty"`
}

// ResultOfEncodeBoc ...
ResultOfEncodeBoc struct {
Boc string
}

// ParamsOfGetCodeSalt ...
ParamsOfGetCodeSalt struct {
Code string `json:"code"`
BocCache *BocCacheType `json:"boc_cache,omitempty"`
}

// ResultOfGetCodeSalt ...
ResultOfGetCodeSalt struct {
Salt string `json:"salt,omitempty"`
}

// ParamsOfSetCodeSalt ...
ParamsOfSetCodeSalt struct {
Code string `json:"code"`
Salt string `json:"salt"`
BocCache *BocCacheType `json:"boc_cache,omitempty"`
}

// ResultOfSetCodeSalt ...
ResultOfSetCodeSalt struct {
Code string `json:"code"`
}

// ParamsOfDecodeTvc ...
ParamsOfDecodeTvc struct {
Tvc string `json:"tvc"`
BocCache *BocCacheType `json:"boc_cache,omitempty"`
}

// ResultOfDecodeTvc ...
ResultOfDecodeTvc struct {
Code string `json:"code,omitempty"`
CodeHash string `json:"code_hash,omitempty"`
Expand All @@ -194,7 +161,6 @@ type (
CompilerVersion string `json:"compiler_version,omitempty"`
}

// ParamsOfEncodeTvc ...
ParamsOfEncodeTvc struct {
Code string `json:"code,omitempty"`
Data string `json:"data,omitempty"`
Expand All @@ -205,36 +171,31 @@ type (
BocCache *BocCacheType `json:"boc_cache,omitempty"`
}

// ResultOfEncodeTvc ...
ResultOfEncodeTvc struct {
Tvc string `json:"tvc"`
}

// ParamsOfGetCompilerVersion ...
ParamsOfGetCompilerVersion struct {
Code string `json:"code"`
}

// ResultOfGetCompilerVersion ...
ResultOfGetCompilerVersion struct {
Version string `json:"version,omitempty"`
}

// ParamsOfEncodeExternalInMessage ...
ParamsOfEncodeExternalInMessage struct {
Src string `json:"src,omitempty"`
Dst string `json:"dst"`
Init string `json:"init,omitempty"`
Body string `json:"body"`
BocCache *BocCacheType `json:"boc_cache,omitempty"`
}
// ResultOfEncodeExternalInMessage ...

ResultOfEncodeExternalInMessage struct {
message string `json:"message"`
Message string `json:"message"`
MessageID string `json:"message_id"`
}

//BocUseCase ...
BocUseCase interface {
ParseMessage(*ParamsOfParse) (*ResultOfParse, error)
ParseTransaction(*ParamsOfParse) (*ResultOfParse, error)
Expand Down Expand Up @@ -392,7 +353,6 @@ func (bO *BuilderOp) UnmarshalJSON(b []byte) error {
return nil
}

// NewBuilderOp ...
func NewBuilderOp(value interface{}) *BuilderOp {
return &BuilderOp{ValueEnumType: value}
}
26 changes: 0 additions & 26 deletions domain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,41 @@ const (
NetworkQueriesProtocolWS NetworkQueriesProtocol = "WS"
)

// ClientErrorCode ...
var ClientErrorCode map[string]int

type (

// ClientError ...
ClientError struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data"`
}

// ClientResponse ...
ClientResponse struct {
Data []byte
Code uint32
Error error
}

// AppRequestResult ...
AppRequestResult struct {
ValueEnumType interface{}
}

// AppRequestResultError ...
AppRequestResultError struct {
Text string `json:"text"`
}

// AppRequestResultOk ...
AppRequestResultOk struct {
Result json.RawMessage `json:"result"`
}

// ResultOfVersion ...
ResultOfVersion struct {
Version string `json:"version"`
}

// ResultOfGetAPIReference ...
ResultOfGetAPIReference struct {
API *API `json:"api"`
}

// API ...
API struct {
Modules []struct {
Description string `json:"description"`
Expand Down Expand Up @@ -90,36 +80,30 @@ type (
Version string `json:"version"`
}

// ResultOfBuildInfo ...
ResultOfBuildInfo struct {
BuildNumber int `json:"build_number"`
Dependencies []*BuildInfoDependency `json:"dependencies"`
}

// BuildInfoDependency ...
BuildInfoDependency struct {
Name string `json:"name"`
GitCommit string `json:"git_commit"`
}

// ParamsOfResolveAppRequest ...
ParamsOfResolveAppRequest struct {
AppRequestID int `json:"app_request_id"`
Result *AppRequestResult `json:"result"`
}

// ParamsOfAppRequest ...
ParamsOfAppRequest struct {
AppRequestID int `json:"app_request_id"`
RequestData json.RawMessage `json:"request_data"`
}

// EnumType ...
EnumType struct {
Type string `json:"type"`
}

// ClientGateway ...
ClientGateway interface {
Destroy()
GetResult(string, interface{}, interface{}) error
Expand All @@ -132,25 +116,21 @@ type (
ResolveAppRequest(*ParamsOfResolveAppRequest) error
}

// AppPasswordProvider ...
AppPasswordProvider interface {
GetPassword(ParamsOfAppPasswordProviderGetPassword) (ResultOfAppPasswordProviderGetPassword, error)
}

// AppSigningBox ...
AppSigningBox interface {
GetPublicKey() (ResultOfAppSigningBoxGetPublicKey, error)
Sign(ParamsOfAppSigningBoxSign) (ResultOfAppSigningBoxSign, error)
}

// AppEncryptionBox ...
AppEncryptionBox interface {
GetInfo() (ResultOfAppEncryptionBoxGetInfo, error)
Encrypt(ParamsOfAppEncryptionBoxEncrypt) (ResultOfAppEncryptionBoxEncrypt, error)
Decrypt(ParamsOfAppEncryptionBoxDecrypt) (ResultOfAppEncryptionBoxDecrypt, error)
}

//AppDebotBrowser ...
AppDebotBrowser interface {
Log(ParamsOfAppDebotBrowserLog) error
Switch(ParamsOfAppDebotBrowserSwitch) error
Expand All @@ -168,7 +148,6 @@ type (
// NetworkQueriesProtocol - Network protocol used to perform GraphQL queries.
NetworkQueriesProtocol string

// ClientConfig ...
ClientConfig struct {
Binding *BindingConfig `json:"binding,omitempty"`
Network *NetworkConfig `json:"network,omitempty"`
Expand All @@ -185,7 +164,6 @@ type (
Version string `json:"version,omitempty"`
}

// Network - Network config.
NetworkConfig struct {
ServerAddress string `json:"server_address,omitempty"`
Endpoints []string `json:"endpoints,omitempty"`
Expand All @@ -207,7 +185,6 @@ type (
AccessKey string `json:"access_key,omitempty"`
}

// Crypto ...
CryptoConfig struct {
MnemonicDictionary *MnemonicDictionary `toml:"mnemonic_dictionary" json:"mnemonic_dictionary,omitempty"`
MnemonicWordCount *int `toml:"mnemonic_word_count" json:"mnemonic_word_count,omitempty"`
Expand Down Expand Up @@ -326,7 +303,6 @@ func init() {
}
}

// DynBufferForResponses ...
func DynBufferForResponses(in <-chan *ClientResponse) <-chan *ClientResponse {
out := make(chan *ClientResponse, 1)
var storage []*ClientResponse
Expand Down Expand Up @@ -365,7 +341,6 @@ func DynBufferForResponses(in <-chan *ClientResponse) <-chan *ClientResponse {
return out
}

// HandleEvents ...
func HandleEvents(responses <-chan *ClientResponse, callback EventCallback, result interface{}) error {
for r := range responses {
switch r.Code {
Expand Down Expand Up @@ -433,7 +408,6 @@ func (aRR *AppRequestResult) UnmarshalJSON(b []byte) error {
return nil
}

// NewAppRequestResult ...
func NewAppRequestResult(value interface{}) *AppRequestResult {
return &AppRequestResult{ValueEnumType: value}
}
Loading

0 comments on commit 7778ae1

Please sign in to comment.