diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f8d36c..822d41a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## v0.7.5 (2024-12-12) + +### Fixed + +#### **arch3-core** + +- Fixed Authz Amino converter support for `/cosmos.authz.v1beta1.MsgGrant` +with inner `/cosmos.bank.v1beta1.SendAuthorization` authorization, +without an `allowList`. ([#124]) + ## v0.7.4 (2024-12-11) ### Added diff --git a/package.json b/package.json index d9905cf..7c33e1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@archwayhq/arch3.js", - "version": "0.7.4", + "version": "0.7.5", "description": "The all-in-one library for your awesome Archway dApp", "homepage": "https://docs.archway.io", "repository": "github:archway-network/arch3.js", diff --git a/packages/arch3-core/package.json b/packages/arch3-core/package.json index 572054e..a74f50e 100644 --- a/packages/arch3-core/package.json +++ b/packages/arch3-core/package.json @@ -1,6 +1,6 @@ { "name": "@archwayhq/arch3-core", - "version": "0.7.4", + "version": "0.7.5", "description": "Core library to interact with Archway Network", "homepage": "https://docs.archway.io", "repository": "github:archway-network/arch3.js", diff --git a/packages/arch3-core/src/modules/authz/tx.spec.ts b/packages/arch3-core/src/modules/authz/tx.spec.ts index 9485c25..2652786 100644 --- a/packages/arch3-core/src/modules/authz/tx.spec.ts +++ b/packages/arch3-core/src/modules/authz/tx.spec.ts @@ -42,7 +42,7 @@ describe('Amino converter for /cosmos.authz.v1beta1.MsgGrant', () => { }); }); describe('Grants send authorization with /cosmos.authz.v1beta1.SendAuthorization', () => { - it('encodes and decodes back to the same value', () => { + it('encodes and decodes back to the same value with an allowList', () => { const message = { granter: granterAddress, grantee: granteeAddress, @@ -62,6 +62,27 @@ describe('Amino converter for /cosmos.authz.v1beta1.MsgGrant', () => { const toAmino = aminoConverters[MsgGrant.typeUrl].toAmino(message); const result = aminoConverters[MsgGrant.typeUrl].fromAmino(toAmino); + expect(message).toStrictEqual(result); + }); + it('encodes and decodes back to the same value without an allowList', () => { + const message = { + granter: granterAddress, + grantee: granteeAddress, + grant: { + authorization: { + typeUrl: SendAuthorization.typeUrl, + value: SendAuthorization.encode( + SendAuthorization.fromPartial({ + spendLimit: [{ denom: archwayd.denom, amount: '1' }], + }), + ).finish(), + }, + expiration: undefined, + }, + }; + const toAmino = aminoConverters[MsgGrant.typeUrl].toAmino(message); + const result = aminoConverters[MsgGrant.typeUrl].fromAmino(toAmino); + expect(message).toStrictEqual(result); }); }); diff --git a/packages/arch3-core/src/modules/authz/tx.ts b/packages/arch3-core/src/modules/authz/tx.ts index 854d562..d2bfc88 100644 --- a/packages/arch3-core/src/modules/authz/tx.ts +++ b/packages/arch3-core/src/modules/authz/tx.ts @@ -38,7 +38,7 @@ export const createAuthzAminoConverters = (): AminoConverters => { // eslint-disable-next-line camelcase, @typescript-eslint/naming-convention spend_limit: spend.spendLimit, // eslint-disable-next-line camelcase, @typescript-eslint/naming-convention - allow_list: spend.allowList, + allow_list: spend.allowList?.length ? spend.allowList : undefined, }, }; break; diff --git a/packages/arch3-proto/package.json b/packages/arch3-proto/package.json index 4c8217f..cf216a7 100644 --- a/packages/arch3-proto/package.json +++ b/packages/arch3-proto/package.json @@ -1,6 +1,6 @@ { "name": "@archwayhq/arch3-proto", - "version": "0.7.4", + "version": "0.7.5", "description": "Protobuf definitions and RPC clients for the Archway Network", "homepage": "https://docs.archway.io", "repository": "github:archway-network/arch3.js",