diff --git a/README.md b/README.md index e42fa2d..ea5b434 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Any of the following FATE API data types can be encoded and decoded: - oracle_query_id - peer_pubkey - name -- transaction_hash +- tx_hash - signature - commitment - bytearray diff --git a/src/ApiEncoder.js b/src/ApiEncoder.js index 9e05e45..4f59fe7 100644 --- a/src/ApiEncoder.js +++ b/src/ApiEncoder.js @@ -17,7 +17,7 @@ const TYPES = { oracle_query_id: {tag: 'oq', size: 32, encoder: base58check}, peer_pubkey: {tag: 'pp', size: 32, encoder: base58check}, name: {tag: 'nm', size: 0, encoder: base58check}, - transaction_hash: {tag: 'th', size: 32, encoder: base58check}, + tx_hash: {tag: 'th', size: 32, encoder: base58check}, signature: {tag: 'sg', size: 64, encoder: base58check}, commitment: {tag: 'cm', size: 32, encoder: base58check}, bytearray: {tag: 'ba', size: 0, encoder: base64check}, @@ -37,7 +37,7 @@ const TAG2TYPE = { oq: 'oracle_query_id', pp: 'peer_pubkey', nm: 'name', - th: 'transaction_hash', + th: 'tx_hash', sg: 'signature', cm: 'commitment', ba: 'bytearray', diff --git a/tests/ApiEncoder.js b/tests/ApiEncoder.js index 41f694b..581b59a 100644 --- a/tests/ApiEncoder.js +++ b/tests/ApiEncoder.js @@ -75,7 +75,7 @@ test('Encode', t => { ) t.deepEqual( - encoder.encode('transaction_hash', payload), + encoder.encode('tx_hash', payload), 'th_16qJFWMMHFy3xDdLmvUeyc2S6FrWRhJP51HsvDYdz9d1FsYG' )