diff --git a/bcos-executor/src/executive/TransactionExecutive.cpp b/bcos-executor/src/executive/TransactionExecutive.cpp index ce32b4c62e..c2426bb682 100644 --- a/bcos-executor/src/executive/TransactionExecutive.cpp +++ b/bcos-executor/src/executive/TransactionExecutive.cpp @@ -851,7 +851,8 @@ CallParameters::UniquePtr TransactionExecutive::internalCreate( Entry entry = {}; entry.importFields({std::move(codeString)}); m_storageWrapper->setRow(codeTable, ACCOUNT_CODE, std::move(entry)); - if (!callParameters->abi.empty()) + if (!callParameters->abi.empty() && + blockContext().blockVersion() != (uint32_t)protocol::BlockVersion::V3_0_VERSION) { Entry abiEntry = {}; abiEntry.importFields({std::move(callParameters->abi)}); @@ -859,9 +860,22 @@ CallParameters::UniquePtr TransactionExecutive::internalCreate( } } - /// set link data - tool::BfsFileFactory::buildLink( - linkTable.value(), newAddress, "", blockContext().blockVersion()); + if (blockContext().blockVersion() == (uint32_t)protocol::BlockVersion::V3_0_VERSION) + { + /// set link data + Entry addressEntry = {}; + addressEntry.importFields({newAddress}); + m_storageWrapper->setRow(tableName, FS_LINK_ADDRESS, std::move(addressEntry)); + Entry typeEntry = {}; + typeEntry.importFields({FS_TYPE_LINK}); + m_storageWrapper->setRow(tableName, FS_KEY_TYPE, std::move(typeEntry)); + } + else + { + /// set link data + tool::BfsFileFactory::buildLink( + linkTable.value(), newAddress, "", blockContext().blockVersion()); + } } callParameters->type = CallParameters::FINISHED; callParameters->status = (int32_t)TransactionStatus::None; diff --git a/bcos-tool/bcos-tool/BfsFileFactory.cpp b/bcos-tool/bcos-tool/BfsFileFactory.cpp index b261ced54a..57c570954f 100644 --- a/bcos-tool/bcos-tool/BfsFileFactory.cpp +++ b/bcos-tool/bcos-tool/BfsFileFactory.cpp @@ -94,7 +94,7 @@ bool BfsFileFactory::buildLink(Table& _table, const std::string& _address, const _table.setRow(FS_LINK_ABI, std::move(abiEntry)); } - if (!name.empty()) + if (!name.empty() || blockVersion == (uint32_t)protocol::BlockVersion::V3_0_VERSION) { Entry nameEntry; nameEntry.importFields({name});