Skip to content

Commit 3949cd0

Browse files
author
Xiao Li
authored
update to latest diem core master (#177)
* add back diem submodule * generate code from latest diem core master and fix tests * rename identifier hrp * add dry-run mainnet HRP * rename all the rest 'libra' to diem * faucet support creates dd account * use devnet for testnet until we deploy new master to testnet * bump up version to 1.0.0
1 parent 1ea5e49 commit 3949cd0

30 files changed

+770
-705
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "diem"]
2+
path = diem
3+
url = https://github.com/diem/diem.git

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project welcomes contributions.
66

77
For pull request to be accepted by any Diem projects, a CLA must be [signed](https://www.diem.com/en-us/cla-sign/). You will only need to do this once to work on any of Diem's open source projects.
88

9-
When submitting a pull request (PR), the `libra-github-bot` will check your submission for a valid CLA. If one is not found, then you will need to [submit](https://www.diem.com/en-us/cla-sign/) an Individual CLA for yourself or a Corporate CLA for your company.
9+
When submitting a pull request (PR), the `diem-github-bot` will check your submission for a valid CLA. If one is not found, then you will need to [submit](https://www.diem.com/en-us/cla-sign/) an Individual CLA for yourself or a Corporate CLA for your company.
1010

1111
## Issues
1212

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ diemtypes:
3535
"diem/target/debug/generate-transaction-builders" \
3636
--language python3 \
3737
--module-name stdlib \
38-
--with-libra-types "diem/testsuite/generate-format/tests/staged/libra.yaml" \
38+
--with-diem-types "diem/testsuite/generate-format/tests/staged/diem.yaml" \
3939
--serde-package-name diem \
40-
--libra-package-name diem \
40+
--diem-package-name diem \
4141
--target-source-dir src/diem \
42-
--with-custom-libra-code diem-types-ext/*.py \
42+
--with-custom-diem-code diem-types-ext/*.py \
4343
-- "diem/language/stdlib/compiled/transaction_scripts/abi"
4444

4545
protobuf:

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
> **Note to readers:** On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. All projects will remain available for use here until the migration to a new GitHub Organization is complete.
2-
31
# The official Diem Client SDK for Python.
42

53
[Documentation](https://developers.diem.com/docs/python-client-sdk-docs)
@@ -14,13 +12,13 @@ Root module name: `diem`
1412

1513
Sub-modules:
1614

17-
- `jsonrpc`: diem JSON-RPC APIs client and API response types. [SPEC](https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md)
15+
- `jsonrpc`: diem JSON-RPC APIs client and API response types. [SPEC](https://github.com/diem/diem/blob/master/json-rpc/json-rpc-spec.md)
1816
- `stdlib`: generated code, move stdlib script utils for constructing transaction script playload.
19-
- `diem_types`: generated code, Diem on-chain data structure types for encoding and decoding [LCS](https://libra.github.io/libra/lcs/index.html) data.
17+
- `diem_types`: generated code, Diem on-chain data structure types for encoding and decoding [LCS](https://diem.github.io/diem/lcs/index.html) data.
2018
- `utils`: utility functions, account address utils, currency code, hashing, hex encoding / decoding, transaction utils.
2119
- `AuthKey` | `auth_key`: auth key utils
2220
- `identifier`: Diem Account Identifier and Diem Intent Identifier. [DIP-5](https://dip.diem.com/dip-5/)
23-
- `txnmetadata`: utils for creating peer to peer transaction metadata. [DIP-4](https://dip.diem.org/dip-4/)
21+
- `txnmetadata`: utils for creating peer to peer transaction metadata. [DIP-4](https://dip.diem.com/dip-4/)
2422
- `testnet`: Testnet utility, minting coins, create Testnet client, chain id, Testnet JSON-RPC URL.
2523
- `LocalAccount` | `local_account`: utility for managing local account keys, generate random local account.
2624
- `chain_ids`: list of static chain ids
@@ -55,7 +53,7 @@ pip install diem-client-sdk
5553

5654
## Bugs/Requests
5755

58-
Please use the [GitHub issue tracker](https://github.com/libra/client-sdk-python/issues) to submit bugs or request features.
56+
Please use the [GitHub issue tracker](https://github.com/diem/client-sdk-python/issues) to submit bugs or request features.
5957

6058
## Build & Test
6159

checklist.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This file is a checklist of requirement & technical details for a Diem client SD
2828
- [x] client tracks latest server response block version and timestamp, raise error when received server response contains stale version / timestamp.
2929
- [x] last known blockchain version >= response version: when connecting to a cluster of fullnodes, it is possible some fullnodes are behind the head couple versions.
3030
- [x] last known blockchain timestamp >= response timestamp.
31-
- [x] parse and use libra_chain_id, libra_ledger_version and libra_ledger_tiemstamp in the JSONRPC response.
31+
- [x] parse and use diem_chain_id, diem_ledger_version and diem_ledger_tiemstamp in the JSONRPC response.
3232
- [x] Parsing and gen Diem Account Identifier (see [DIP-5][2])
3333
- bech32 addresses/subaddresses support
3434
- [x] language specific standard release publish: e.g. java maven central repo, python pip
@@ -88,7 +88,7 @@ See [doc][5] for above concepts.
8888

8989
# Examples
9090

91-
- [x] [p2p transfer examples](https://github.com/libra/dip/blob/master/dips/dip-4.md#transaction-examples)
91+
- [x] [p2p transfer examples](https://github.com/diem/lip/blob/master/lips/lip-4.md#transaction-examples)
9292
- [x] refund p2p transfer example
9393
- [x] create childVASP example
9494
- [x] Intent identifier encoding, decoding example
@@ -98,10 +98,10 @@ See [doc][5] for above concepts.
9898
- [ ] Async client
9999
- [ ] CLI connects to testnet for trying out features.
100100

101-
[1]: https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md "Diem JSON-RPC SPEC"
102-
[2]: https://github.com/libra/dip/blob/master/dips/dip-5.md "DIP-5"
103-
[3]: https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/doc/peer_to_peer_with_metadata.md "P2P Transafer"
104-
[4]: https://github.com/libra/libra/tree/master/language/stdlib/transaction_scripts/doc "Move Stdlib scripts"
105-
[5]: https://github.com/libra/libra/blob/master/client/libra-dev/README.md "Diem Client Dev Doc"
106-
[6]: https://github.com/libra/libra/blob/master/json-rpc/docs/service_testnet_faucet.md "Faucet service"
107-
[7]: https://github.com/libra/dip/blob/master/dips/dip-4.md "Transaction Metadata Specification"
101+
[1]: https://github.com/diem/diem/blob/master/json-rpc/json-rpc-spec.md "Diem JSON-RPC SPEC"
102+
[2]: https://github.com/diem/lip/blob/master/lips/lip-5.md "Address formatting"
103+
[3]: https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/doc/peer_to_peer_with_metadata.md "P2P Transafer"
104+
[4]: https://github.com/diem/diem/tree/master/language/stdlib/transaction_scripts/doc "Move Stdlib scripts"
105+
[5]: https://github.com/diem/diem/blob/master/client/diem-dev/README.md "Diem Client Dev Doc"
106+
[6]: https://github.com/diem/diem/blob/master/json-rpc/docs/service_testnet_faucet.md "Faucet service"
107+
[7]: https://github.com/diem/lip/blob/master/lips/lip-4.md "Transaction Metadata Specification"

diem

Submodule diem added at 838a46d

examples/intent_identifier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
def test_intent_identifier():
99
child_vasp_address = "d738a0b9851305dfe1d17707f0841dbc"
1010
user_sub_address = "9072d012034a880f"
11-
currency_code = "Coin1"
11+
currency_code = "XUS"
1212
amount = 10_000_000
1313

1414
account_id = identifier.encode_account(
15-
child_vasp_address, utils.sub_address(user_sub_address), identifier.TLB # testnet HRP
15+
child_vasp_address, utils.sub_address(user_sub_address), identifier.TDM # testnet HRP
1616
)
1717
intent_id = identifier.encode_intent(account_id, currency_code, amount)
1818

19-
assert intent_id == "diem://tlb1p6uu2pwv9zvzalcw3wurlppqahjg895qjqd9gsrc5pe4ul?c=Coin1&am=10000000"
19+
assert intent_id == "diem://tdm1p6uu2pwv9zvzalcw3wurlppqahjg895qjqd9gsrcr9dqh8?c=XUS&am=10000000"

examples/p2p_transfer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_non_custodial_to_custodial():
4949

5050
intent_id = receiver_custodial.payment(user_id=0, amount=1_000_000)
5151

52-
intent = identifier.decode_intent(intent_id, identifier.TLB)
52+
intent = identifier.decode_intent(intent_id, identifier.TDM)
5353

5454
script = stdlib.encode_peer_to_peer_with_metadata_script(
5555
currency=utils.currency_code(intent.currency_code),
@@ -104,7 +104,7 @@ def test_custodial_to_custodial_under_threshold():
104104

105105
intent_id = receiver_custodial.payment(user_id=0, amount=1_000_000)
106106

107-
intent = identifier.decode_intent(intent_id, identifier.TLB)
107+
intent = identifier.decode_intent(intent_id, identifier.TDM)
108108

109109
script = stdlib.encode_peer_to_peer_with_metadata_script(
110110
currency=utils.currency_code(intent.currency_code),
@@ -134,7 +134,7 @@ def test_custodial_to_custodial_above_threshold():
134134

135135
intent_id = receiver_custodial.payment(user_id=0, amount=2_000_000_000)
136136

137-
intent = identifier.decode_intent(intent_id, identifier.TLB)
137+
intent = identifier.decode_intent(intent_id, identifier.TDM)
138138

139139
sender = sender_custodial.available_child_vasp()
140140
# sender & receiver communicate by off chain APIs

examples/refund.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_refund_transaction_of_custodial_to_custodial_under_threshold():
2121

2222
# create a payment transaction
2323
intent_id = receiver_custodial.payment(user_id=0, amount=1_000_000)
24-
intent = identifier.decode_intent(intent_id, identifier.TLB)
24+
intent = identifier.decode_intent(intent_id, identifier.TDM)
2525

2626
receiver_address = utils.account_address(intent.account_address)
2727
script = stdlib.encode_peer_to_peer_with_metadata_script(

examples/stubs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def add_user(self):
7575

7676
def payment(self, user_id: int, amount: int) -> str:
7777
account_id = identifier.encode_account(
78-
self._children[0].account_address, self._users[user_id], identifier.TLB # testnet HRP
78+
self._children[0].account_address, self._users[user_id], identifier.TDM # testnet HRP
7979
)
8080
return identifier.encode_intent(account_id, testnet.TEST_CURRENCY_CODE, amount)
8181

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
setup(
1212
name="diem",
13-
version="0.6.2020120202", # bump up version for release, format 0.X.YYYYMMDDNN
13+
version="1.0.0",
1414
description="The Python Client SDK for Diem",
1515
long_description=long_description,
1616
long_description_content_type='text/markdown',
1717
license="Apache-2.0",
18-
url="https://github.com/libra/client-sdk-python",
18+
url="https://github.com/diem/client-sdk-python",
1919
# author="Diem Open Source",
2020
python_requires=">=3.7", # requires dataclasses
2121
packages=["diem"],

src/diem/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) The Diem Core Contributors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
"""Python client sdk library for the [Diem](https://libra.org) blockchain network."""
4+
"""Python client SDK library for the [Diem](https://diem.com) blockchain network."""
55

66
from .utils import InvalidAccountAddressError, InvalidSubAddressError
77
from .auth_key import AuthKey

src/diem/chain_ids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
TESTNET: ChainId = ChainId.from_int(2)
2020
DEVNET: ChainId = ChainId.from_int(3)
2121
TESTING: ChainId = ChainId.from_int(4)
22-
PREMAINNET: ChainId = ChainId.from_int(19)
22+
PREMAINNET: ChainId = ChainId.from_int(20)

src/diem/identifier/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@
2626
from .bech32 import bech32_address_encode, bech32_address_decode, Bech32Error
2727
from .subaddress import DIEM_SUBADDRESS_SIZE, DIEM_ZERO_SUBADDRESS, gen_subaddress
2828

29-
LBR = "lbr" # lbr for mainnet
30-
TLB = "tlb" # tlb for testnet
31-
PLB = "plb" # plb for premainnet
29+
DM = "dm" # mainnet
30+
TDM = "tdm" # testnet
31+
PDM = "pdm" # premainnet
32+
DDM = "ddm" # dry-run mainnet
3233

3334
HRPS: typing.Dict[int, str] = {
34-
chain_ids.MAINNET.to_int(): LBR,
35-
chain_ids.TESTNET.to_int(): TLB,
36-
chain_ids.DEVNET.to_int(): TLB,
37-
chain_ids.TESTING.to_int(): TLB,
38-
chain_ids.PREMAINNET.to_int(): PLB,
35+
chain_ids.MAINNET.to_int(): DM,
36+
chain_ids.TESTNET.to_int(): TDM,
37+
chain_ids.DEVNET.to_int(): TDM,
38+
chain_ids.TESTING.to_int(): TDM,
39+
chain_ids.PREMAINNET.to_int(): PDM,
3940
}
4041

4142

src/diem/identifier/bech32.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
# DIEM constants
2020
_DIEM_ADDRESS_SIZE = 16 # in bytes
2121
_DIEM_BECH32_VERSION = 1
22-
_DIEM_BECH32_SIZE = 50 # in characters
23-
22+
_DIEM_BECH32_SIZE = [50, 49] # in characters
2423

2524
class Bech32Error(Exception):
2625
""" Represents an error when creating a Diem address. """
@@ -68,39 +67,41 @@ def bech32_address_decode(expected_hrp: str, bech32: str) -> typing.Tuple[int, b
6867
A tuple consisiting of the Bech32 version (int), address (16 bytes), subaddress (8 bytes)
6968
"""
7069
len_bech32 = len(bech32)
70+
len_hrp = len(expected_hrp)
71+
7172
# check expected length
72-
if len_bech32 != _DIEM_BECH32_SIZE:
73+
if len_bech32 not in _DIEM_BECH32_SIZE:
7374
raise Bech32Error(f"Bech32 size should be {_DIEM_BECH32_SIZE}, but it is: {len_bech32}")
7475

7576
# do not allow mixed case per BIP 173
7677
if bech32 != bech32.lower() and bech32 != bech32.upper():
7778
raise Bech32Error(f"Mixed case Bech32 addresses are not allowed, got: {bech32}")
79+
7880
bech32 = bech32.lower()
81+
hrp = bech32[:len_hrp]
7982

80-
if bech32[:3] != expected_hrp:
83+
if hrp != expected_hrp:
8184
raise Bech32Error(
82-
f'Wrong Diem address Bech32 human readable part (prefix): requested "{expected_hrp}" but '
83-
f'got "{bech32[:3]}"'
85+
f'Wrong Diem address Bech32 human readable part (prefix): requested "{expected_hrp}" but ' f'got "{hrp}"'
8486
)
8587

8688
# check separator
87-
if bech32[3] != _BECH32_SEPARATOR:
88-
raise Bech32Error(f"Non-expected Bech32 separator: {bech32[3]}")
89+
if bech32[len_hrp] != _BECH32_SEPARATOR:
90+
raise Bech32Error(f"Non-expected Bech32 separator: {bech32[len_hrp]}")
8991

9092
# check characters after separator in Bech32 alphabet
91-
if not all(x in _BECH32_CHARSET for x in bech32[4:]):
93+
if not all(x in _BECH32_CHARSET for x in bech32[len_hrp + 1 :]):
9294
raise Bech32Error(f"Invalid Bech32 characters detected: {bech32}")
93-
hrp = bech32[:3]
9495

9596
# version is defined by the index of the Bech32 character after separator
96-
address_version = _BECH32_CHARSET.find(bech32[4])
97+
address_version = _BECH32_CHARSET.find(bech32[len_hrp + 1])
9798
# check valid version
9899
if address_version != _DIEM_BECH32_VERSION:
99100
raise Bech32Error(f"Version mismatch. Expected {_DIEM_BECH32_VERSION}, " f"but received {address_version}")
100101

101102
# we've already checked that all characters are in the correct alphabet,
102103
# thus, this will always succeed
103-
data = [_BECH32_CHARSET.find(x) for x in bech32[5:]]
104+
data = [_BECH32_CHARSET.find(x) for x in bech32[len_hrp + 2 :]]
104105

105106
# check Bech32 checksum
106107
if not _bech32_verify_checksum(hrp, [address_version] + data):

src/diem/jsonrpc/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
```
1818
19-
See [Diem JSON-RPC API SPEC](https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md) for more details
19+
See [Diem JSON-RPC API SPEC](https://github.com/diem/diem/blob/master/json-rpc/json-rpc-spec.md) for more details
2020
2121
"""
2222

@@ -64,7 +64,7 @@
6464
EVENT_DATA_BURN,
6565
EVENT_DATA_CANCEL_BURN,
6666
EVENT_DATA_MINT,
67-
EVENT_DATA_TO_LBR_EXCHANGE_RATE_UPDATE,
67+
EVENT_DATA_TO_XDX_EXCHANGE_RATE_UPDATE,
6868
EVENT_DATA_PREBURN,
6969
EVENT_DATA_RECEIVED_PAYMENT,
7070
EVENT_DATA_SENT_PAYMENT,
@@ -87,6 +87,6 @@
8787
TRANSACTION_DATA_USER,
8888
TRANSACTION_DATA_UNKNOWN,
8989
# Script#type field values, only set unknown type here,
90-
# other types, plese see https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/doc/transaction_script_documentation.md for all available script names.
90+
# other types, plese see https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/doc/transaction_script_documentation.md for all available script names.
9191
SCRIPT_UNKNOWN,
9292
)

src/diem/jsonrpc/client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _first_success(self, primary: Future, backup: Future) -> typing.Dict[str, ty
172172
class Client:
173173
"""Diem JSON-RPC API client
174174
175-
[SPEC](https://github.com/libra/libra/blob/master/json-rpc/json-rpc-spec.md)
175+
[SPEC](https://github.com/diem/diem/blob/master/json-rpc/json-rpc-spec.md)
176176
"""
177177

178178
def __init__(
@@ -301,7 +301,7 @@ def get_metadata(
301301
) -> typing.Optional[rpc.Metadata]:
302302
"""get block metadata
303303
304-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_get_metadata.md)
304+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_get_metadata.md)
305305
"""
306306

307307
params = [int(version)] if version else []
@@ -310,7 +310,7 @@ def get_metadata(
310310
def get_currencies(self) -> typing.List[rpc.CurrencyInfo]:
311311
"""get currencies
312312
313-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_get_currencies.md)
313+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_get_currencies.md)
314314
"""
315315

316316
return self.execute("get_currencies", [], _parse_list(lambda: rpc.CurrencyInfo()))
@@ -321,7 +321,7 @@ def get_account(
321321
"""get on-chain account information
322322
323323
Returns None if account not found
324-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_get_account.md)
324+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_get_account.md)
325325
"""
326326

327327
address = utils.account_address_hex(account_address)
@@ -337,7 +337,7 @@ def get_account_transaction(
337337
338338
Returns None if transaction is not found
339339
340-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_get_account_transaction.md)
340+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_get_account_transaction.md)
341341
"""
342342

343343
address = utils.account_address_hex(account_address)
@@ -355,7 +355,7 @@ def get_account_transactions(
355355
356356
Returns empty list if no transactions found
357357
358-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_get_account_transactions.md)
358+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_get_account_transactions.md)
359359
"""
360360

361361
address = utils.account_address_hex(account_address)
@@ -372,7 +372,7 @@ def get_transactions(
372372
373373
Returns empty list if no transactions found
374374
375-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_get_transactions.md)
375+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_get_transactions.md)
376376
"""
377377

378378
params = [int(start_version), int(limit), bool(include_events)]
@@ -383,7 +383,7 @@ def get_events(self, event_stream_key: str, start: int, limit: int) -> typing.Li
383383
384384
Returns empty list if no events found
385385
386-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_get_events.md)
386+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_get_events.md)
387387
"""
388388

389389
params = [event_stream_key, int(start), int(limit)]
@@ -416,7 +416,7 @@ def submit(
416416
417417
Pass in `raise_stale_response=True` to raise StaleResponseError and handle it by yourself.
418418
419-
See [JSON-RPC API Doc](https://github.com/libra/libra/blob/master/json-rpc/docs/method_submit.md)
419+
See [JSON-RPC API Doc](https://github.com/diem/diem/blob/master/json-rpc/docs/method_submit.md)
420420
"""
421421

422422
if isinstance(txn, diem_types.SignedTransaction):
@@ -577,9 +577,9 @@ def _send_http_request(
577577
# check stable response before check jsonrpc error
578578
try:
579579
self.update_last_known_state(
580-
json.get("libra_chain_id"),
581-
json.get("libra_ledger_version"),
582-
json.get("libra_ledger_timestampusec"),
580+
json.get("diem_chain_id"),
581+
json.get("diem_ledger_version"),
582+
json.get("diem_ledger_timestampusec"),
583583
)
584584
except StaleResponseError as e:
585585
if not ignore_stale_response:

0 commit comments

Comments
 (0)