Comments (4)
Hi @somereason thanks for raising. Is this reproducible? It would be useful to have the steps you took to construct the transaction.
from cardano-rosetta.
//cardano client lib
@Test
void calcTxHash() throws Exception {
BigInteger fee = BigInteger.valueOf(200000);
BigInteger inputAmount = BigInteger.valueOf(99600000);
var bodyBuilder = new TransactionBody.TransactionBodyBuilder()
.ttl(66000000)
.inputs(List.of(new TransactionInput.TransactionInputBuilder()
.transactionId("607452ed1beaafd69df00cb3667dd393cea655a58686442c2d74914066486a20")
.index(0)
.build()))
.outputs(List.of(new TransactionOutput.TransactionOutputBuilder()
.address(address)
.value(Value.builder()
.coin(inputAmount.subtract(fee))
.build())
.build()))
.fee(fee);
Transaction tx = Transaction.builder()
.body(bodyBuilder.build())
.auxiliaryData(AuxiliaryData.builder()
.metadata(new CBORMetadata().put(BigInteger.valueOf(1924), "hello world"))
.build())
.build();
tx = account.sign(tx);
System.out.println(tx.getBody().getHash());
Assertions.assertTrue(tx.getBody().getHash().equals("ed274c6e445d3b173956d788bd33acfe1fcafa18d7a2b9c0d89c2ffd465888b6"));
System.out.println(HexUtil.encodeHexString(getRosettaBytes(tx.serializeToHex())));
}
public static byte[] getRosettaBytes(String signedTxn) throws CborException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new CborEncoder(baos).encode(new CborBuilder()
.addArray()
.add(signedTxn)
.addMap()
.addKey("operation")
.value("")
.end()
.end()
.build());
return baos.toByteArray();
}
note: getRosettaBytes works fine under cardano-clinet-lib version 0.1.5 and cardano-rosetta 1.5.0, but now I'm using cardano-clinet-lib version 0.2.0-beta2 and cardano-roestta 1.7.0
from cardano-rosetta.
I couldn't say exactly the cause here because Rosetta is intended to be used with the construction workflow, see Flow of Operations. Perhaps this issue is related to deserialising a transaction with custom metadata.
from cardano-rosetta.
I couldn't say exactly the cause here because Rosetta is intended to be used with the construction workflow, see Flow of Operations. Perhaps this issue is related to deserialising a transaction with custom metadata.
but this transaction has broadcasted. so it seems the hex is legal.
from cardano-rosetta.
Related Issues (20)
- Is Cardano Rosetta 1.7.1 ready for the Vasil Hard Fork? HOT 5
- Pool deposit is given for every pool registration operation, including those which are only updates
- Cannot restore Cardano-rosetta from db-sync snapshot anymore
- Search transactions endpoint on fully synced mainnet tooks > 1min HOT 6
- Tx serialization in offline mode raise error
- Repo Preparation for MBO HOT 1
- Parse signed transaction error HOT 8
- start failed,what reason? HOT 1
- Support of cardano-rosetta for Cardano 8.0.0 HOT 1
- /block Endpoint Incorrectly Returns Error for Nonexistent Blocks HOT 1
- Unable to get cardano-rosetta working HOT 4
- cardano-rosetta 2.1.0 is vulnerable HOT 1
- Rosetta Database Access
- Docker Build Appears Broken in 2.1.0 HOT 4
- README typo: Wrong docker build url HOT 1
- Error while broadcasting transaction HOT 3
- Transaction created with 2.2.5+v9 is not being accepted HOT 9
- pending transaction HOT 1
- deserialize the signed transaction HOT 3
- deserialization HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cardano-rosetta.