Skip to content

v2.0.0-beta1

Compare
Choose a tag to compare
@ZhmakAS ZhmakAS released this 18 Jul 21:27
· 28 commits to master since this release
f75d256

This is a beta version of the GO SDK v2.0.0. It is compatible with Casper node v2.0.0-rc3 and Casper node v1.5.6. This
new version introduces some breaking changes. Read the changelog below in detail.

Added

  • New methods were added to the RPC client:

    • RPC state_get_entity : GetLatestEntity(), GetEntityByBlockHash(), GetEntityByBlockHeight();
    • RPC query_balance_details : QueryLatestBalanceDetails(), QueryBalanceDetailsByBlockHeight(), QueryBalanceDetailsByBlockHash(), QueryBalanceDetailsByStateRootHash();
    • RPC query_balance : QueryLatestBalance(), QueryBalanceByBlockHeight(), QueryBalanceByBlockHash(), QueryBalanceByStateRootHash();
    • RPC info_get_reward : GetLatestValidatorReward(), GetValidatorRewardByEraID(), GetValidatorRewardByBlockHash(), GetValidatorRewardByBlockHeight(),
      GetLatestDelegatorReward(), GetDelegatorRewardByEraID(), GetDelegatorRewardByBlockHash(), GetDelegatorRewardByBlockHeight();
    • RPC info_get_transaction : GetTransactionByTransactionHash(), GetTransactionByDeployHash(), GetTransactionFinalizedApprovalByTransactionHash()
      GetTransactionFinalizedApprovalByDeployHash();
    • RPC account_put_transaction : PutTransactionV1();
  • New TransactionV1 type to model the new type of transactions in Condor.

  • Introduced new type Transaction to abstract the developer from the Deploy and TransactionV1 records returned
    from the network in Condor version.

  • New global state keys added to the SDK: AddressableEntity, BalanceHold, BidAddr, BlockGlobalAddr,
    ByteCode, EntryPoint, Message, NamedKey and Package.

  • New AddressableEntity entity was added. It may represent an account, a stored smart contract, or a system smart
    contract.

  • New properties in the StoredValue can be retrieved with QueryGlobalState() method: BidKind, Unbonding,
    AddressableEntity, Package, ByteCode, MessageTopic, Message, NamedKey, Reservation and EntryPoint.

  • New types to represent data from the global
    state: BidKind, MessageTopicSummary, ReservationKind, EntryPointValue and ByteCode.

  • Added TransactionAccepted, TransactionProcessed, and TransactionExpired events to the list of events emitted by
    a node
    through the SSE interface.

  • New GetBalanceByStateRootHash() method was added to the RPC client.

Changed

  • The Block type has changed to abstract the developer from the versioned block records returned from the network in
    Condor version.
  • For blocks produced in Casper 2.0, the Block instance contains the previous switch block hash in the
    LastSwitchBlockHash field.
    property.
  • The EraEnd type has changed to abstract the developer from the versioned records returned from the network.
  • GetDeploy() response has changed and now contains a ExecutionInfo object when the deploy has been processed
    instead a
    list of ExecutionResult objects. The execution info itself contains block information and a result object.
  • GetAuctionInfoLatest() RPC method was renamed to GetLatestAuctionInfo().
  • GetAccountBalance() RPC method was renamed to GetLatestBalance().
  • GetRawJSON() method was added for all types used as RPC result.
  • The Transfer type contained in the response for a GetBlockTransfers() call or in a ExecutionResult object has changed
    to abstract from the versioned transfer records returned from the network. Refer to the migration guide for more
    information.
  • When using the GetStatus() method with a Casper 2.0 node, the response contains the hash for the latest switch block
    in the LatestSwitchBlockHash property.
  • ActionThresholds type has now new UpgradeManagement property.
  • In the StoredValue type, Transfer has been renamed to LegacyTransfer.
  • Method ValidateDeploy on Deploy entity was renamed to Validate.
  • Method SignDeploy on Deploy entity was renamed to Sign, also method signature was changed, it returns only error
    instead of (bool, error)
  • FinalitySignature event contains BlockHeight and ChainNameHash value when connected to a Casper 2.0 node.
  • DeployProcessed event from SSE contains a ExecutionResultV1 object instead of a ExecutionResult object.
  • The EntryPoint type has new entry point types and a new property EntryPointPayment. Both apply when working with
    Casper 2.0 only.
  • Step event from SSE was extended with list of TransformV2 objects under ExecutionEffects field.

Security
Upgraded golang.org/x/crypto lib to 0.23.0 version to address CVE-2023-42818 vulnerability.