Skip to content

Commit

Permalink
Merge branch 'master' into assetPlutusType
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvionied authored Sep 1, 2024
2 parents 37ca525 + 3da936b commit b67a5b7
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (

require (
filippo.io/edwards25519 v1.0.0
github.com/maestro-org/go-sdk v1.1.3
github.com/maestro-org/go-sdk v1.2.0
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.8.0
)
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/maestro-org/go-sdk v1.1.3 h1:ORkeu1NXesRkdW7Pr5N956GojCibmGMdjXuO5jNAOZk=
github.com/maestro-org/go-sdk v1.1.3/go.mod h1:EYaRwFT8nkwFzZsN6xK256j+r7ASUUn9p44RlaqYjE8=
github.com/maestro-org/go-sdk v1.1.7-0.20240828151900-1507daa07c7e h1:TtWjutADPf153QGWazqmrbsUTgPd6IV1Q5CccPW/ndY=
github.com/maestro-org/go-sdk v1.1.7-0.20240828151900-1507daa07c7e/go.mod h1:EYaRwFT8nkwFzZsN6xK256j+r7ASUUn9p44RlaqYjE8=
github.com/maestro-org/go-sdk v1.2.0 h1:0YbC5bwRWklV25L1Z4p2pg2VQYasZGDaC9Epfxwd3a0=
github.com/maestro-org/go-sdk v1.2.0/go.mod h1:EYaRwFT8nkwFzZsN6xK256j+r7ASUUn9p44RlaqYjE8=
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
1 change: 1 addition & 0 deletions tmp/genesis_params.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"active_slots_coefficient":0,"update_quorum":0,"max_lovelace_supply":"","network_magic":0,"epoch_length":0,"system_start":0,"slots_per_kes_period":0,"slot_length":0,"max_kes_evolutions":0,"security_param":0}
1 change: 1 addition & 0 deletions tmp/genesis_params_time.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2024-08-30T15:36:02.510108+02:00"
1 change: 1 addition & 0 deletions tmp/latest_epoch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"active_stake":"22600232613963850","block_count":11327,"end_time":1725227091,"epoch":506,"fees":"34716368529","first_block_time":1724795119,"last_block_time":1725024949,"output":"42491576564571224","start_time":1724795091,"tx_count":111452}
1 change: 1 addition & 0 deletions tmp/latest_epoch_params.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"min_fee_b":155381,"min_fee_a":44,"max_block_size":90112,"max_tx_size":16384,"max_block_header_size":1100,"key_deposit":"2000000","pool_deposit":"500000000","a0":0.3,"rho":0.003,"tau":0.2,"decentralisation_param":0,"extra_entropy":"","protocol_major_ver":8,"protocol_minor_ver":0,"min_utxo":"4310","min_pool_cost":"170000000","price_mem":0.0577,"price_step":0.0000721,"max_tx_ex_mem":"14000000","max_tx_ex_steps":"10000000000","max_block_ex_mem":"62000000","max_block_ex_steps":"20000000000","max_val_size":"5000","collateral_percent":150,"max_collateral_inputs":3,"coins_per_utxo_word":"4310","coins_per_utxo_byte":""}
1 change: 1 addition & 0 deletions tmp/latest_epoch_params_time.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2024-08-30T15:36:02.554612+02:00"
1 change: 1 addition & 0 deletions tmp/latest_epoch_time.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2024-08-30T15:36:02.465511+02:00"
Binary file added tmp/main
Binary file not shown.
2 changes: 1 addition & 1 deletion txBuilding/Backend/FixedChainContext/FixedChainContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func InitFixedChainContext() FixedChainContext {
MaxBlockExSteps: "40000000000",
MaxValSize: "5000",
CoinsPerUtxoWord: "34482",
CoinsPerUtxoByte: "4310",
//CoinsPerUtxoByte: "4310",
},
GenesisParams: Base.GenesisParameters{
ActiveSlotsCoefficient: 0.05,
Expand Down
27 changes: 15 additions & 12 deletions txBuilding/Backend/MaestroChainContext/MaestroChainContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ func (mcc *MaestroChainContext) LatestEpoch() Base.Epoch {
}

func parseMaestroFloat(floatString string) float32 {
if floatString == "" {
return 0
}
splitString := strings.Split(floatString, "/")
top := splitString[0]
bottom := splitString[1]
Expand All @@ -119,14 +122,14 @@ func (mcc *MaestroChainContext) LatestEpochParams() Base.ProtocolParameters {
log.Fatal(err)
}
// Map ALL the fields
protocolParams.MinFeeConstant = int(ppFromApi.Data.MinFeeConstant)
protocolParams.MinFeeConstant = int(ppFromApi.Data.MinFeeConstant.LovelaceAmount.Lovelace)
protocolParams.MinFeeCoefficient = int(ppFromApi.Data.MinFeeCoefficient)
protocolParams.MaxTxSize = int(ppFromApi.Data.MaxTxSize)
protocolParams.MaxBlockSize = int(ppFromApi.Data.MaxBlockBodySize)
protocolParams.MaxBlockHeaderSize = int(ppFromApi.Data.MaxBlockHeaderSize)
protocolParams.KeyDeposits = fmt.Sprint(ppFromApi.Data.StakeKeyDeposit)
protocolParams.PoolDeposits = fmt.Sprint(ppFromApi.Data.PoolDeposit)
parsedPoolInfl, _ := strconv.ParseFloat(ppFromApi.Data.PoolInfluence, 32)
protocolParams.MaxTxSize = int(ppFromApi.Data.MaxTransactionSize.Bytes)
protocolParams.MaxBlockSize = int(ppFromApi.Data.MaxBlockBodySize.Bytes)
protocolParams.MaxBlockHeaderSize = int(ppFromApi.Data.MaxBlockHeaderSize.Bytes)
protocolParams.KeyDeposits = fmt.Sprint(ppFromApi.Data.StakeCredentialDeposit.LovelaceAmount.Lovelace)
protocolParams.PoolDeposits = fmt.Sprint(ppFromApi.Data.StakePoolDeposit.LovelaceAmount.Lovelace)
parsedPoolInfl, _ := strconv.ParseFloat(ppFromApi.Data.StakePoolPledgeInfluence, 32)
protocolParams.PooolInfluence = float32(parsedPoolInfl)
monExp, _ := strconv.ParseFloat(ppFromApi.Data.MonetaryExpansion, 32)
protocolParams.MonetaryExpansion = float32(monExp)
Expand All @@ -138,17 +141,17 @@ func (mcc *MaestroChainContext) LatestEpochParams() Base.ProtocolParameters {
protocolParams.ProtocolMinorVersion = int(ppFromApi.Data.ProtocolVersion.Minor)
//CHECK HERE
//protocolParams.MinUtxo = ppFromApi.Data.
protocolParams.MinPoolCost = fmt.Sprint(ppFromApi.Data.MinPoolCost)
protocolParams.PriceMem = parseMaestroFloat(ppFromApi.Data.Prices.Memory)
protocolParams.PriceStep = parseMaestroFloat(ppFromApi.Data.Prices.Steps)
protocolParams.MinPoolCost = fmt.Sprint(ppFromApi.Data.MinStakePoolCost.LovelaceAmount.Lovelace)
protocolParams.PriceMem = parseMaestroFloat(ppFromApi.Data.ScriptExecutionPrices.Memory)
protocolParams.PriceStep = parseMaestroFloat(ppFromApi.Data.ScriptExecutionPrices.Steps)
protocolParams.MaxTxExMem = fmt.Sprint(ppFromApi.Data.MaxExecutionUnitsPerTransaction.Memory)
protocolParams.MaxTxExSteps = fmt.Sprint(ppFromApi.Data.MaxExecutionUnitsPerTransaction.Steps)
protocolParams.MaxBlockExMem = fmt.Sprint(ppFromApi.Data.MaxExecutionUnitsPerBlock.Memory)
protocolParams.MaxBlockExSteps = fmt.Sprint(ppFromApi.Data.MaxExecutionUnitsPerBlock.Steps)
protocolParams.MaxValSize = fmt.Sprint(ppFromApi.Data.MaxValueSize)
protocolParams.MaxValSize = fmt.Sprint(ppFromApi.Data.MaxValueSize.Bytes)
protocolParams.CollateralPercent = int(ppFromApi.Data.CollateralPercentage)
protocolParams.MaxCollateralInuts = int(ppFromApi.Data.MaxCollateralInputs)
protocolParams.CoinsPerUtxoByte = fmt.Sprint(ppFromApi.Data.CoinsPerUtxoByte)
protocolParams.CoinsPerUtxoByte = fmt.Sprint(ppFromApi.Data.MinUtxoDepositCoefficient)
protocolParams.CoinsPerUtxoWord = "0"
//protocolParams.CostModels = ppFromApi.Data.CostModels
return protocolParams
Expand Down

0 comments on commit b67a5b7

Please sign in to comment.