diff --git a/x/marker/keeper/mocks_test.go b/x/marker/keeper/mocks_test.go index 083b254e64..e1de82dae7 100644 --- a/x/marker/keeper/mocks_test.go +++ b/x/marker/keeper/mocks_test.go @@ -262,7 +262,7 @@ func NewWrappedAttrKeeper() *WrappedAttrKeeper { return &WrappedAttrKeeper{} } -// WithParent sets the parent bank keeper for this wrapping. +// WithParent sets the parent attr keeper for this wrapping. func (w *WrappedAttrKeeper) WithParent(attrKeeper types.AttrKeeper) *WrappedAttrKeeper { w.AttrKeeper = attrKeeper return w @@ -270,8 +270,8 @@ func (w *WrappedAttrKeeper) WithParent(attrKeeper types.AttrKeeper) *WrappedAttr // WithGetAllAttributesAddrErrs adds the provided error strings to the list of errors that will be // returned by GetAllAttributesAddr. A non-empty entry will be returned as an error (when its time comes). -// An empty entry (or if there aren't any entries left when SendCoins is called) will -// result in the parent's SendCoins function being called and returned. +// An empty entry (or if there aren't any entries left when GetAllAttributesAddr is called) will +// result in the parent's GetAllAttributesAddr function being called and returned. func (w *WrappedAttrKeeper) WithGetAllAttributesAddrErrs(errs ...string) *WrappedAttrKeeper { w.GetAllAttributesAddrErrs = append(w.GetAllAttributesAddrErrs, errs...) return w diff --git a/x/marker/keeper/send_restrictions_test.go b/x/marker/keeper/send_restrictions_test.go index 1ee8ceb28d..595c7974dc 100644 --- a/x/marker/keeper/send_restrictions_test.go +++ b/x/marker/keeper/send_restrictions_test.go @@ -61,6 +61,7 @@ func TestSendRestrictionFn(t *testing.T) { addrWithoutAttrs := sdk.AccAddress("addr_without_attribs") addrWithTransfer := sdk.AccAddress("addr_with_transfer__") + addrWithForceTransfer := sdk.AccAddress("addr_with_force_tran") addrWithDeposit := sdk.AccAddress("addrWithDeposit_____") addrWithWithdraw := sdk.AccAddress("addrWithWithdraw____") addrWithTranDep := sdk.AccAddress("addrWithTranDep_____") @@ -97,6 +98,7 @@ func TestSendRestrictionFn(t *testing.T) { if markerType == restricted { rv.AccessControl = []types.AccessGrant{ {Address: addrWithTransfer.String(), Permissions: types.AccessList{types.Access_Transfer}}, + {Address: addrWithForceTransfer.String(), Permissions: types.AccessList{types.Access_ForceTransfer}}, {Address: addrWithDeposit.String(), Permissions: types.AccessList{types.Access_Deposit}}, {Address: addrWithWithdraw.String(), Permissions: types.AccessList{types.Access_Withdraw}}, {Address: addrWithTranDep.String(), Permissions: types.AccessList{types.Access_Deposit, types.Access_Transfer}}, @@ -196,6 +198,13 @@ func TestSendRestrictionFn(t *testing.T) { amt: cz(c(1, rDenomNoAttr)), expErr: "", }, + { + name: "addr has force transfer, denom without attrs", + from: addrWithForceTransfer, + to: addrWithoutAttrs, + amt: cz(c(1, rDenomNoAttr)), + expErr: fmt.Sprintf("%s does not have transfer permissions for %s", addrWithForceTransfer.String(), rDenomNoAttr), + }, { name: "addr has transfer, denom with 3 attrs, to has none", from: addrWithTransfer, diff --git a/x/marker/types/marker_test.go b/x/marker/types/marker_test.go index 5173e5a454..31b1d81519 100644 --- a/x/marker/types/marker_test.go +++ b/x/marker/types/marker_test.go @@ -489,7 +489,7 @@ func TestHasAccess(t *testing.T) { Address: addrAll.String(), Permissions: []Access{ Access_Mint, Access_Burn, Access_Deposit, Access_Withdraw, - Access_Delete, Access_Admin, Access_Transfer, + Access_Delete, Access_Admin, Access_Transfer, Access_ForceTransfer, }, }, {Address: addrDup.String(), Permissions: []Access{Access_Admin}}, @@ -497,7 +497,7 @@ func TestHasAccess(t *testing.T) { Address: addrAllButWithdraw.String(), Permissions: []Access{ Access_Mint, Access_Burn, Access_Deposit, - Access_Delete, Access_Admin, Access_Transfer, + Access_Delete, Access_Admin, Access_Transfer, Access_ForceTransfer, }, }, {Address: addrOnlyTransfer.String(), Permissions: []Access{Access_Transfer}}, @@ -531,6 +531,7 @@ func TestHasAccess(t *testing.T) { {name: "address has all: delete", addr: addrAll, role: Access_Delete, expHas: true}, {name: "address has all: admin", addr: addrAll, role: Access_Admin, expHas: true}, {name: "address has all: transfer", addr: addrAll, role: Access_Transfer, expHas: true}, + {name: "address has all: force transfer", addr: addrAll, role: Access_ForceTransfer, expHas: true}, } for _, tc := range tests {