Skip to content

Commit

Permalink
add 45 config
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tron committed Nov 20, 2024
1 parent 2b3a509 commit 07266d7
Showing 6 changed files with 476 additions and 7 deletions.
29 changes: 29 additions & 0 deletions api/openapi.json
Original file line number Diff line number Diff line change
@@ -2284,6 +2284,35 @@
],
"type": "object"
},
"45": {
"description": "precompiled contracts",
"properties": {
"contracts": {
"items": {
"properties": {
"code_hash": {
"format": "address",
"type": "string"
},
"gas_usage": {
"format": "int64",
"type": "integer"
}
},
"required": [
"code_hash",
"gas_usage"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"contracts"
],
"type": "object"
},
"5": {
"properties": {
"blackhole_addr": {
21 changes: 21 additions & 0 deletions api/openapi.yml
Original file line number Diff line number Diff line change
@@ -5288,6 +5288,27 @@ components:
example: 0:0000000000000000000000000000000000000000000000000000000000000000
suspended_until:
type: integer

"45":
type: object
description: precompiled contracts
required:
- contracts
properties:
contracts:
type: array
items:
type: object
required:
- code_hash
- gas_usage
properties:
code_hash:
type: string
format: address
gas_usage:
type: integer
format: int64
"71":
type: object
description: Bridge parameters for wrapping TON in other networks.
11 changes: 11 additions & 0 deletions pkg/api/blockchain_converters.go
Original file line number Diff line number Diff line change
@@ -532,6 +532,17 @@ func convertConfig(logger *zap.Logger, cfg tlb.ConfigParams) (*oas.BlockchainCon
config.R44.Accounts = append(config.R44.Accounts, accountID.String())
}
config.R44.SetSuspendedUntil(int(blockchainConfig.ConfigParam44.SuspendedAddressList.SuspendedUntil))
if p45 := blockchainConfig.ConfigParam45; p45 != nil {
var param45 oas.BlockchainConfig45
for _, item := range p45.PrecompiledContractsConfig.List.Items() {
param45.Contracts = append(param45.Contracts, oas.BlockchainConfig45ContractsItem{
CodeHash: item.Key.Hex(),
GasUsage: int64(item.Value.GasUsage),
})
}
config.R45 = oas.NewOptBlockchainConfig45(param45)
}

if p71 := blockchainConfig.ConfigParam71; p71 != nil {
param71 := oas.BlockchainConfig71{
OracleBridgeParams: convertOracleBridgeParams(p71.OracleBridgeParams),
Loading

0 comments on commit 07266d7

Please sign in to comment.