-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from make-software/release/v1.2.0
Release/v1.2.0
- Loading branch information
Showing
25 changed files
with
1,070 additions
and
1,064 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package rpc | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
|
||
"github.com/make-software/casper-go-sdk/types" | ||
) | ||
|
||
type SpeculativeClient struct { | ||
handler Handler | ||
} | ||
|
||
func NewSpeculativeClient(handler Handler) *SpeculativeClient { | ||
return &SpeculativeClient{handler: handler} | ||
} | ||
|
||
func (c SpeculativeClient) SpeculativeExec(ctx context.Context, deploy types.Deploy, identifier *BlockIdentifier) (SpeculativeExecResult, error) { | ||
var result SpeculativeExecResult | ||
request := DefaultRpcRequest(MethodSpeculativeExec, SpeculativeExecParams{ | ||
Deploy: deploy, | ||
BlockIdentifier: identifier, | ||
}) | ||
if reqID := GetReqIdCtx(ctx); reqID != "0" { | ||
request.ID = reqID | ||
} | ||
resp, err := c.handler.ProcessCall(ctx, request) | ||
if err != nil { | ||
return SpeculativeExecResult{}, err | ||
} | ||
|
||
if resp.Error != nil { | ||
return SpeculativeExecResult{}, fmt.Errorf("rpc call failed, details: %w", resp.Error) | ||
} | ||
|
||
err = json.Unmarshal(resp.Result, &result) | ||
if err != nil { | ||
return SpeculativeExecResult{}, fmt.Errorf("%w, details: %s", ErrResultUnmarshal, err.Error()) | ||
} | ||
|
||
return result, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"hash": "b287dd3ae44e57e944bf357d50f8c09fa6a58cb3cdccebb94febf2733d243d92", | ||
"header": { | ||
"parent_hash": "3702837e19058988f12260689dc6cf6adf3f31d06d4b34109a4a4fda44c23e08", | ||
"state_root_hash": "05294c6b79095e72c24544852b1d678350554e16bbd430adab4dd0b5be0bccfe", | ||
"body_hash": "5187b7a8021bf4f2c004ea3a54cfece1754f11c7624d2363c7f4cf4fddd1441e", | ||
"random_bit": false, | ||
"accumulated_seed": "abd4677d96e41ffc598761b58e93ebd5ab91affcc1b7d09e4b3bc63044fcced0", | ||
"era_end": { | ||
"era_report": { | ||
"equivocators": [], | ||
"rewards": [], | ||
"inactive_validators": [] | ||
}, | ||
"next_era_validator_weights": [ | ||
{ | ||
"validator": "0115c9b40c06ff99b0cbadf1140b061b5dbf92103e66a6330fbcc7768f5219c1ce", | ||
"weight": "295643652543863089" | ||
}, | ||
{ | ||
"validator": "011b19ef983c039a2a335f2f35199bf8cad5ba2c583bd709748feb76f24ffb1bab", | ||
"weight": "294564238999375236" | ||
}, | ||
{ | ||
"validator": "011d86fcc3e438fcb47d4d9af77e9db97ca1c322c3e87d5a4ea6f3386b9ddcd6ed", | ||
"weight": "294159738231573499" | ||
}, | ||
{ | ||
"validator": "017234b285929170324e1051ccd887dc08adf049650ecf5d383985b0b0048ab39b", | ||
"weight": "284471020019645189" | ||
}, | ||
{ | ||
"validator": "017fec504c642f2b321b8591f1c3008348c57a81acafceb5a392cf8416a5fb4a3c", | ||
"weight": "294691173297447085" | ||
}, | ||
{ | ||
"validator": "019e7b8bdec03ba83be4f5443d9f7f9111c77fec984ce9bb5bb7eb3da1e689c02d", | ||
"weight": "294679465132340585" | ||
}, | ||
{ | ||
"validator": "01cb8e121682e087058610828a6f75e8ca504321508243c7518a4047d3284f2f3c", | ||
"weight": "292948235437478173" | ||
} | ||
] | ||
}, | ||
"timestamp": "2023-05-11T18:24:49.664Z", | ||
"era_id": 9128, | ||
"height": 1749608, | ||
"protocol_version": "1.5.0" | ||
}, | ||
"body": { | ||
"proposer": "00", | ||
"deploy_hashes": [], | ||
"transfer_hashes": [] | ||
}, | ||
"proofs": [ | ||
{ | ||
"public_key": "011b19ef983c039a2a335f2f35199bf8cad5ba2c583bd709748feb76f24ffb1bab", | ||
"signature": "01f6bfd939b7797f1be4f16e597a115f38687745ad32dcd3402ef38c750b6abfb50c0918cb1e57ea25b174fa632a1f62000cc727aff703eb17c3b5f976ca17f304" | ||
}, | ||
{ | ||
"public_key": "011d86fcc3e438fcb47d4d9af77e9db97ca1c322c3e87d5a4ea6f3386b9ddcd6ed", | ||
"signature": "019a011ea3f5d5d5446748ae58c40f5d6f0f255dfd1a75161d84b2c280f79a523756fee665401617e765651c32dd4a10598a15e71ae08ee3b48479033db4d2f30c" | ||
}, | ||
{ | ||
"public_key": "017234b285929170324e1051ccd887dc08adf049650ecf5d383985b0b0048ab39b", | ||
"signature": "017664b8c0b2cdba2261ae1af6f213ad0f8812799e2fbd840b668799221c4f0a5951aa7f9e1828bbbe16fc51e1e94e5c1a935f31c3781feef7a36500c660774601" | ||
}, | ||
{ | ||
"public_key": "017fec504c642f2b321b8591f1c3008348c57a81acafceb5a392cf8416a5fb4a3c", | ||
"signature": "01e921e323ce23a1e7cf9453e0efdc23c0ee9001d28eb8124da73e85f0fc5fe3f6cd22008aa7053cf5c8c20813230f414238b95032f98c0ce6e09e643dfc011009" | ||
}, | ||
{ | ||
"public_key": "019e7b8bdec03ba83be4f5443d9f7f9111c77fec984ce9bb5bb7eb3da1e689c02d", | ||
"signature": "01fcdf5f457fbe2868e03a15bee5af2c15fa4d8fce05888fde0c7b080ffda418511c380a71c500097ff840e0e68ff0976e4c0ec74fd318554e8557a4d5b6042c06" | ||
}, | ||
{ | ||
"public_key": "01cb8e121682e087058610828a6f75e8ca504321508243c7518a4047d3284f2f3c", | ||
"signature": "014bee8a716df01a593a535ebf2dee20da400a99dffe1d56e07f2dfa5f947d4d5003e4ee51289e389998e4c9b45efe00a1193d7db79a67dd824d489ddf16ad820e" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,6 @@ | |
"group": "constructor", | ||
"keys": [] | ||
} | ||
] | ||
], | ||
"lock_status": "Unlocked" | ||
} |
Oops, something went wrong.