symbol-sdk-typescript-javascript icon indicating copy to clipboard operation
symbol-sdk-typescript-javascript copied to clipboard

Deadline can't be set greater that 6 hours

Open APshenkin opened this issue 5 years ago • 1 comments

  1. Expected behavior and actual behavior. In documentation https://docs.symbolplatform.com/serialization/transaction.html#id2 I can see deadline - Number of milliseconds elapsed since the creation of the nemesis block. If a transaction does not get included in a block before the deadline is reached, it is deleted. Deadlines are only allowed to lie up to 24 hours ahead. But if I set this value greater than 6 hours then transaction doesn't apply in blockchain. Also when publishing transaction with deadline greater than 6 hours I receive the same response as for successful broadcast
{
    "message": "packet 9 was pushed to the network via /transactions"
}

This response is not clear and doesn't provide information about bad transaction deadline. 2. Steps to reproduce the problem.

const rawAddress = 'TCFV4TKV6RMN7QPR3PTBXDWIJCLXDVKSIPEEUAQ';
const recipientAddress = Address.createFromRawAddress(rawAddress);
// replace with network type
const networkType = NetworkType.TEST_NET;
// replace with symbol.xym id
const networkCurrencyMosaicId = new MosaicId('5B66E76BECAD0860');

const transferTransaction = TransferTransaction.create(
  Deadline.create(7),
  recipientAddress,
  [new Mosaic (networkCurrencyMosaicId,
    UInt64.fromUint(1000000))],
  EmptyMessage,
  networkType,
  UInt64.fromUint(2000000));

// replace with sender private key
const privateKey = '1111111111111111111111111111111111111111111111111111111111111111';
const account = Account.createFromPrivateKey(privateKey, networkType);
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '6C1B92391CCB41C96478471C2634C111D9E989DECD66130C0430B5B8D20117CD';
const signedTransaction = account.sign(transferTransaction, networkGenerationHash);
console.log('Payload:', signedTransaction.payload);
console.log('Transaction Hash:', signedTransaction.hash);

const nodeUrl = 'http://api-01.eu-central-1.0.10.0.x.symboldev.network:3000';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();

transactionHttp
  .announce(signedTransaction)
  .subscribe((x) => {
    console.log(x)
  }, (err) => {
    console.error(err)
  });
  1. Specifications like the version of the project, operating system, or hardware. symbol-sdk version 0.21.0

APshenkin avatar Nov 11 '20 16:11 APshenkin

Is this error still reproducible in the latest sdk?

rg911 avatar Feb 05 '21 16:02 rg911