Skip to content

Commit

Permalink
With new Kusama runtime upgrade, the pallet balance.transfer was chan…
Browse files Browse the repository at this point in the history
…ged to balance.transfer_keep_alive
  • Loading branch information
Yuripetusko committed Jan 26, 2024
1 parent d1352bc commit fde7cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/rmrk2.0.0/tools/consolidator/interactions/buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const getExtraBalanceTransfers = (
const extraTransfers: ChangeExtraBalanceTransfer[] = [];

remark.extra_ex?.forEach((el: BlockCall) => {
if (el.call === "balances.transfer") {
if (el.call === "balances.transfer" || el.call === "balances.transfer_keep_alive") {
const [owner, forsale] = el.value.split(",");
const ownerEncoded = ss58Format
? encodeAddress(owner, ss58Format)
Expand All @@ -141,7 +141,7 @@ const isTransferValid = (remark: Remark, nft: NFT, ss58Format?: number) => {
let transferValid = false;
let transferValue = "";
remark.extra_ex?.forEach((el: BlockCall) => {
if (el.call === "balances.transfer") {
if (el.call === "balances.transfer" || el.call === "balances.transfer_keep_alive") {
const [owner, forsale] = el.value.split(",");
const ownerEncoded = ss58Format
? encodeAddress(owner, ss58Format)
Expand All @@ -166,9 +166,9 @@ const validate = (
nft,
ss58Format
);

validateTransferability(nft, remark, OP_TYPES.BUY);

switch (true) {
case Boolean(nft.burned):
throw new Error(
Expand Down
6 changes: 4 additions & 2 deletions src/rmrk2.0.0/tools/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ export const getBlockCallsFromSignedBlock = async (
caller: encodeAddress(extrinsic.signer.toString(), ss58Format),
} as BlockCall);
} else {
const isBalanceTransfer =
`${el.section}.${el.method}` === `balances.transfer`;
const isBalanceTransfer = [
`balances.transfer_keep_alive`,
`balances.transfer`,
].includes(`${el.section}.${el.method}`);

const extraCall = {
call: `${el.section}.${el.method}`,
Expand Down

0 comments on commit fde7cd2

Please sign in to comment.